为kubespray开启proxy模式

参考https://github.com/kubernetes-sigs/kubespray/blob/master/docs/ha-mode.md文档

下载https://github.com/kubernetes-sigs/kubespray/archive/v2.8.1.zip版本的代码,

修改./inventory/your_name/group_vars/all/all.yml 文件,去掉loadbalancer_apiserver_localhost和nginx_kube_apiserver_port的注释,并把nginx_kube_apiserver_port修改为6443,之后正常安装即可

## Internal loadbalancers for apiservers
loadbalancer_apiserver_localhost: true

## Local loadbalancer should use this port instead, if defined.
## Defaults to kube_apiserver_port (6443)
nginx_kube_apiserver_port: 6443

k8s启动后,会看到在node结点启动了nginx进程,并且/etc/nginx/nginx.conf中也配置了指向master结点apiserver的反向代理

 

 

你可能感兴趣的:(k8s)