-
Notifications
You must be signed in to change notification settings - Fork 2
Deploying Cloud Assess
In this tutorial, we assume you are a Cloud Provider who wants to display the environmental footprint of its virtual machine service to its customers.
This tutorial will guide you through
- Initial configuration of Cloud Assess
- Deploying Cloud Assess in a Kubernetes environment
- Automating configuration updates
For this tutorial, you will need to checkout the Cloud Assess repository
git clone https://github.com/kleis-technology/cloud-assessYou will also need
- access to a Kubernetes cluster
- command line tool
helm
The folder trusted_library is organized as follows
- The
libfolder contains the lca as code models (*.lcafiles). They encode the allocation rules to compute the environmental impacts of various services (e.g. virtual machines). - The
inventorycontains your inventory, i.e. the list of all your physical equipments, as well as their impact factors.
Configuring Cloud Assess consists in filling in the various inventories and
their related impact files. We assume that you edit the inventory and impact
files in the folder inventory.
For this tutorial, we will assume that you have 3 datacenters located in 3
different countries (Switzerland, Germany, and France). These datacenters are
described in dc_inventory.csv. For each datacenter, you need to provide
-
id, a unique identifier, e.g.dc-ch,dc-deordc-fr -
geo, a geographic location, e.g.CH,DEorFR -
total_power, the nominal power (inkW) of the whole datacenter, e.g.5000 kW -
lifespan, the estimated lifespan (inyear) of the datacenter, e.g.25 year -
reserved_power, the power (inkW) you have reserved in the datacenter, e.g.100 kW -
power_usage_effectiveness, the power usage effectiveness (dimensionless), e.g.1.2
Next, you must fill in the impact factors.
First, the file dc_impacts.csv must contain,
- for each datacenter identified by its id,
- for each lifecycle step
manufacturing,transport,useandend-of-life, - the impacts for all the environmental indicators.
You must also fill in the impact factors of the electricity mix, in the file
electricity_mix.csv. This file contains
- for every geographic location,
- the impacts for all the environmental indicators.
Cloud Assess considers three kinds of (physical) equipments
- servers
- storage equipments
- network equipments We focus on the servers in this tutorial. The other kinds of equipments are treated similarly.
The file server_inventory.csv should contain the list of all servers that are
necessary to run your service. In our case, this means all servers where the
client virtual machines run, and, possibly, other servers (e.g. admin or
monitoring).
You can organize your servers in pools. For instance, if you have two virtual machine offers (e.g., basic and performance), corresponding to two disjoint of server resources, you can form two pools of servers.
For each server equipment, in the inventory file server_inventory.csv,
you must provide
-
id, a unique identifier, e.g. the model reference of the equipment -
pool_id, a unique pool identifier -
dc_id, the datacenter identifier -
power, the average power consumption (inW) -
lifespan, the estimated life span (inyear) of the equipment -
quantity, the multiplicity (dimensionless) of this equipment in the pool
Next, you must fill in the impact file server_impacts.csv
- for each server, identified by its unique identifier,
- for each lifecycle step
manufacturing,transport,useandend-of-life, - the impacts for all the environmental indicators.
To package the inventory, you compress the content of the folder inventory in a zip file.
> cd $GIT_ROOT/trusted_library/inventory
> zip -r ../inventory.zip .Notice that the CSV files must appear at the first level in the archive.
> unzip -l inventory.zip
Archive: inventory.zip
Length Date Time Name
--------- ---------- ----- ----
17153 11-04-2025 00:20 storage_impacts.csv
156 11-04-2025 00:20 storage_space_inventory.csv
101 11-04-2025 00:20 dc_inventory.csv
113 11-04-2025 00:20 compute_inventory.csv
888 11-10-2025 13:33 network_inventory.csv
888 11-10-2025 13:31 server_inventory.csv
950 11-04-2025 00:20 maintenance_impacts.csv
130 11-04-2025 00:20 vm_inventory.csv
17153 11-04-2025 00:20 server_impacts.csv
17153 11-04-2025 00:20 network_impacts.csv
968 11-04-2025 00:20 dc_impacts.csv
292 11-04-2025 00:20 electricity_mix.csv
888 11-10-2025 13:33 storage_inventory.csv
--------- -------
56833 13 filesFirst, create a namespace
> kubectl create ns cloud-assessA Helm chart is available in the Cloud Assess repository under
$GIT_ROOT/charts. You can deploy Cloud Assess as follows
> cd $GIT_ROOT/charts
> helm install \
--set lca.archive.inventory.content="$(base64 $GIT_ROOT/trusted_library/inventory.zip)"\
-n cloud-assess\
cloud-assess cloud-assessNotice that the file inventory.zip is passed to helm as a base64 encoded data.
By default, the chart creates a deployment (with 1 replica) and a service.
It also creates a configmap containing the inventory.zip content.
If your inventory (and impact files) is updated,
you must redeploy Cloud Assess with this inventory.
First, package the files under the folder inventory in a zip archive inventory.zip.
Then, update the Helm release
> cd $GIT_ROOT/charts
> helm -n cloud-assess\
update cloud-assess cloud-assess\
--set lca.archive.inventory.content="$(base64 $GIT_ROOT/trusted_library/inventory.zip)"The pods should restart (ensuring that Cloud Assess reboots with the new data).
Request an assessment to check that the server runs correctly. Create a port-forward
> kubectl -n cloud-assess port-forward service/cloud-assess 8080:8080Use curl or any other tool to post a request on localhost:8080. Cf $GIT_ROOT/samples/virtual_machines.http for an example.