Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Use a cluster

Docker Swarm

...

You can interact with your docker swarm with the docker CLI. This must of course be installed on your computer locally first. (noe om login-servere?)

Code Block
$ mkdir -p ~/clusters/docker-swarm
$ $(openstack coe cluster config <your-cluster> --output-certs --dir ~/clusters/docker-swarm)

This will generate a client certificate with a corresponding key, download the CA certificate and export some environment variables needes for the docker client in order to communicate with your cluster.

Example, to list the nodes of your docker swarm:

Code Block
$ docker node ls
ID                            HOSTNAME                                        STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
twmj3a98bo6y1swu9zpz4dmig     sverm-r5rpscxldtrc-node-0.novalocal             Ready               Active                                  1.13.1
us5q2whrjdb1rwiqzegc8xi12     sverm-r5rpscxldtrc-node-1.novalocal             Ready               Active                                  1.13.1
6liccpscem1xo6x2a7kbcvtuz *   sverm-r5rpscxldtrc-primary-master-0.novalocal   Ready               Active              Leader              1.13.1


Kubernetes

You can interact with your kubernetes cluster with kubectl. Install it first, if you don't already have it. Install-guide (noe om login-servere?)

Source your cluster config:

...

That should just work, and you can run kubectl commands as you please.

Example, to check if services are running

Code Block
$ kubectl get nodes
NAME                            STATUS   ROLES    AGE    VERSION
mycluster-o56ashbsrqqa-master-0   Ready    master   131m   v1.15.12
mycluster-o56ashbsrqqa-minion-0   Ready    <none>   131m   v1.15.12
mycluster-o56ashbsrqqa-minion-1   Ready    <none>   131m   v1.15.12

Our public kubernetes template does not have the keystone auth module enabled by default. But if you chosse to enable it via label overrides, that makes it possible to interact with your newly created cluster via the environment variables from your opencrc file. If you want that, configure kubectl to use openstack auth as follows:

...