1. 下载 octant
octant 版本跟 kubernetes 版本是一一对应的, 根据kubernetes版本选择合适的octant
https://github.com/vmware-tanzu/octant/releases
2. 安装 octant
dpkg -i octant.xx.deb
3. 配置 systemd
环境变量
OCTANT_LISTENER_ADDR
用来指定侦听端口号和主机地址
[Unit]
Description=octant
Documentation=octant
After=network-online.target
Wants=network-online.target
[Service]
Environment="OCTANT_LISTENER_ADDR=0.0.0.0:7777"
EnvironmentFile=-/etc/default/%p
ExecStart=octant
ExecStop=/bin/kill -HUP $MAINPID
KillSignal=SIGINT
[Install]
WantedBy=multi-user.target
4. 配置 nginx 反向代理
server {
listen 443 ssl http2;
server_name www.example.com;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/nginx/certs/lets-encrypt-jansora.com/jansora.com.cer;
ssl_certificate_key /etc/nginx/certs/lets-encrypt-jansora.com/jansora.com.key;
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_set_header Upgrade "websocket";
proxy_set_header Connection "keep-alive, Upgrade";
proxy_set_header Origin "";
proxy_request_buffering off;
proxy_buffering off;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://127.0.0.1:7777;
}
}