Accessing the deployed service using Helm chart in Kubernetes cluster

淺唱寂寞╮ 提交于 2019-12-10 02:14:06

问题


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.

And I accessed like 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:

My values.yaml file containing the following to mention the service type:

And my templates/service.yaml file containing like the following:

And my templates/deployment.yaml file containing the following:

And I tried to access like the following:

http://192.168.16.177:30983/

And only getting site can't be reached.

NB: when I tried to describe the service, then I am getting the following:

The output of kubectl get pod --show-labels like the following image screenshot

Updated

And when we using kubectl describe pod command, getting like the following:

Updated Error

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?


回答1:


Try this for healthcheck probes:

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



回答2:


try the following command docker ps -a and find the container associated with the pod. The container name should be pretty much same as the pod name with some prefix/suffix.

then look at the logs using docker logs <container_id>. Maybe that will give you clues to what it is restarting



来源:https://stackoverflow.com/questions/56001352/accessing-the-deployed-service-using-helm-chart-in-kubernetes-cluster

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!