Calico Install
镜像下载
docker pull docker.io/calico/cni:v3.24.5
docker pull docker.io/calico/node:v3.24.5
docker pull docker.io/calico/kube-controllers:v3.24.5
docker tag docker.io/calico/cni:v3.24.5 reg.jevic.cn/k8s/calico/cni:v3.24.5
docker tag docker.io/calico/node:v3.24.5 reg.jevic.cn/k8s/calico/node:v3.24.5
docker tag docker.io/calico/kube-controllers:v3.24.5 reg.jevic.cn/k8s/calico/kube-controllers:v3.24.5
docker push reg.jevic.cn/k8s/calico/cni:v3.24.5
docker push reg.jevic.cn/k8s/calico/node:v3.24.5
docker push reg.jevic.cn/k8s/calico/kube-controllers:v3.24.5
配置调整
# curl https://raw.githubusercontent.com/projectcalico/calico/v3.24.5/manifests/calico-etcd.yaml -o calico.yaml
# tree //对默认文件进行拆分
.
├── 01_cm.yml
├── 02_role.yml
├── 03_deploy.yml
└── calico.yaml
ENP="https://10.x:2379,https://10.x:2379,https://10.x:2379"
ETCD_KEY_BASE=`cat /etc/kubernetes/pki/etcd/server.key | base64 | tr -d '\n'`
ETCD_CERT_BASE=`cat /etc/kubernetes/pki/etcd/server.crt | base64 | tr -d '\n'`
ETCD_CA_BASE=`cat /etc/kubernetes/pki/etcd/ca.crt| base64 | tr -d '\n'`
sed -i "s#ENP#$ENP#g" 01_cm.yml
sed -i "s/ETCD_KEY_BASE/$ETCD_KEY_BASE/g" 01_cm.yml
sed -i "s/ETCD_CERT_BASE/$ETCD_CERT_BASE/g" 01_cm.yml
sed -i "s/ETCD_CA_BASE/$ETCD_CA_BASE/g" 01_cm.yml
cat >/etc/calico/calicoctl.cfg <<EOF
apiVersion: projectcalico.org/v3
kind: CalicoAPIConfig
metadata:
spec:
etcdEndpoints: "$ENP"
etcdKeyFile: /etc/kubernetes/pki/etcd/server.key
etcdCertFile: /etc/kubernetes/pki/etcd/server.crt
etcdCACertFile: /etc/kubernetes/pki/etcd/ca.crt
EOF
# kubectl apply -f .
nginx-demo
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx
name: nginx
namespace: default
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: nginx
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
app: nginx
spec:
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoSchedule"
containers:
- image: nginx:alpine
imagePullPolicy: IfNotPresent
name: nginx
污点去除
kubectl taint node master-103-113 node-role.kubernetes.io/control-plane-
kubectl taint node master-103-113 node-role.kubernetes.io/master-
添加:
kubectl taint node master-103-113 node-role.kubernetes.io/control-plane:NoSchedule
kubectl taint node master-103-113 node-role.kubernetes.io/master:NoSchedule
标签:node,AWS,calico,BASE,io,docker,K8s,Calico,v3.24
From: https://www.cnblogs.com/jevic/p/16977511.html