【问题标题】:How do I use a running che 7如何使用跑步车 7
【发布时间】:2020-03-21 17:10:42
【问题描述】:

我在使用在 minikube 中运行的 che 应用程序时遇到问题。有谁知道解决这个问题的简单方法?

我想我已经运行了:

al@cougar:~$ kubectl -n che get pod
NAME                                READY   STATUS    RESTARTS   AGE
che-9644775cc-mgrn6                 1/1     Running   0          38m
devfile-registry-696845fc9f-ps62l   1/1     Running   0          38m
plugin-registry-7b94d46db7-4fhhd    1/1     Running   0          38m

我以为 chectl 会暴露它,但似乎不是这样:

al@cougar:~$ minikube service list
|--------------|----------------------|--------------|-----|
|  NAMESPACE   |         NAME         | TARGET PORT  | URL |
|--------------|----------------------|--------------|-----|
| cert-manager | cert-manager         | No node port |
| cert-manager | cert-manager-webhook | No node port |
| che          | che-host             | No node port |
| che          | devfile-registry     | No node port |
| che          | plugin-registry      | No node port |
| default      | kubernetes           | No node port |
| kube-system  | kube-dns             | No node port |
|--------------|----------------------|--------------|-----|

我想我可以看到 che-host 暴露的端口,我需要设置负载均衡器吗?:

al@cougar:~$ kubectl get services --namespace=che
NAME               TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)             AGE
che-host           ClusterIP   10.105.232.58   <none>        8080/TCP,8087/TCP   55m
devfile-registry   ClusterIP   10.101.12.68    <none>        8080/TCP            55m
plugin-registry    ClusterIP   10.99.88.115    <none>        8080/TCP            55m

它看起来是在容器上的 8080 上运行的:

al@cougar:~$ kubectl get svc che-host --namespace=che
NAME       TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)             AGE
che-host   ClusterIP   10.105.232.58   <none>        8080/TCP,8087/TCP   79m

我也看过“Kubectl edit”,8080 被称为 http,8087 被称为指标。

【问题讨论】:

    标签: kubernetes eclipse-che


    【解决方案1】:

    您可以使用如下命令通过服务公开名为 hello-node 的部署,以便从 kubernetes 集群外部访问。

    kubectl expose deployment hello-node --type=LoadBalancer --port=8080
    

    在 Minikube 上,LoadBalancer 类型使 Service 可以通过 minikube service 命令访问

    minikube service hello-node
    

    https://kubernetes.io/docs/tutorials/hello-minikube/

    【讨论】:

    • 太棒了!谢谢!我能够从那里弄清楚。
    猜你喜欢
    • 2015-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-08
    • 1970-01-01
    • 1970-01-01
    • 2021-09-24
    • 1970-01-01
    相关资源
    最近更新 更多