Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Kubernetes Cluster installation Guide: kubelet component deployment

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report