Introduction to Kubernetes¶
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
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
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.
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.
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
K8S_ADDRESS - 101.53.xx.xx (Your server IP address) K8S_HASH - ee8891d01c8027ce4a82cebc688c09686a37b6d2aabeb302ad2cf7d726xxxxxx K8S_TOKEN - pejze8.89b8lxxxxxxxxxx
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.
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.
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
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
You’ll get on the Kubernetes Dashboard login screen.
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
For further information on the Kubernetes cluster management,You can refer the official documentation