今天就跟大家聊聊有關(guān)kubernetes中怎么安裝Node節(jié)點(diǎn),可能很多人都不太了解,為了讓大家更加了解,小編給大家總結(jié)了以下內(nèi)容,希望大家根據(jù)這篇文章可以有所收獲。
一:前言
1.Kubernetes版本1.8.5;node ip 10.116.82.28; 對于kuberentes1.8集群,必須關(guān)閉swap,否則kubelet啟動將失??;修改 /etc/fstab 將,swap系統(tǒng)注釋掉。
2.kubelet 啟動時向 kube-apiserver 發(fā)送 TLS bootstrapping 請求,需要先將 bootstrap token ?件中的 kubelet-bootstrap ?戶賦予 system:nodebootstrappercluster ??(role), 然后 kubelet 才能有權(quán)限創(chuàng)建認(rèn)證請求(certificate signing requests):
在master節(jié)點(diǎn)執(zhí)行:
點(diǎn)擊(此處)折疊或打開
cd /etc/kubernetes
kubectl create clusterrolebinding kubelet-bootstrap --clusterrole=system:node-bootstrapper --user=kubelet-bootstrap
3. 1.8版本之前.開啟rbac后,apiserver默認(rèn)綁定system:nodes組到system:node的clusterrole。v1.8之后,此綁定默認(rèn)不存在,需要手工綁定,否則kubelet啟動后會報認(rèn)證錯誤,使用kubectl get nodes查看無法成為Ready狀態(tài)
點(diǎn)擊(此處)折疊或打開
kubectl create clusterrolebinding kubelet-node-clusterbinding --clusterrole=system:node --user=system:node:10.116.82.28
kubectl describe clusterrolebindings kubelet-node-clusterbinding
多個node節(jié)點(diǎn)的話:
kubectl create clusterrolebinding kubelet-node-clusterbinding --clusterrole=system:node --group=system:nodes
二: 安裝Kubelet
service文件:/usr/lib/systemd/system/kubelet.service. 負(fù)責(zé)master節(jié)點(diǎn)中的config文件到/etc/kubernetes/config
點(diǎn)擊(此處)折疊或打開
[Unit]
Description=Kubernetes Kubelet Server
Documentation=http://kubernetes.io/docs/admin/kubelet/
After=docker.service
Requires=docker.service
[Service]
WorkingDirectory=/var/lib/kubelet
EnvironmentFile=-/etc/kubernetes/config
EnvironmentFile=-/etc/kubernetes/kubelet
ExecStart=/usr/bin/kubelet \
$KUBE_LOGTOSTDERR \
$KUBE_LOG_LEVEL \
$KUBELET_API_SERVER \
$KUBELET_ADDRESS \
$KUBELET_PORT \
$KUBELET_HOSTNAME \
$KUBE_ALLOW_PRIV \
$KUBELET_POD_INFRA_CONTAINER \
$KUBELET_ARGS
Restart=on-failure
[Install]
WantedBy=multi-user.target
kubelet配置文件
點(diǎn)擊(此處)折疊或打開
## kubelet (minion) config
#
## The address for the info server to serve on (set to 0.0.0.0 or "" for all interfaces)
KUBELET_ADDRESS="--address=10.116.82.28"
#
## The port for the info server to serve on
#KUBELET_PORT="--port=10250"
#
## You may leave this blank to use the actual hostname
KUBELET_HOSTNAME="--hostname-override=10.116.82.28"
#
## location of the api-server
#KUBELET_API_SERVER="--api-servers=http://10.116.137.196:8080"
#
## pod infrastructure container
#KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=sz-pg-oam-docker-hub-001.tendcloud.com/library/pod-infrastructure:rhel7"
KUBELET_POD_INFRA_CONTAINER="--pod-infra-container-image=registry.access.redhat.com/rhel7/pod-infrastructure"
#
## Add your own!
KUBELET_ARGS="--cgroup-driver=systemd --cluster-dns=10.254.0.2 --experimental-bootstrap-kubeconfig=/etc/kubernetes/bootstrap.kubeconfig --kubeconfig=/etc/kubernetes/kubelet.kubeconfig --require-kubeconfig --cert-dir=/etc/kubernetes/ssl --cluster-domain=cluster.local. --hairpin-mode promiscuous-bridge --serialize-image-pulls=false --runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slice"
啟動kubelet
systemctl daemon-reload
systemctl enable kubelet
systemctl start kubelet
systemctl status kubelet
通過 kublet 的 TLS 證書請求
kubelet ?次啟動時向 kube-apiserver 發(fā)送證書簽名請求,必須通過后kubernetes 系統(tǒng)才會將該 Node 加?到集群。查看未授權(quán)的 CSR 請求.
通過 CSR 請求
kubectl certificate approve node-csr-nRoS_Xp89eNuqMmIQyE1SgllqjieGyYo5uMPtmhkfJ4
三: 安裝Kube-proxy
1.yum install conntrack-tools
2.service文件 vi /usr/lib/systemd/system/kube-proxy.service
點(diǎn)擊(此處)折疊或打開
[Unit]
Description=Kubernetes Kube-Proxy Server
Documentation=http://kubernetes.io/docs/admin/kube-proxy/
After=network.target
[Service]
EnvironmentFile=-/etc/kubernetes/config
EnvironmentFile=-/etc/kubernetes/proxy
ExecStart=/usr/bin/kube-proxy \
$KUBE_LOGTOSTDERR \
$KUBE_LOG_LEVEL \
$KUBE_MASTER \
$KUBE_PROXY_ARGS
Restart=on-failure
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
3.配置文件 vi /etc/kubernetes/proxy
點(diǎn)擊(此處)折疊或打開
KUBE_PROXY_ARGS="--bind-address=10.116.82.28 --hostname-override=10.116.82.28 --kubeconfig=/etc/kubernetes/kube-proxy.kubeconfig --cluster-cidr=10.254.0.0/16"
4.啟動
systemctl daemon-reload
systemctl enable kube-proxy
systemctl start kube-proxy
systemctl status kube-proxy
看完上述內(nèi)容,你們對kubernetes中怎么安裝Node節(jié)點(diǎn)有進(jìn)一步的了解嗎?如果還想了解更多知識或者相關(guān)內(nèi)容,請關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道,感謝大家的支持。
分享標(biāo)題:kubernetes中怎么安裝Node節(jié)點(diǎn)-創(chuàng)新互聯(lián)
轉(zhuǎn)載來源:http://jinyejixie.com/article10/dipddo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、商城網(wǎng)站、電子商務(wù)、品牌網(wǎng)站建設(shè)、自適應(yīng)網(wǎng)站、微信公眾號
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容