K8S kubeadm國內映象安裝方式

2022-07-04 05:33:10 字數 3833 閱讀 3009

使用國內映象站

檢視過版本之後就可以指定版本安裝

$ sudo apt-get install -y kubelet=1.14.0-00 kubeadm=1.14.0-00 kubectl=1.14.0-00

$ sudo apt-mark hold kubelet=1.14.0-00 kubeadm=1.14.0-00 kubectl=1.14.0-00

開機啟動kubelet

sudo systemctl enable kubelet && sudo systemctl start kubelet

解決元件映象無法拉取的問題

不能fq換個方法變通處理一下

docker pull mirrorgooglecontainers/kube-apiserver:v1.14.0

docker pull mirrorgooglecontainers/kube-controller-manager:v1.14.0

docker pull mirrorgooglecontainers/kube-scheduler:v1.14.0

docker pull mirrorgooglecontainers/kube-proxy:v1.14.0

docker pull mirrorgooglecontainers/pause:3.1

docker pull mirrorgooglecontainers/etcd:3.3.10

docker pull coredns/coredns:1.3.1

docker tag docker.io/mirrorgooglecontainers/kube-apiserver:v1.14.0 k8s.gcr.io/kube-apiserver:v1.14.0

docker tag docker.io/mirrorgooglecontainers/kube-controller-manager:v1.14.0 k8s.gcr.io/kube-controller-manager:v1.14.0

docker tag docker.io/mirrorgooglecontainers/kube-scheduler:v1.14.0 k8s.gcr.io/kube-scheduler:v1.14.0

docker tag docker.io/mirrorgooglecontainers/kube-proxy:v1.14.0 k8s.gcr.io/kube-proxy:v1.14.0

docker tag docker.io/mirrorgooglecontainers/pause:3.1 k8s.gcr.io/pause:3.1

docker tag docker.io/mirrorgooglecontainers/etcd:3.3.10 k8s.gcr.io/etcd:3.3.10

docker tag docker.io/coredns/coredns:1.3.1 k8s.gcr.io/coredns:1.3.1

node01\node02也需要pause\kube-proxy\flannel映象在相應的宿主機

初始化主節點

kubeadm init --pod-network-cidr=10.244.0.0/16

export kubeconfig=/etc/kubernetes/admin.conf

安裝flannel網路外掛程式

使用國內映象站

檢視過版本之後就可以指定版本安裝

$ sudo apt-get install -y kubelet=1.14.0-00 kubeadm=1.14.0-00 kubectl=1.14.0-00

$ sudo apt-mark hold kubelet=1.14.0-00 kubeadm=1.14.0-00 kubectl=1.14.0-00

開機啟動kubelet

sudo systemctl enable kubelet && sudo systemctl start kubelet

解決元件映象無法拉取的問題

不能fq換個方法變通處理一下

docker pull mirrorgooglecontainers/kube-apiserver:v1.14.0

docker pull mirrorgooglecontainers/kube-controller-manager:v1.14.0

docker pull mirrorgooglecontainers/kube-scheduler:v1.14.0

docker pull mirrorgooglecontainers/kube-proxy:v1.14.0

docker pull mirrorgooglecontainers/pause:3.1

docker pull mirrorgooglecontainers/etcd:3.3.10

docker pull coredns/coredns:1.3.1

docker tag docker.io/mirrorgooglecontainers/kube-apiserver:v1.14.0 k8s.gcr.io/kube-apiserver:v1.14.0

docker tag docker.io/mirrorgooglecontainers/kube-controller-manager:v1.14.0 k8s.gcr.io/kube-controller-manager:v1.14.0

docker tag docker.io/mirrorgooglecontainers/kube-scheduler:v1.14.0 k8s.gcr.io/kube-scheduler:v1.14.0

docker tag docker.io/mirrorgooglecontainers/kube-proxy:v1.14.0 k8s.gcr.io/kube-proxy:v1.14.0

docker tag docker.io/mirrorgooglecontainers/pause:3.1 k8s.gcr.io/pause:3.1

docker tag docker.io/mirrorgooglecontainers/etcd:3.3.10 k8s.gcr.io/etcd:3.3.10

docker tag docker.io/coredns/coredns:1.3.1 k8s.gcr.io/coredns:1.3.1

node01\node02也需要pause\kube-proxy\flannel映象在相應的宿主機

初始化主節點

kubeadm init --pod-network-cidr=10.244.0.0/16

export kubeconfig=/etc/kubernetes/admin.conf

安裝flannel網路外掛程式

K8S kubeadm 集群證書續簽

自簽證書頒發機構 ca ca.crt ca.key etcd集群中相互通訊事業的客戶端證書 peer.crt peer.key pod中定義liveness探針事業的客戶端證書 healthcheck client.crt healrhcheck client.key etcd節點服務端證書 ser...

國內安裝K8S映象源

yum install y kubelet kubeadm kubectl啟動 systemctl enable kubelet systemctl start kubelet關閉防火牆 systemctl stop firewalld systemctl disable firewalld set...

k8s部署php映象

之前寫了 製作php nginx環境映象製作了乙個php映象。那麼如何使用這個映象呢?docker命令解釋 rm 防止docker產生tag為 none的的映象 d 使得產生的container在後台執行 name 指定該container 名稱為php 方便之後操作 p 指定埠 第乙個80為宿主機...