Knowledge Base | Xelon AG

How to: Setup Docker Machine Driver for Kubernetes

Written by Michael Dudli | Aug 23, 2022 10:54:29 AM

This article shows and explains how to setup a docker machine driver for Kubernetes. We use our Cloud Platform, the Xelon HQ to demonstrate this example. You can also test and use it for free by registration on our Xelon HQ Site.

Docker Machine Driver comes with a native virtualization rather than an Oracle Virtual Box. If you want to install multiple Docker machines from Xelon HQ for Kubernetes, then you need a Docker machine which is created to manage and deploy multiple-nodes from the Xelon HQ. Both Docker machines for Windows and Mac contains the latest machine driver. So, in either way if you install any of these, then you have a docker-machine.

To install Docker Machine Driver from Xelon HQ for Kubernetes, you need to use docker-machine-driver-xelon with a Virtual Box Driver on Mac and a hyperV Driver for Windows (NB: Both drivers are executed with the same node but a different host). In both cases, the docker-machine-driver-xelon creates additional Xelon local machines. More so, after creating the docker machine driver, you need to initiate the docker machines on Xelon by using your pass and token to docker-machine-create—xelon-token option to run on your cluster.

Setting up a Kubernetes Cluster

After setting up the environment for the Docker Machine Xelon Driver, it is time to set-up a Kubernetes Cluster which will be responsible for initiating the Docker Machine Xelon Driver from Xelon HQ. You can run a Kubernetes Cluster locally by:

  • Ensure you have installed a Kubernetes Cluster, and kubectl command-line tool is configured to liaise with your cluster. If you don’t have a cluster, you can create one using a minikube or Katacoda and execute with Kubernetes

     

  • Ensure the version you are using is 1.10.0 or higher.

Once the Kubernetes Cluster is set, the Docker Machine Driver is ready to deploy from the Xelon HQ.

Options Available for Docker Machine Driver

Now that the Kubernetes Cluster is up and running, you need to initiate the usage by using the following command:

$ docker-machine create --driver xelon \

--xelon-token *YOUR-TOKEN* \

MY_INSTANCE

If at any instance you encounter a problem with your directory, then run the following command to clear and activate the debugging mode:

docker-machine --debug create ...

For explicit passing variables, run the driver xelon MY-INSTANCE command. Additionally, you may opt to use different commands like checking and configuring the kubernetes ID and the memory size of you drive from Xelon HQ. Here are some of the options the Docker Machine Xelon Driver provides:

--xelon-swap-disk-size: Swap disk size for the device in GB.

--xelon-token: required Xelon authentication token.

--xelon-api-base-url: Xelon API base URL.

--xelon-cpu-cores: Number of CPU cores for the device.

--xelon-device-password: Password for the device.

--xelon-disk-size: Drive size for the device in GB.

--xelon-kubernetes-id: Kubernetes ID for the device.

--xelon-memory: Size of memory for the device in GB.

--xelon-ssh-port: SSH port to connect.

--xelon-ssh-user: SSH username to connect.

Running the Docker Machine Xelon Driver requires certain environments to be deployed in order for the Driver to deploy from Xelon HQ. Here are the default values and environment variables for the machine driver to deploy Kubernetes Clusters and nodes from Xelon HQ effectively.

CLI Options Default Environment Variable
–xelon-api-base-url https://vdc.xelon.ch/api/user/ XELON_API_BASE_URL
–xelon-cpu-cores 2 XELON_CPU_CORES
–xelon-device-password Xelon22 XELON_DEVICE_PASSWORD
–xelon-disk-size 20 XELON_DISK_SIZE
–xelon-kubernetes-id kubl XELON_KUBERNETES_ID
–xelon-memory 2 XELON_MEMORY
–xelon-ssh-port 22 XELON_SSH_PORT
–xelon-ssh-user root XELON_SSH_USER
–xelon-swap-disk-size 2 XELON_SWAP_DISK_SIZE
–xelon-token - XELON_TOKEN

 

Release Process of Docker Machine Driver

After running the driver, you need to perform a release sequence. The release sequence uses a continuous integration which is deployed from CircelCI. This means that the code is ready to release at any time.

Below is a checklist for releasing the Docker Machine Xelon Driver. Carefully follow these steps to successfully release the driver:

  • Confirm that the latest build compiles executed successfully and passed the test.
  • Trigger the release sequence by typing the tagging git commit command with

     

    # X.Y.Z. is a release version, e.g. 1.2.0

    $ git tag -a vX.Y.Z -m "Release vX.Y.Z."

  • Wait for the release sequence to execute and create the release. NB: At this point you can update the release information if necessary.

If you still have a question How to setup Docker Machine Driver from Xelon HQ for Kubernetes please let us know! Contact our DevOps free of charge!