k8s入坑之报错(8)kubeadm init 格式报错

$ kubeadm init 
  --apiserver-advertise-address=192.168.1.112               ( 当前节点的ip,即自己muster的ip)
  --image-repository registry.aliyuncs.com/google_containers ( k8s的镜像,用阿里的,因为官方的在国外,可能无法访问)
  --kubernetes-version v1.18.0                               ( 指定当前版本)
  --service-cidr=10.96.0.0/12                                ( 随便写,和当前的ip不冲突即可)
  --pod-network-cidr=10.244.0.0/16                           ( 这六行时一条命令,在一条命令中执行)

执行报错:

报错找不到了

修改名格式重新执行:

kubeadm init    --apiserver-advertise-address=192.168.1.112  --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.18.0    --service-cidr=10.96.0.0/12   --pod-network-cidr=10.244.0.0/16

正确输出:

[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy

Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 192.168.1.112:6443 --token pr5ftv.ihrv3t2p32n1s2p8 \
    --discovery-token-ca-cert-hash sha256:5ea87ae5440baa0412acca4fa7d0c650677b37519f57765eed13b9df88c3b2be    ## node节点执行
posted @ 2022-06-16 17:01  muzlei  阅读(320)  评论(0)    收藏  举报