繁体   English   中英

错误:升级连接时出错:使用网真调试吊舱时需要升级请求

[英]error: error upgrading connection: Upgrade request required when using telepresence debug pod

当我启动 Telepresence(v0.104) 调试远程 kubernetes(v1.15.2) pod 时:

telepresence

执行此命令时:

kubectl --context default --namespace dabai-fat port-forward telepresence-1582172593-3845718-23919-6d665f6cbc-9wvq5 51694:8022

它显示此错误:

Recent output was:
  error: error upgrading connection: Upgrade request required

Here are the last few lines of the logfile (see /Users/dolphin/.kube/telepresence.log for the complete logs):

   6.7 TEL | END SPAN remote.py:142(get_remote_info)    2.6s
   6.7 TEL | BEGIN SPAN connect.py:37(connect)
   6.7 TEL | [18] Launching kubectl logs: kubectl --context default --namespace dabai-fat logs -f telepresence-1582172593-3845718-23919-6d665f6cbc-9wvq5 --container telepresence-1582172593-3845718-23919 --tail=10
   6.7 TEL | [19] Launching kubectl port-forward: kubectl --context default --namespace dabai-fat port-forward telepresence-1582172593-3845718-23919-6d665f6cbc-9wvq5 51694:8022
   6.7 TEL | [20] Running: ssh -F /dev/null -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -q -p 51694 telepresence@127.0.0.1 /bin/true
   6.7 TEL | [20] exit 255 in 0.01 secs.
   7.0 TEL | [21] Running: ssh -F /dev/null -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -q -p 51694 telepresence@127.0.0.1 /bin/true
   7.0 TEL | [21] exit 255 in 0.01 secs.
   7.3  19 | error: error upgrading connection: Upgrade request required
   7.3 TEL | [19] kubectl port-forward: exit 1
   7.3 TEL | [22] Running: ssh -F /dev/null -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -q -p 51694 telepresence@127.0.0.1 /bin/true
   7.3 TEL | [22] exit 255 in 0.01 secs.

我认为关键是端口转发失败。这是我的 nginx 配置:

server{
    listen 443 ssl;

    ssl_certificate /etc/nginx/conf.d/cert/example.com/fullchain1.pem;
    ssl_certificate_key /etc/nginx/conf.d/cert/example.com/privkey1.pem;

    access_log /nginx-access.log;
    error_log /nginx-error.log;

    server_name k8s-ctl.example.com;

    location / {
        client_max_body_size 50m;
        proxy_redirect off;
        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 https://172.19.104.231:8443;
        index index.html index.htm;
    }
}

问题出在哪里,我应该怎么做才能使它正确?

如果您使用域访问集群,请尝试更改使用IP:PORT访问远程集群,我更改为这种方式修复错误upgrading connection: Upgrade request required~/.kube/config如下所示:

clusters:
- cluster:
    insecure-skip-tls-verify: true
    server: https://42.11.108.214:8443
  name: default

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM