octant 安装教程预计阅读时间 3 分钟

    Octant是开发人员了解应用程序如何在Kubernetes集群上运行的工具。它旨在成为开发人员工具包的一部分,以获取Kubernetes中发现的洞察力和复杂性。Octant提供了内省工具、集群导航和对象管理以及插件系统的组合,以进一步扩展其功能。

    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;
        }
    }
    

    5. 访问

    https://www.example.com

    评论栏