参考了哔哩哔哩上的视频
【完整版】手把手教你搭建 KubeSphere 前后端本地开发环境_哔哩哔哩 (゜-゜)つロ 干杯~-bilibili
现在我执行过telepresence --namespace kubesphere-system --swap-deployment ks-apiserver --also-proxy redis.kubesphere-system.svc --also-proxy openldap.kubesphere-system.svc
之后,日志看起来很正常,再执行本地编译的apiserver也没出现错误日志,但是页面无法访问了。。。
➜ [/mnt/kubesphere] git:(release-3.0) ✗ telepresence --namespace kubesphere-system --swap-deployment ks-apiserver --also-proxy redis.kubesphere-system.svc --also-proxy openldap.kubesphere-system.svc
T: Using a Pod instead of a Deployment for the Telepresence proxy. If you experience problems, please file an issue!
T: Set the environment variable TELEPRESENCE_USE_DEPLOYMENT to any non-empty value to force the old behavior, e.g.,
T: env TELEPRESENCE_USE_DEPLOYMENT=1 telepresence --run curl hello
T: Starting proxy with method 'vpn-tcp', which has the following limitations: All processes are affected, only one telepresence can run per machine, and you can't use other VPNs. You may
T: need to add cloud hosts and headless services with --also-proxy. For a full list of method limitations see https://telepresence.io/reference/methods.html
T: Volumes are rooted at $TELEPRESENCE_ROOT. See https://telepresence.io/howto/volumes.html for details.
T: Starting network proxy to cluster by swapping out Deployment ks-apiserver with a proxy Pod
T: Forwarding remote port 9090 to local port 9090.
T: Setup complete. Launching your command.
@kubernetes-admin@kubernetes|[root@paas-119 /mnt/kubesphere] -> ./ks-apiserver --kubeconfig ~/.kube/config
I0514 17:07:54.699317 3018840 apiserver.go:300] Start cache objects
I0514 17:07:56.073986 3018840 apiserver.go:502] Finished caching objects
I0514 17:07:56.074253 3018840 apiserver.go:232] Start listening on :9090

? [/mnt/kubesphere] git:(release-3.0) ? kubectl get pods -n kubesphere-system -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
etcd-7bd7ff8649-m4gxh 1/1 Running 1 56d 179.10.16.17 kubesphere-host-worker-2 <none> <none>
ks-apiserver-30d276dafb694d7db99c5a93a67dc6b3 1/1 Running 0 10m 179.10.62.199 kubesphere-host-worker-1 <none> <none>
ks-console-7bc9fdc6fd-fjljh 1/1 Running 224 56d 179.10.154.46 kubesphere-host-master-1 <none> <none>
ks-controller-manager-996847c5b-4tczk 1/1 Running 4 56d 179.10.154.54 kubesphere-host-master-1 <none> <none>
ks-installer-846587cf9d-zslhz 0/1 ImagePullBackOff 0 56d 179.10.62.225 kubesphere-host-worker-1 <none> <none>
minio-5c8bb89446-c5kfz 1/1 Running 1 56d 179.10.62.231 kubesphere-host-worker-1 <none> <none>
mysql-7fcf986996-shw6n 1/1 Running 1 56d 179.10.16.10 kubesphere-host-worker-2 <none> <none>
openldap-0 1/1 Running 1 56d 179.10.154.9 kubesphere-host-master-1 <none> <none>
redis-77f449cbbc-6q87d 1/1 Running 1 56d 179.10.154.5 kubesphere-host-master-1 <none> <none>
pod似乎都正常的,就页面出不来,参考视频中请求后端api也可以返回
➜ [/mnt] curl -v http://localhost:9090/kapis/resources.kubesphere.io/v1alpha3/deployments | jq '.items[].metadata.name'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* About to connect() to localhost port 9090 (#0)
* Trying ::1...
* Connected to localhost (::1) port 9090 (#0)
> GET /kapis/resources.kubesphere.io/v1alpha3/deployments HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:9090
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Fri, 14 May 2021 09:19:39 GMT
< Transfer-Encoding: chunked
<
{ [data not shown]
100 598k 0 598k 0 0 5528k 0 --:--:-- --:--:-- --:--:-- 5589k
* Connection #0 to host localhost left intact
"KUBESPHERE-ROUTER-SOFA-STACK"
"SPRING-BOOT-ISTIO-CLIENT-V1"
"SPRING-BOOT-ISTIO-SERVER-V1"
"SPRING-BOOT-ISTIO-ZOOKEEPER-V1"
"HOPPSCOTCH-V1"
"HTTPBIN-V1"
...
30880端口也是监听着的
➜ [/mnt] netstat -anp | grep 30880
tcp 0 0 0.0.0.0:30880 0.0.0.0:* LISTEN 16514/kube-proxy
但是页面始终进不去,只有退出telepresence之后,pod恢复成之前的pod,页面才能加载出来。迷惑了,有大佬给点意见吗