stream {
upstream kube-apiserver {
server 192.168.10.64:6443 max_fails=3fail_timeout=30s;
server 192.168.10.65:6443 max_fails=3fail_timeout=30s;}
server {
listen 7443;
proxy_connect_timeout 2s;
proxy_timeout 900s;
proxy_pass kube-apiserver;}}
保存配置文件, 并测试配置文件
[root@fhd nginx]# ./sbin/nginx -t
nginx: the configuration file /usr/local/nginx//conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx//conf/nginx.conf test is successful