ویرگول
ورودثبت نام
snehacynixit
snehacynixit
snehacynixit
snehacynixit
خواندن ۴ دقیقه·۷ سال پیش

Running Kubernetes Cluster using Kind and Docker

Before we start running the process using different tools and components, we must know about the Kubernetes and other tools that help in this process. Kubernetes is an open-source container-based system that automates the process of deploying, scaling and managing applications. Being open-source, Kubernetes is compatible with any of the platforms like on-premise, cloud, hybrid infrastructure. It moves the workloads according to the requirement. Kubernetes cluster refers to the systems that are connected to each other to work in a single frame.

Docker is a platform that makes it easy to create, run and deploy applications using small containers. Containers are small packages of software that can be moved easily to any place. Each container is different from one another. for more techniques kubernetes cetification training

A Kind is a tool that helps in running local Kubernetes clusters using Docker containers as nodes.

Kubernetes in Docker kind

Kubernetes is developed as a highly available cluster of systems that connects to work as a single infrastructure. The main role of Kubernetes is to automate the scheduling of containers among the clusters in an efficient manner.

Here we will understand how to run the cluster in different steps with a single Docker container in Kind.

In this process, we will start by installing Kind.

The Kind installation is done through the following commands. :-

go get -u sigs.k8s.io/kind

kind create cluster

Next, we will confirm the cluster.

kind get clusters

Setting Kubectl

Here first, we need to install the Kubernetes. Then we will create Kubectl. The following command will check the version of kubectl.

kubectl version

Once kubectl and kind are ready, we will run the following command.

export KUBECONFIG=”$(kind get kubeconfig-path)”

kubectl cluster-info

Deploying application

In this part, we will see the deploying process of application. Here first, we download the mysql-deployment.yaml & wordpress-deployment.yaml

Now, we will create kustomization.yaml. for more kubernetes course

Then we will check it through the following command.

k8s-wp/

kustomization.yaml

mysql-deployment.yaml

wordpress-deployment.yaml

Then we will apply to the cluster.

cd k8s-wp

kubectl apply -k ./

Here we can see the output like this;

secret/mysql-pass-7tt4f27774 created

service/wordpress-mysql created

service/wordpress created

deployment.apps/wordpress-mysql created

deployment.apps/wordpress created

persistentvolumeclaim/mysql-pv-claim created

persistentvolumeclaim/wp-pv-claim created

To check the cluster status, we can use the following commands.

kubectl get secrets

kubectl get pvc

kubectl get pods

kubectl get services wordpress

We should wait until the pods show running status.

Later we have to run the following command to access the service.

kubectl port-forward svc/wordpress 8080:80

Now we can open http://localhost:8080/

Thus, kind is the best alternative to minikube as it uses only a single Docker container.

Kind Kubernetes version

We can see that the version string may look like v2 or v2 beta 1. The versions are sorted out by the following algorithm

  • First we sort out the Entries those following the Kubernetes version pattern.
  • For the entries that are following the Kubernetes version pattern, the numeric portion in that version string is sorted out.
  • In case strings like alpha or beta follow the numeric portion, then they are sorted in the way that the equivalent string should come without beta or alpha suffix.
  • If other numbers also follow beta or alpha then they can be sorted differently.
  • Strings that do not fit in the above format, they are sorted alphabetically and not numerically.

Kubernetes Kind type

Kind represents the K8s type of objects that are created. These can be a Pod, Service, DaemonSet, etc. K8s API version helps to create the resources. These resources can be v1, v1beta, etc.

Thus, we have seen how to run the Kubernetes cluster using Kind and Docker in the above article. We can see the steps and commands that follow the process of installing and running the cluster. It shows how the cluster will run smoothly by using different steps. Kubernetes is useful to run different kinds of applications. As it is an open-source system that is based on containers. As we know that the containers are small software packages.

It gives an overview of the Kubernetes, Docker, and kind in a simple way to understand the way they work together. The Kubernetes cluster gives the platform to automate the scaling, operating and deploying of application containers across the clusters. One can start their career by gaining knowledge of Kubernetes and different components through Kubernetes Online Training.

This knowledge will help to grow the career as the application implementations are increasing day by day. Having knowledge of the above tools and technology, one can prosper in this way.

۰
۰
snehacynixit
snehacynixit
شاید از این پست‌ها خوشتان بیاید