クベルネテツクラスタをクベルダキーで配置
2026 ワード
このリンクにはkubeadm v 1.10.3がインストールされています.flannelネットワークを使っています.
https://blog.csdn.net/nklinsirui/article/details/80602724
githubアドレス
https://github.com/cookcodeblog/k8s-deploy
kubeadm_init.sh
kubectlアプリ-fhttps://docs.projectcalico.org/v3.0/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml
https://blog.csdn.net/nklinsirui/article/details/80602724
githubアドレス
https://github.com/cookcodeblog/k8s-deploy
kubeadm_init.sh
#!/bin/bash
set -e
# Reset firstly if ran kubeadm init before
kubeadm reset
# kubeadm init with flannel network
export KUBE_REPO_PREFIX="registry.cn-shenzhen.aliyuncs.com/cookcodeblog"
export KUBE_ETCD_IMAGE="registry.cn-shenzhen.aliyuncs.com/cookcodeblog/etcd-amd64:3.1.12"
kubeadm init --kubernetes-version=v1.10.3 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.56.102
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
cp -p $HOME/.bash_profile $HOME/.bash_profile.bak$(date '+%Y%m%d%H%M%S')
echo "export KUBECONFIG=$HOME/.kube/config" >> $HOME/.bash_profile
source $HOME/.bash_profile
pulucaico_イメージ.sh#!/bin/bash
set -e
# pull calico images
ETCD_VERSION=v3.1.10
NODE_VERSION=v3.0.8
CNI_VERSION=v2.0.6
KUB-CONTROLLERS_VERSION=v2.0.5
GCR_URL=quay.io/calico
CALICO_URL=calico
images=(etcd:${ETCD_VERSION}
node:${NODE_VERSION}
cni:${CNI_VERSION}
kube-controllers:${KUB-CONTROLLERS_VERSION})
for imageName in ${images[@]} ; do
docker pull $CALICO_URL/$imageName
docker tag $CALICO_URL/$imageName $GCR_URL/$imageName
docker rmi $CALICO_URL/$imageName
done
install_caico.sh#!/bin/bash
set -e
wget https://docs.projectcalico.org/v3.0/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml
kubectl apply -f calico.yaml
# Wait a while to let network takes effect
sleep 10
kubectl get pods --all-namespaces
# Check component status
kubectl get cs
# Check pods status incase any pods are not in running status
kubectl get pods --all-namespaces
caicoをインストールしますkubectlアプリ-fhttps://docs.projectcalico.org/v3.0/getting-started/kubernetes/installation/hosted/kubeadm/1.7/calico.yaml