This is the second day of my participation in the August More text Challenge. For details, see: August More Text Challenge

A background

In addition to Minikube, there are many other excellent K8s environment deployment tools, kind is Kubernetes In Docker, as the name implies, is all the components K8s need, All of them are deployed in a Docker container, which is a set of out-of-the-box K8S environment construction solution. You can’t use kind clusters in production, but if you just want to play around with K8s locally and don’t want to use too many resources, you can use Kind. Similarly, kind can also very convenient to help you local K8S source code into the corresponding image, convenient testing.

The second Kind introduction

Kind (Kubernetes IN Docker) is a tool for building Kubernetes cluster based on Docker, which is very suitable for building local development/testing environment based on Kubernetes.

2.1 Kind startup process

  1. The default is kindest/node:v1.13.4. This image contains everything you need to install, including the kubectl, kubeadm, and kubelet binaries, as well as the images needed to install the k8s version. Are stored in a tar package in a path in the image
  2. To prepare your node, start the container, unpack the image, and so on
  3. Generate the corresponding configuration of Kubeadm, and then install it through Kubeadm. After the installation, it will also do some other operations, such as I just installed a single node cluster, will help you remove the stain on the master node, otherwise it will not be able to deploy the pod that is not tolerant.
  4. To start over

2.2 Kind vs Minikube

  • Instead of packaging a virtualized image, Kind runs the K8S component directly on Docker.
  1. The GuestOS does not need to be run.
  2. It is not based on virtualization technology and can be used in VMS.
  3. The files are smaller and more portable.
  • Supports multi-node K8S cluster and HA

Kind supports multi-role node deployment, and you can control how many Master nodes and Worker nodes you need through the configuration file to better simulate the actual production environment.

Iii Installation and Deployment

3.1 MacOS installation

brew install kind
Copy the code

3.2 Installing a Linux OS

Kind installation does not include Kubectl and Docker, you can install Kubectl and Docker on the server

3.2.1 docker installation

yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum clean all && yum makecache fast
yum -y install docker-ce
systemctl start docker
Copy the code

3.2.2 kubelet installation

Curl - LO, https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl && \ chmod + x ./kubectl &&\ mv ./kubectl /usr/bin/kubectlCopy the code

3.2.3 Kind installation

Wget https://github.com/kubernetes-sigs/kind/releases/download/0.2.1/kind-linux-amd64 mv kind - Linux - amd64 kind chmod + x kind mv kind /usr/local/binCopy the code

4 use

#Create the cluster
$ kind create cluster

$ kubectl get po -ANAMESPACE NAME READY STATUS RESTARTS AGE kube-system coredns-86c58d9df4-vwm4m 1/1 Running 0 6m37s kube-system coredns-86c58d9df4-xxk8s 1/1 Running 0 6m37s kube-system etcd-kind-control-plane 1/1 Running 0 5m35s kube-system kube-apiserver-kind-control-plane 1/1 Running 0 5m49s kube-system kube-controller-manager-kind-control-plane 1/1 Running  0 5m23s kube-system kube-proxy-d8zn6 1/1 Running 0 6m37s kube-system kube-scheduler-kind-control-plane 1/1 Running 0 5m40s kube-system weave-net-llqf9 2/2 Running 1 6m37s$ kubectl get nodes
NAME                 STATUS   ROLES    AGE     VERSION
kind-control-plane   Ready    master   6m57s   v1.13.4
$ docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9a1318b80b5a kindest/node:v1.13.4 "/usr/local/bin/entr..." 7 minutes ago Up 7 minutes 33895/ TCP, 127.0.0.1:33895->6443/ TCP kindn-control-plane$ docker imagesREPOSITORY TAG IMAGE ID CREATED SIZE Kindest /node v1.13.4 eAECF3D2C4de 2 years ago 1.58GB$ kubectl cluster-info
Kubernetes master is running at https://localhost:33895
KubeDNS is running at https://localhost:33895/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
Copy the code

Refer to the link

  • www.psvmc.cn/article/202…
  • Kind. The sigs. K8s. IO/docs/user/q…
  • Github.com/kubernetes-…