更新时间:2024-04-26 GMT+08:00
分享

配置treafik和代理(必须)

  • 创建treafik dashboard
    cat > traefik-ingroute.yaml <<EOF
    apiVersion: traefik.containo.us/v1alpha1
    kind: IngressRoute
    metadata:
    name: traefik-dashboard
    namespace: kube-system
    spec:
    entryPoints:
    - web
    routes:
    - kind: Rule
    match: Host(\`traefik.test.wezhuiyi.com\`)
    services:
    - kind: TraefikService
    name: api@internal
    EOF
    # apply 文件
    kubectl apply -f  traefik-ingroute.yaml
  • 配置代理

    示例为nginx,其它负载均衡参照修改。

    1. 创建http配置文件,server、upstream、server_name、proxy_pass根据实际情况填写
      cat > face-http.conf <<EOF
      upstream xingye-数字人{
      server 172.16.30.60:32763;
      }
      server {
      listen       80;
      server_name  *.test.wezhuiyi.com;
      #access_log  /var/log/nginx/host.access.log  main;
      location / {
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      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_pass http://xingye-数字人;
      }
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
      root   /usr/share/nginx/html;
      }
      }
      EOF
    2. 创建https配置文件,server、upstream、server_name、proxy_pass根据实际情况填写
      cat > face-https.conf <<EOF
      upstream xingye-数字人-ssl {
      server 172.16.30.60:32763;
      }
      server {
      listen       443 ssl http2;
      server_name  *.test.wezhuiyi.com;
      #access_log  /var/log/nginx/host.access.log  main;
      ssl_certificate /etc/nginx/cert/aiforce.ai_bundle.crt;
      ssl_certificate_key /etc/nginx/cert/aiforce.ai.key;
      location / {
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      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_pass http://xingye-数字人-ssl;
      }
      error_page   500 502 503 504  /50x.html;
      location = /50x.html {
      root   /usr/share/nginx/html;
      }
      }
      EOF

相关文档