安装 Kubernetes 集群02

编程入门 行业动态 更新时间:2024-10-25 08:20:54

安装 Kubernetes <a href=https://www.elefans.com/category/jswz/34/1771240.html style=集群02"/>

安装 Kubernetes 集群02

1、初始化Master

# kubeadm init --image-repository registry.aliyuncs/google_containers --kubernetes-version v1.18.2 --apiserver-advertise-address 192.168.1.246 --pod-network-cidr=10.244.0.0/16

--image-repository string:这个用于指定从什么位置来拉取镜像(1.13版本才有的),默认值是k8s.gcr.io,我们将其指定为国内镜像地址:registry.aliyuncs/google_containers

--kubernetes-version string:指定kubenets版本号,默认值是stable-1,会导致从.txt下载最新的版本号,我们可以将其指定为固定版本1.18.2来跳过网络请求。

 --apiserver-advertise-address 指明用 Master 的哪个 interface 与 Cluster 的其他节点通信(Master的IP地址)。如果 Master 有多个 interface,建议明确指定,如果不指定,kubeadm 会自动选择有默认网关的 interface。

 --pod-network-cidr指定 Pod 网络的范围。Kubernetes 支持多种网络方案,而且不同网络方案对  --pod-network-cidr有自己的要求,这里设置为10.244.0.0/16 是因为我们将使用 flannel 网络方案,必须设置成这个 CIDR。

初始化成功的标志:

Your Kubernetes master 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:   /  You can now join any number of machines by running the following on each node as root:    kubeadm join 172.20.10.2:6443 --token rn816q.zj0crlasganmrzsr --discovery-token-ca-cert-hash sha256:e339e4d

更多推荐

安装 Kubernetes 集群02

本文发布于:2024-03-08 10:32:15,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1720624.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:集群   Kubernetes

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!