Windows/Mac 通过 Docker Desktop 安装

中国地区:https://github.com/AliyunContainerService/k8s-for-docker-desktop

kubectl shell 补全

云服务器安装

TCP 端口开启:https://kubernetes.io/zh/docs/setup/production-environment/tools/_print/#check-required-ports

images.properties

  1. k8s.gcr.io/pause:3.5=registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.5
  2. k8s.gcr.io/kube-controller-manager:v1.22.2=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.22.2
  3. k8s.gcr.io/kube-scheduler:v1.22.2=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler:v1.22.2
  4. k8s.gcr.io/kube-proxy:v1.22.2=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy:v1.22.2
  5. k8s.gcr.io/kube-apiserver:v1.22.2=registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.22.2
  6. k8s.gcr.io/etcd:3.5.0-0=registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.5.0-0
  7. k8s.gcr.io/coredns/coredns:v1.8.4=registry.cn-hangzhou.aliyuncs.com/google_containers/coredns:1.8.4
  8. quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.26.1=registry.cn-hangzhou.aliyuncs.com/google_containers/nginx-ingress-controller:0.26.1
  1. # iptables -t nat -A OUTPUT -d 10.0.8.4 -j DNAT --to-destination 119.29.24.201
  2. # kubeadm join 10.0.8.4:6443 --token 9ov4ee.gbldd96dafz00rf5 \
  3. --discovery-token-ca-cert-hash sha256:7084adc6e6ec3fce237f7097698d4e469459e25b2d0b051d8461dfb04c5fa324
  4. # 工作节点执行
  5. iptables -t nat -A OUTPUT -d 172.22.55.197 -j DNAT --to-destination 120.79.73.159
  1. Your Kubernetes control-plane has initialized successfully!
  2. To start using your cluster, you need to run the following as a regular user:
  3. mkdir -p $HOME/.kube
  4. sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  5. sudo chown $(id -u):$(id -g) $HOME/.kube/config
  6. Alternatively, if you are the root user, you can run:
  7. export KUBECONFIG=/etc/kubernetes/admin.conf
  8. You should now deploy a pod network to the cluster.
  9. Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  10. https://kubernetes.io/docs/concepts/cluster-administration/addons/
  11. Then you can join any number of worker nodes by running the following on each as root:
  12. kubeadm join 172.22.55.197:6443 --token 4zicbp.d19mf14cxdgcgz6y --discovery-token-ca-cert-hash sha256:1912dbf415da652f97b9fa728cb85dd338e17b24ee338ec48b073c8fa83b69bb

https://www.cnblogs.com/life-of-coding/p/11879067.html