Some users on RHEL/CentOS 7 have reported issues with traffic being routed incorrectly due to iptables being bypassed. You should ensure net.bridge.bridge-nf-call-iptables is set to 1 in your sysctl config, e.g.
--kubernetes-version 正在使用的Kubernetes程序组件的版本号,需要与kubelet的版本号相同。
--pod-network-cidr pod网络的IP地址范围,为CIDR格式;使用flannel网络插件时,默认地址为10.244.0.0/16。
--service-cidr Default: "10.96.0.0/12" Use alternative range of IP address for service VIPs。
--apiserver-advertise-address The IP address the API Server will advertise it's listening on. If not set the default network interface will be used.
以下图中是init执行的各个步骤:
最后返回结果如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Your Kubernetes control-plane has initialized successfully!
To startusing your cluster, you need to run the following asa regular user:
You should now deploy a pod network tothe cluster. Run "kubectl apply -f [podnetwork].yaml"withoneofthe options listed at: https://kubernetes.io/docs/concepts/cluster-administration/addons/
Then you can join anynumberof worker nodes by running the following oneachasroot:
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at: https://kubernetes.io/docs/concepts/cluster-administration/addons/
Once a pod network has been installed, you can confirm that it is working by checking that the CoreDNS pod is Running in the output of kubectl get pods –all-namespaces. And once the CoreDNS pod is up and running, you can continue by joining your nodes.
If you want to reset the IPVS tables, you must run the following command:
1
ipvsadm -C
获取集群状态信息
1 2 3 4 5
[root@10-8-112-141 ~]# kubectl cluster-info Kubernetes master is running at https://10.8.112.141:6443 KubeDNS is running at https://10.8.112.141:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
kubectl get cs返回AGE unknown,原因未知;临时方案是用kubectl get cs -o yaml代替。
[root@10-8-112-141 ~]# curl 10.1.41.49:80 <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p>
<p>For online documentation and support please refer to <ahref="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <ahref="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p> </body> </html>