问题描述
当前,我正在尝试通过创建Helm图表在Kubernetes集群上部署微服务端点Docker映像.为此,我创建了图表并更改了values.yaml和deployment.yaml中的参数以进行端口更改.我也想从Angular前端访问.因此,我添加了服务类型= NodePort.当我描述该服务时,它为我提供了访问端口30983
.
Currently, I am trying to deploy my microservice end point Docker image on a Kubernetes cluster by creating the Helm chart. For this, I created the chart and changed the parameters in values.yaml and deployment.yaml for port change. And also I want to access from my Angular front end. So I added service type= NodePort. And when I described the service, it gave me the port 30983
to access.
我访问时就像 http://node-ip:30983/endpoint
但是我只是得到无法访问该网站的消息.让我添加我在这里所做的详细信息:
But I am only getting the site can't be reached the message. Let me add the details of what I did here:
我的values.yaml文件包含以下提到的服务类型:
My values.yaml file containing the following to mention the service type:
和我的template/service.yaml文件包含如下内容:
And my templates/service.yaml file containing like the following:
我的template/deployment.yaml文件包含以下内容:
And my templates/deployment.yaml file containing the following:
我尝试按以下方式访问:
And I tried to access like the following:
只能访问网站.
注意:当我试图描述服务时,我得到以下信息:
NB: when I tried to describe the service, then I am getting the following:
kubectl get pod --show-labels 的输出,如以下图像屏幕截图
The output of kubectl get pod --show-labels like the following image screenshot
已更新
当我们使用kubectl describe pod
命令时,将如下所示:
And when we using kubectl describe pod
command, getting like the following:
更新的错误
Readiness probe failed: HTTP probe failed with statuscode: 404
Liveness probe failed: HTTP probe failed with statuscode: 404
如何从部署中访问我的端点?
How can I access my endpoint from deployment?
推荐答案
尝试进行运行状况检查探针:
Try this for healthcheck probes:
livenessProbe:
tcpSocket:
port: 8085
readinessProbe:
tcpSocket:
port: 8085
这篇关于使用Kubernetes集群中的Helm图表访问已部署的服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!