• 开发
  • 搭建后端遇到的telepresence使用问题

在使用 sudo telepresence –namespace kubesphere-system –swap-deployment ks-apiserver 之后,查看Pod状态为:

[root@k8s-master ~]# kubectl get pods -n kubesphere-system

NAME READY STATUS RESTARTS AGE

ks-apiserver-6b584f476d-j9xzm 2/2 Running 0 107s

ks-console-5c7c47f7b5-4gt6l 1/1 Running 0 43m

ks-controller-manager-b954548c8-2w4wc 1/1 Running 0 21m

ks-installer-85dcfff87d-nd22x 1/1 Running 0 44m

然后去看endpoint的接口,从原来的9090变成了9900

[root@k8s-master ~]# kubectl get svc -n kubesphere-system

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE

ks-apiserver ClusterIP 10.102.78.246 <none> 80/TCP 43m

ks-console NodePort 10.101.180.193 <none> 80:30880/TCP 43m

ks-controller-manager ClusterIP 10.104.215.251 <none> 443/TCP 43m

[root@k8s-master ~]# kubectl get ep -n kubesphere-system

NAME ENDPOINTS AGE

ks-apiserver 10.244.36.97:9900 43m #为什么会变成9900呢?

ks-console 10.244.235.197:8000 43m

ks-controller-manager 10.244.235.200:8443 43m

而且kubesphere的dashboard也出不来

使用

[root@k8s-master ~]# telepresence quit

Telepresence Network disconnecting…done

Telepresence Traffic Manager disconnecting…done

然后网页就出来了,但是这个网页里面显示的自带的ks-apiserver信息,并不是我本地通过

bin/cmd/ks-apiserver –kubeconfig ~/.kube/config

来启动的ks-apiserver

Kubernetes版本信息
[root@k8s-master ~]# kubectl version

Client Version: version.Info{Major:“1”, Minor:“20”, GitVersion:“v1.20.0”, GitCommit:“af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38”, GitTreeState:“clean”, BuildDate:“2020-12-08T17:59:43Z”, GoVersion:“go1.15.5”, Compiler:“gc”, Platform:“linux/amd64”}

Server Version: version.Info{Major:“1”, Minor:“20”, GitVersion:“v1.20.0”, GitCommit:“af46c47ce925f4c4ad5cc8d1fca46c7b77d13b38”, GitTreeState:“clean”, BuildDate:“2020-12-08T17:51:19Z”, GoVersion:“go1.15.5”, Compiler:“gc”, Platform:“linux/amd64”}

KubeSphere版本信息
版本信息为3.2.x,在已有k8s上安装。

telepresence –expose 把端口号改成9090

  • cxg 回复了此帖

    wanjunlei

    [root@k8s-master ~]# telepresence –namespace kubesphere-system –swap-deployment ks-apiserver –expose 9090:9090

    Legacy Telepresence command used

    Command roughly translates to the following in Telepresence:

    telepresence intercept ks-apiserver –port 9090:9090 –namespace kubesphere-system

    running…

    Failed to establish intercept: found no services with a selector matching labels map[app:ks-apiserver tier:backend] and a port referenced by name or port number 9090 in namespace kubesphere-system

    出现这样的结果