Get the App
SLTechnology News&Howtos  ›  Servers  › 

Kubernetes Cluster installation Guide: kubelet component deployment

Shulou Source: shulou.com Published: 2022-06-03 01:57:16 09月22日 Update

Kubelet is an important component of kubernetes. The management of pod container is inseparable from the execution of interactive commands (such as exec, run, logs, etc.). Kubelet runs on each worker node and is responsible for receiving requests sent by kube-apiserver. Kubelet automatically sends registration information to kube-apiserver at startup, and built-in cadvisor statistics and monitoring node resource usage.

1. Preparatory work

Special note: all the operations here are performed on devops through the ansible tool; kubelet needs to use kubeconfig files to authenticate and access kube-apiserver, so you need to turn on certificate rotation for it.

To ensure security, the non-secure http port of kubelet is closed during deployment, the request is authenticated and authorized, and unauthorized access is denied (such as requests from apiserver and heapster).

Environment variable definition # Variable parameter setting # # KUBE_NAME=kubeletK8S_INSTALL_PATH=/data/apps/k8s/kubernetesK8S_BIN_PATH=$ {K8S_INSTALL_PATH} / sbinK8S_LOG_DIR=$ {K8S_INSTALL_PATH} / logsK8S_CONF_PATH=/etc/k8s/kubernetesKUBE_CONFIG_PATH=/etc/k8s/kubeconfigCA_DIR=/etc/k8s/sslSOFTWARE= / root/softwareHOSTNAME= `hostname`version = v1.14.2 download URL = https://github.com/devops-apps/download/raw/master/kubernetes/kubernetes-server-${VERSION}-linux-amd64.tar.gzETH_INTERFACE=eth2LISTEN_IP=$(ifconfig | grep-A 1 ${ETH_INTERFACE} | grep inet | awk'{print $2}') USER=k8sCLUSTER_DNS_DOMAIN=k8s.mo9.comCLUSTER_DNS_IP=10.254.0.2CLUSTER_PODS_CIDR=172.16.0.0/202 deployment kubelet component 2.1 installs Kubelet binaries # # # 1.Check if the install directory exists.if [!-d "$K8S_BIN_PATH"] Then mkdir-p $K8S_BIN_PATHfiif [!-d "$K8S_LOG_DIR/$KUBE_NAME"]; then mkdir-p $K8S_LOG_DIR/$KUBE_NAMEfiif [!-d "$K8S_CONF_PATH"]; then mkdir-p $K8S_CONF_PATHfiif [!-d "$KUBE_CONFIG_PATH"] Then mkdir-p $KUBE_CONFIG_PATHfi### 2.Install kubelet binary of kubernetes.if [!-f "$SOFTWARE/kubernetes-server-$ {VERSION}-linux-amd64.tar.gz"] Then wget $DOWNLOAD_URL-P $SOFTWARE > > / tmp/install.log 2 > & 1ficd $SOFTWARE & & tar-xzf kubernetes-server-$ {VERSION}-linux-amd64.tar.gz-C. / cp-fp kubernetes/server/bin/$KUBE_NAME $K8S_BIN_PATHln-sf $K8Size bindings path K8S_INSTALL_PATH2.3 ${KUBE_NAME} / usr/local/binchmod-R 755 $K8S_INSTALL_PATH2.3 create kubelet profile

```# configure default system config

Cat > ${K8S_CONF_PATH} / kubelet-config.yaml

Tags: Certificate authentication port security file component client client node resource run valid important binary interactive information trend parameter depends on variable Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker MariaDB macOS OPPO Reno Microsoft