kuboard-v3界面安装

[TOC]

官网教程:https://kuboard.cn/install/v3/install-in-k8s.html#方法一-使用-hostpath-提供持久化

注意:我们部署在非k8s容器集群内,采用docker单独部署,在通过apiserver或kuboard-agent方式链接k8s集群

1 准备docker启动文件

cat > /data/kuboard/start-kuboard.sh << 'EOF'
sudo docker run -d \
  --restart=unless-stopped \
  --name=kuboard \
  -p 80:80/tcp \
  -p 10081:10081/tcp \
  -e KUBOARD_ENDPOINT="http://192.168.1.1:80" \
  -e KUBOARD_AGENT_SERVER_TCP_PORT="10081" \
  -e KUBOARD_ADMIN_DERAULT_PASSWORD="admin" \
  -v /data/kuboard/kuboard-data:/data \
  eipwork/kuboard:v3
 # 也可以使用镜像 swr.cn-east-2.myhuaweicloud.com/kuboard/kuboard:v3可以更快地完成镜像下载。
 # 请不要使用 127.0.0.1 或者 localhost 作为内网 IP \
 # Kuboard 不需要和 K8S 在同一个网段,Kuboard Agent 甚至可以通过代理访问 Kuboard Server \
EOF

2 配置反向代理

Kuboard 版本不低于 v3.0.0-beta.5

http {

  # 您需要的其他配置

  map $http_upgrade $connection_upgrade {
      default upgrade;
      '' close;
  }



cat > /data/nginx-1.22.1/conf.d/ test.kuboard.in.conf << 'EOF'
  server {
    listen       80; 
    server_name  test.kuboard.in; # 替换成你的域名

    location / {
      proxy_pass http://192.168.1.1:18080/;  # 替换成你的 Kuboard IP 地址和端口,应该是 IP 地址,而不是 KUBOARD_ENDPOINT 参数的值
      client_max_body_size 10m;
      gzip on;
    }

    location /k8s-ws/ {
      proxy_pass  http://192.168.1.1:18080/k8s-ws/;  # 替换成你的 Kuboard IP 地址和端口
      proxy_http_version 1.1;
      proxy_pass_header Authorization;
      proxy_set_header Upgrade "websocket";
      proxy_set_header Connection "upgrade";
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      # proxy_set_header X-Forwarded-Proto https; # 如果您在反向代理上启用了 HTTPS
    }

    location /k8s-proxy/ {
      proxy_pass  http://192.168.1.1:18080/k8s-proxy/;  # 替换成你的 Kuboard IP 地址和端口
      proxy_http_version 1.1;
      proxy_pass_header Authorization;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;

      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      # proxy_set_header X-Forwarded-Proto https; # 如果您在反向代理上启用了 HTTPS
      gzip on;
    }

    error_page 404 /404.html;
        location = /40x.html {
    }

    error_page 500 502 503 504 /50x.html;
        location = /50x.html {
    }
  }
}
EOF