CentOS 7.3利用kubeadm安装Kubernetes 1.7.3完整版(4)

[root@centos7-base-ok]# docker images
REPOSITORY                                            TAG                IMAGE ID            CREATED            SIZE
kubernetesdashboarddev/kubernetes-dashboard-amd64    head                e2cadb73b2df        5 days ago          137MB
quay.io/calico/node                                  v2.4.1              7643422fdf0f        6 days ago          277MB
gcr.io/google_containers/kube-proxy-amd64            v1.7.3              54d2a8698e3c        11 days ago        115MB
quay.io/calico/cni                                    v1.10.0            88ca805c8ddd        13 days ago        70.3MB
gcr.io/google_containers/kubernetes-dashboard-amd64  v1.6.3              691a82db1ecd        2 weeks ago        139MB
nginx                                                latest              b8efb18f159b        2 weeks ago        107MB
hello-world                                          latest              1815c82652c0        2 months ago        1.84kB
gcr.io/google_containers/pause-amd64                  3.0                99e59f495ffa        15 months ago      747kB

5.利用kubeadm初始化服务(master节点)

注意:如果你在上一步执行过 kubeadm init 命令,没有关系,此步执行只需要执行时加上 --skip-preflight-checks 这个配置项即可。

注意:执行 kubeadm init 的 --pod-network-cidr 参数和选择的网络组件有关系,详细可以看官方文档说明,本文选用的网络组件为 Calico

[root@centos7-base-ok]# kubeadm init --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address=0.0.0.0 --apiserver-cert-extra-sans=192.168.80.28,192.168.80.14,192.168.80.35,127.0.0.1,k8s-1,k8s-2,k8s-3,192.168.0.1 --skip-preflight-checks

参数说明:

参数名称必选参数说明
pod-network-cidr   Yes   For certain networking solutions the Kubernetes master can also play a role in allocating network ranges (CIDRs) to each node. This includes many cloud providers and flannel. You can specify a subnet range that will be broken down and handed out to each node with the --pod-network-cidr flag. This should be a minimum of a /16 so controller-manager is able to assign /24 subnets to each node in the cluster. If you are using flannel with this manifest you should use --pod-network-cidr=10.244.0.0/16. Most CNI based networking solutions do not require this flag.  
apiserver-advertise-address   Yes   This is the address the API Server will advertise to other members of the cluster. This is also the address used to construct the suggested kubeadm join line at the end of the init process. If not set (or set to 0.0.0.0) then IP for the default interface will be used.  
apiserver-cert-extra-sans   Yes   Additional hostnames or IP addresses that should be added to the Subject Alternate Name section for the certificate that the API Server will use. If you expose the API Server through a load balancer and public DNS you could specify this with.  

其它的 kubeadm 参数设置请参照 官方文档

6.做一枚安静的美男子,等待安装成功,安装成功后你会看到日志如下(master节点):

注意:记录这段日志,后面添加node节点要用到。

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/46e830da7b6259d957dcf21c0f0035ef.html