k8s 1.28高可用搭建Calico集群11

Just Do It
2023-11-22 / 0 评论 / 22 阅读 / 正在检测是否收录...

1 网络组件部署 Calico

1.1 下载


https://docs.tigera.io/calico/latest/getting-started/kubernetes/self-managed-onprem/onpremises

kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.4/manifests/tigera-operator.yaml

curl https://raw.githubusercontent.com/projectcalico/calico/v3.26.4/manifests/custom-resources.yaml -O

1.2 修改文件

# This section includes base Calico installation configuration.
# For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.Installation
apiVersion: operator.tigera.io/v1
kind: Installation
metadata:
  name: default
spec:
  # Configures Calico networking.
  calicoNetwork:
    # Note: The ipPools section cannot be modified post-install.
    ipPools:
    - blockSize: 26
      cidr: 10.244.0.0/16
      encapsulation: VXLANCrossSubnet
      natOutgoing: Enabled
      nodeSelector: all()

---

# This section configures the Calico API server.
# For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.APIServer
apiVersion: operator.tigera.io/v1
kind: APIServer
metadata:
  name: default
spec: {}

1.3 应用文件

mkdir -p  /var/lib/kubelet/plugins_registry
kubectl apply -f custom-resources.yaml

1.4 验证应用结果

[root@k8s-master01 k8s-work]# kubectl get pods -A -w
NAMESPACE          NAME                                       READY   STATUS    RESTARTS   AGE
calico-apiserver   calico-apiserver-86cf84fd44-lgq4f          1/1     Running   0          2m58s
calico-apiserver   calico-apiserver-86cf84fd44-r9z9x          1/1     Running   0          2m57s
calico-system      calico-kube-controllers-5464c5f856-9wc27   1/1     Running   0          25m
calico-system      calico-node-2rc2k                          1/1     Running   0          25m
calico-system      calico-node-jn49m                          1/1     Running   0          25m
calico-system      calico-node-qh9cn                          1/1     Running   0          25m
calico-system      calico-node-x8ws2                          1/1     Running   0          25m
calico-system      calico-node-zdnfb                          1/1     Running   0          25m
calico-system      calico-typha-56f47497f9-pf9qg              1/1     Running   0          25m
calico-system      calico-typha-56f47497f9-wsbz9              1/1     Running   0          25m
calico-system      calico-typha-56f47497f9-x48r5              1/1     Running   0          25m
calico-system      csi-node-driver-7dz9r                      2/2     Running   0          25m
calico-system      csi-node-driver-g9wl9                      2/2     Running   0          25m
calico-system      csi-node-driver-hr7d8                      2/2     Running   0          25m
calico-system      csi-node-driver-lrqb9                      2/2     Running   0          25m
calico-system      csi-node-driver-z76d9                      2/2     Running   0          25m
tigera-operator    tigera-operator-7f8cd97876-gn9fb           1/1     Running   0          52m
[root@k8s-master01 k8s-work]# kubectl get nodes
NAME           STATUS   ROLES    AGE   VERSION
k8s-master01   Ready    <none>   25h   v1.28.4
k8s-master02   Ready    <none>   25h   v1.28.4
k8s-master03   Ready    <none>   24h   v1.28.4
k8s-node01     Ready    <none>   24h   v1.28.4
k8s-node02     Ready    <none>   24h   v1.28.4
0

评论

博主关闭了当前页面的评论