Using the steps below we will create a kubernetes cluster and worker nodes within the IONOS environment, we will then deploy a simple whoami environment that will take an incoming http request and display information on the incoming IP address and browser.

Setup IONOS managed Kubernetes in DCD

  1. Login to DCD and go to the “Data Center” menu at the top, in the menu under “Create Data Center” enter a name for the data center and select the location you would like to create your data center in, then click “Create Data Center”
  2.  From the left side, click and drag the “Server” icon to the DCD grid
  3. Once placed, click the plus sign on the server and drag the line to the cloud icon (internet connection) to create LAN with internet access
  4. From the left palette click on the HDD Storage icon and drag onto newly created server, this will add storage to your server
  5. Click on “Provision Changes” in the lower right
  6. Ignore errors for names in the pop up window and click provision now
  7. After the server is complete click on the“Manager” menu and select “Kubernetes Manager”
  8. In Kubernetes manager select “Create Cluster” and give it a name you want, this will create your managed Kubernetes cluster.  (mau tak up to 10 minutes to create
  9. Once the cluster is created, select the newly created cluster and on the right side select the tab “Node pools in Cluster” then click the “+ Create node pool”  directly below.
  10. In Pool Settings screen give the node pool a name
  11. Select the data center that was created in the previous steps
  12. Under “Node Template” select the CPU to use (AMD/Intel) and number of cores and RAM
  13. Under “Storage Type” select HDD or SSD and enter desired size
  14. Click “Create node pool” (creation may take 30 minutes) Creation is complete when a green dot appears next to the node pool name.

Install kubectl and download kubeconfig.yaml from IONOS DCD (linux)

  1. sudo apt-get update
  2. sudo apt-get install -y apt-transport-https ca-certificates curl
  3. sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
  4. echo “deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main” | sudo tee /etc/apt/sources.list.d/kubernetes.list
  5. sudo apt-get update
  6. sudo apt-get install -y kubectl

Deploy a simple whoami instance

These files and instructions will configure a single pod and load balancer service within your kubernetes environment and assign an externally routed address to it.  This is for example purposes only.

  1. Go to https://github.com/ionoslabs/k8s-whoami and copy the contents of the ionos-whoami.yaml you can also git clone this repo to your local machine via git clone  https://github.com/ionoslabs/k8s-whoami
  2. Create a local file called ionos-whoami.yaml and paste the contents of the github ionos-whoami.yaml file to your local file
  3. At a command prompt in the same location as the previously created .yaml file run “kubectl apply -f name-of-yaml-file.yaml”
  4. This will spin up the environment with a single web server pod, persistent storage, and load balancer within the IONOS cluster
  5. Now run “kubectl get all” and note the “External-IP” 
  6. Enter the external-IP address into a web browser and you should get a response listing your computers web browser and connection parameters

Github

Copy to Clipboard

Download

Copy to Clipboard