Quickstart
Quickstart
Warning
This documentation is deprecated, please check here for its new home
The CERN cloud container service allows you to create containers clusters.
Supported technologies include Docker Swarm and Kubernetes.
Environment
Check here to get access to an openstack client, or use our docker image.
Create a cluster
For more detailed documentation check the upstream docs.
We have defined a set of public cluster templates you can reuse. These templates are updated often, so versions might differ:
$ openstack coe cluster template list
+--------------------------------------+---------------------------+
| uuid | name |
+--------------------------------------+---------------------------+
| 17760a5f-8957-4794-ab96-0d6bd8627282 | swarm-18.06-1 |
| ab08b219-3246-4995-bf76-a3123f69cb4f | swarm-1.13.1-2 |
| 0996cb4f-cf85-419c-b30b-c91e3e5e3739 | kubernetes-1.19.6-1 |
| 200327fe-10b0-4685-96c1-ecda717638c2 | kubernetes-1.20.4-4 |
| c49e8156-46be-42db-a6ff-66b7e9c96532 | kubernetes-1.21.1-1 |
+--------------------------------------+---------------------------+
Kubernetes
Here's the sequence of commands to launch a new kubernetes cluster:
$ openstack coe cluster create mykubcluster --keypair mykey \
--cluster-template kubernetes-1.21.1-1 --node-count 2
$ openstack coe cluster list
+--------------------------------------+---------------+------------+--------------+--------------------+
| uuid | name | node_count | master_count | status |
+--------------------------------------+---------------+------------+--------------+--------------------+
| 2582f192-480e-4329-ac05-32a8e5b1166b | mykubcluster | 2 | 1 | CREATE_IN_PROGRESS |
+--------------------------------------+---------------+------------+--------------+--------------------+
Once the cluster is in CREATE_COMPLETE state (only a couple minutes), you can start using it:
$ $(openstack coe cluster config mykubcluster)
$ kubectl get node
NAME STATUS AGE
mykubcluster-l5p4p2ewishg-master-0 Ready master 10m v1.21.1-1
mykubcluster-l5p4p2ewishg-node-0 Ready <none> 10m v1.21.1-1
mykubcluster-l5p4p2ewishg-node-1 Ready <none> 10m v1.21.1-1
If you want to easily reuse this config later, do instead:
$ openstack coe cluster config mykubcluster > env.sh
. env.sh
Check here if you're getting a validation error when using kubectl create.
Swarm
Here's the sequence of commands to launch a new swarm cluster:
$ openstack coe cluster create myswarmcluster --keypair mykey \
--cluster-template swarm --node-count 2
$ openstack coe cluster list
+--------------------------------------+----------------+------------+--------------+--------------------+
| uuid | name | node_count | master_count | status |
+--------------------------------------+----------------+------------+--------------+--------------------+
| 98b642fa-c2a5-11e6-b663-68f728b18b2d | myswarmcluster | 2 | 1 | CREATE_IN_PROGRESS |
+--------------------------------------+----------------+------------+--------------+--------------------+
Once the cluster is in CREATE_COMPLETE state (only a couple minutes), you can start using it:
$ $(openstack coe cluster config myswarmcluster --output-certs)
docker ps
docker info
If you want to easily reuse this config later, do instead:
$ openstack coe cluster config myswarmcluster --output-certs > env.sh
. env.sh
docker ps
Scaling a cluster
You can use the command resize to scale a cluster up or down:
$ openstack coe cluster resize mykubcluster 5
$ openstack coe cluster list
+--------------------------------------+---------------+------------+--------------+--------------------+
| uuid | name | node_count | master_count | status |
+--------------------------------------+---------------+------------+--------------+--------------------+
| 2582f192-480e-4329-ac05-32a8e5b1166b | mykubcluster | 2 | 1 | UPDATE_IN_PROGRESS |
+--------------------------------------+---------------+------------+--------------+--------------------+
$ openstack coe cluster list
+--------------------------------------+---------------+------------+--------------+--------------------+
| uuid | name | node_count | master_count | status |
+--------------------------------------+---------------+------------+--------------+--------------------+
| 2582f192-480e-4329-ac05-32a8e5b1166b | mykubcluster | 5 | 1 | UPDATE_COMPLETE |
+--------------------------------------+---------------+------------+--------------+--------------------+
Delete a cluster
In order to free up resources, you can delete your cluster by:
$ openstack coe cluster delete mykubcluster
Custom Clusters
You can customize your clusters via properties and labels, full description here.
In addition to the labels in the link above, the following are also available at CERN:
Label | Description | Default |
---|---|---|
cern_enabled | Boolean to generate CERN keytab and host certificate | False |
cern_tag | Tag to be used for all CERN containers | latest |
cvmfs_enable | Boolean indicating the cvmfs volume driver should be enabled | True |
cvmfs_storage_driver | Boolean indicating the cvmfs storage driver should be enabled | False |
cvmfs_tag | Tag to be used for the docker-volume-cvmfs container | latest |
docker_ce_version | Version of upstream docker-ce to use for the cluster | Null |
logging_producer | Indicates the cern producer where to send the logs | "" |
logging_include_internal | Send kube-system logs with fluentd | false |
nvidia_gpu_enabled | Enable detection and configuration of GPU nodes | false |
eos_enabled | If the provisioner should be deployed. | true |
Check the description of any existing template for its configuration.
$ openstack coe cluster template show kubernetes-1.21.1-1
+-----------------------+-----------------------------------------------------+
| Property | Value |
+-----------------------+-----------------------------------------------------+
| name | kubernetes-1.21.1-1 |
| coe | kubernetes |
| master_flavor_id | m2.medium |
| flavor_id | m2.medium |
| labels | {u'influx_grafana_dashboard_enabled': u'true', |
| | u'cloud_provider_tag': u'v1.21.0', |
| | u'autoscaler_tag': u'v1.21.1', u'kube_csi_enabled': |
| | u'true', u'flannel_backend': u'vxlan', |
| | u'ingress_controller': u'traefik', |
| | u'heat_container_agent_tag': u'train-stable-1', |
| | u'kube_tag': u'v1.21.1', ... } |
...
+-----------------------+-----------------------------------------------------+
As an example, to create a kubernetes cluster with monitoring enabled and a logging producer:
$ openstack coe cluster create mykubcluster --keypair mykey \
--cluster-template kubernetes-1.21.1-1 --node-count 2 \
--merge-labels \
--labels monitoring_enabled=true \
--labels logging_producer=myproducer
IMPORTANT NOTICE: You must use --merge-labels to keep the cluster template labels as well
Clusters on physical servers
It is possible to run clusters on physical servers if you have access through
the Bare Metal service. To do so, you need to specify a flavor that gives
access to physical machines with the --flavor
parameter. Note that only
worker nodes can be physical machines, master nodes must be virtual machines.
For access to physical serves refer to the Bare Metal
section.