Skip to content

Quickstart

Quickstart

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            |
| 680c95e1-d3ee-4ceb-94ae-05252e62b938 | kubernetes-1.17.5-1       |
| c96265f2-0ddb-420f-a674-b2252fde3230 | kubernetes-1.18.2-3       |
| 67036e75-c24a-4c58-a583-f469e332a89d | kubernetes-1.18.2-3-multi |
+--------------------------------------+---------------------------+

Kubernetes

Here's the sequence of commands to launch a new kubernetes cluster:

$ openstack coe cluster create mykubcluster --keypair mykey \
    --cluster-template kubernetes-1.18.2-3 --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.18.2
mykubcluster-l5p4p2ewishg-node-0     Ready    <none>   10m  v1.18.2
mykubcluster-l5p4p2ewishg-node-1     Ready    <none>   10m  v1.18.2

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    |
+--------------------------------------+---------------+------------+--------------+--------------------+

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.18.2-3
+-----------------------+-----------------------------------------------------+
| Property              | Value                                               |
+-----------------------+-----------------------------------------------------+
| name                  | kubernetes-1.18.2-3                                 |
| 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.18.0',                  |
|                       | u'autoscaler_tag': u'v1.18.2', 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.18.2', ... }                      |
...
+-----------------------+-----------------------------------------------------+

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.18.2-3 --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.