- Create NWS Managed Kubernetes
- Install kubectl and kubelogin
- Connect to the created cluster
- Starting further clusters in the same K8s project
Create NWS Managed Kubernetes
To start our Managed Kubernetes service, you must first create an account on our NWS Customer Interface and provide a valid payment method.
The first step to the cluster would now be to start the first cluster in the Clusters submenu. In the concrete example with the smallest requirements and in version 1.25.2
In the background, NWS automations start, create an OpenStack project, create the machines, and configure the cluster with all the necessary components. After 5-10 minutes, the cluster is ready for use.
Install kubectl and kubelogin
kubectl is the command-line tool to manage your Kubernetes clusters and is available for Linux, Windows and MacOS. For an easy installation follow the official instructions on kubernetes.io.
kubelogin (kubectl oidc-login)
kubelogin is a plugin that extends kubectl with OpenID Connect. This is mandatory to use NWS-ID with your Kubernetes cluster. Follow the official instructions for easy installation.
Connect to the created cluster
Now that the cluster is built and kubectl is already installed, it is time to connect to the cluster. This is done by clicking on "Download-Config" in the context menu next to the cluster in the NWS backend.
The just downloaded Config must now be moved to the correct place.
To do this, we create a directory in the user home that is still required (if it does not exist) and copy the file into it. At the end we adjust the rights. All work is done as a local user:
mv ~/Downloads/config ~/.kube/
chmod 0600 ~/.kube/config
Now way is free for the first connection and the test with the cluster. Therefore, we execute the following command and check whether nodes are displayed. If you use NWS-ID, your browser will open for authentication. After that, just switch back to the terminal.
kubectl get nodes
NAME STATUS ROLES AGE VERSION
workshop-virgin2-ytwudzfwjco6-master-0 Ready master 17h v1.23.1
workshop-virgin2-ytwudzfwjco6-node-0 Ready <none> 17h v1.23.1
Starting further clusters in the same K8s project
If you need a staging cluster and a production cluster, this can easily be done in the same Kubernetes app - but you'll need to launch separate clusters for each.