使用Kubernetes集群中的Helm图表访问已部署的服务

时间:2019-05-06 08:21:48

标签: kubernetes kubernetes-helm

当前,我正在尝试通过创建Helm图表在Kubernetes集群上部署微服务端点Docker映像。为此,我创建了图表并更改了values.yaml和deployment.yaml中的参数以进行端口更改。我也想从Angular前端访问。因此,我添加了服务类型= NodePort。当我描述服务时,它为我提供了访问端口30983

我访问时像http://node-ip:30983/endpoint

但是我只能得到无法访问该网站的消息。让我添加我在这里所做的详细信息:

我的values.yaml文件包含以下提到的服务类型:

enter image description here

我的template / service.yaml文件包含如下内容:

enter image description here

我的template / deployment.yaml文件包含以下内容:

enter image description here

我尝试按以下方式访问:

http://192.168.16.177:30983/

只能访问网站。

注意:当我试图描述服务时,我得到以下信息:

enter image description here

kubectl get pod --show-labels 的输出,如以下图像屏幕截图

enter image description here

已更新

当我们使用kubectl describe pod命令时,如下所示:

enter image description here

更新的错误

Readiness probe failed: HTTP probe failed with statuscode: 404
Liveness probe failed: HTTP probe failed with statuscode: 404

如何从部署中访问我的端点?

2 个答案:

答案 0 :(得分:2)

尝试此方法进行健康检查探针:

livenessProbe:
  tcpSocket:
    port: 8085
readinessProbe:
  tcpSocket:
    port: 8085

答案 1 :(得分:1)

尝试以下命令docker ps -a并找到与容器关联的容器。容器名称应与带有一些前缀/后缀的容器名称几乎相同。

然后使用docker logs <container_id>查看日志。也许这会为您提供重新启动的线索

相关问题