Introduction to Kubernetes

../_images/kube2.png

Kubernetes is an open-source container-orchestration system for automating deployment, scaling, and management of containerized applications. It has a large, rapidly growing ecosystem and the services, support, and tools are widely available. Kubernetes provides you with a framework to run distributed systems resiliently.

With E2E Myaccount portal, You can quickly launch the Kubernetes master,worker nodes and get started working with your Kubernetes cluster in a minute.

Below are the two main components of Kubernetes Cluster, Master and Worker nodes

Master Node

A master node controls and manages a number of worker nodes and forming a cluster in Kubernetes. It has the below components to help manage your worker nodes

  • Kube-APIServer - Its acts as a frontend to the cluster and all communication are done via API server
  • Kube-Controller - Manager - It controls all the running cluster and has executed control over the cluster
  • Kube Scheduler - Scheduler is used to schedule all the activities to the worker nodes based on events occurring

Worker Node

This node is controlled by the master node, New worker nodes can join an already running Kubernetes cluster. In order to connect a worker node with master node, You need to provide the exact ONEAPP_K8S_ADDRESS of master Node while deploying a worker node. Otherwise, This node will be deployed as an independent master of a single-node cluster.

  • kubeadm - It gets the information about the cluster from the Kubernetes API server.
  • kubelet - This take over information to begin the process, Where we are able to connect to the server using the node’s identity.

Tip

This is basic introduction of Kubernetes, If you want to learn more details of it, Please refer here

Deploying and Managing E2E Kubernetes Cluster

Launching a Master Node

While Launching a master Node, you don’t need to setup anything in advance.It’s a fully functional single-node Kubernetes cluster which can be extended by other worker nodes at any time later.

You can launch a master Node from Kubernetes option on Create Compute Node Page and select Master Node to Launch with appropriate Plans.

../_images/Kubernetes1.png

Tip

You can refer Virtual Computes Node section for more details on How to Launch and Manage Node.

Launching a Worker Node

While Launching a Worker Node, you need below details of ONEAPP_K8S Address of Master Node in advance,You will be asked this detail before launching your Worker Node.

K8S_ADDRESS
K8S_HASH
K8S_TOKEN

Example Values

K8S_ADDRESS - 101.53.xx.xx (Your server IP address)
K8S_HASH - ee8891d01c8027ce4a82cebc688c09686a37b6d2aabeb302ad2cf7d726xxxxxx
K8S_TOKEN - pejze8.89b8lxxxxxxxxxx

Note

You can find all values of these parameters on master node in the path /etc/one-appliance/config

Once You have got the details,You can Launch the worker Node from Myaccount Portal by providing those parameters.

../_images/Kubernetes2.png

That’s it, You have now successfully Launched the master and worker node from Myaccount. Now It’s time to connect to the cluster.

Accessing Kubernetes Cluster Remotely

To control the Kubernetes cluster remotely, you need to have the kubectl CLI tool installed on your system. Follow the official installation guide . When finished, you can validate the correct installation by running below command on your Local Machine.

kubectl --help

You also need to have the configuration with cluster Master node IP address and access keys added in your local machine to connect. This configuration can be taken from the master node from a file /etc/kubernetes/admin.conf and copy it on your remote system into ~/.kube/config.

For example,run below command to create a configuration directory and copy the config file

mkdir -p ~/.kube

scp root@masternodeip:/etc/kubernetes/admin.conf ~/.kube/config

Tip

You can Validate the tool if it’s configured properly by checking the cluster nodes status with command kubectl get nodes

Accessing Kubernetes Dashboard

Kubernetes Dashboard (Web UI) is not accessible by default and must be enabled on a remote system that you’ll access from.

Run the proxy command, This command will remain running on foreground, hit CTRL+C to terminate it at the end.

kubectl proxy

Starting to serve on 127.0.0.1:8001

On the same host, open your web browser and paste the below URL to open Kubernetes Dashboard

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

You’ll get on the Kubernetes Dashboard login screen.

../_images/kubedash.png

Select the Token option and Paste the value of k8s_ui_login_token (Make sure you copy the correct parameter with full value) from /etc/one-appliance/config located on the master node

You can now explore the Kubernetes cluster to deploy the applications

../_images/kubedash1.png

Tip

For further information on the Kubernetes cluster management,You can refer the official documentation