安装nginx.exe,编写配置文件nginx.conf:

error_log /var/log/nginx.log notice;
pid       /var/log/nginx.pid;
worker_rlimit_nofile 8192;
worker_processes auto;
events {
  multi_accept on;
  worker_connections 4096;
}

stream {
    upstream kube_apiserver {
        least_conn;
        server 192.168.100.156:6443;	
        server 192.168.100.157:6443;	
        server 192.168.100.158:6443;	
    }

    server {
        listen        127.0.0.1:6443 so_keepalive=on;
        access_log    off;
        proxy_pass    kube_apiserver;
        proxy_timeout 10m;
        proxy_connect_timeout 1s;
    }
}

执行nginx.exe -t -c nginx.conf

此外,修改c:\k\config

将其中的192.168.100.156:6443修改为127.0.0.1:6443,重启

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐