12

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:

enter image description here

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

enter image description here

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

enter image description here

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:

enter image description here

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

enter image description here

Updated

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

enter image description here

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?

halfer
  • 19,824
  • 17
  • 99
  • 186
Mr.DevEng
  • 2,651
  • 14
  • 57
  • 115
  • 2
    please provide output of "kubectl get pod --show-labels" and "kubectl get svc" – Vasili Angapov May 06 '19 at 08:25
  • @VasilyAngapov - Yes sir, updated in question. And thank you for your response. – Mr.DevEng May 06 '19 at 08:34
  • 2
    your pod is Crashlooping. Your app is crashing for some reason. You need to read logs "kubectl logs -p POD_NAME" where POD_NAME is the name of your failing pod. – Vasili Angapov May 06 '19 at 08:37
  • @VasilyAngapov - I updated my result sir. Can you please look on updated question ? – Mr.DevEng May 06 '19 at 15:30
  • 1
    you didn't provide the logs of crashlooping pods. Without logs nobody can help you. Read my previous comment again pls. – Vasili Angapov May 06 '19 at 16:16
  • @VasilyAngapov - there is no crashlooping. Everything is running. I updated the last screenshot with the result. Did you checked that ? – Mr.DevEng May 07 '19 at 08:16
  • please make sure your pod in Running 1/1 state. On your screenshot it is not ready. – Vasili Angapov May 07 '19 at 08:25
  • @VasilyAngapov - Yes sir. When I run today , it showing now the crashloop. I updated the latest result with log also what I am getting. And thank you for your response sir. – Mr.DevEng May 07 '19 at 08:43
  • as you see from the logs, your app is shut down right after starting. see https://stackoverflow.com/questions/22380119/why-does-my-spring-boot-app-always-shutdown-immediately-after-starting for more hints – Markus Dresch May 08 '19 at 10:14
  • @MarkusDresch - Thank sir for your response. I checked the link that you shared. I already have pom.xml in my root folder for "spring-boot-starter-web". – Mr.DevEng May 08 '19 at 10:22
  • Hi Jacob. Please [read this article](http://idownvotedbecau.se/imageofcode) when you get a moment - all of those images ought to be text/code blocks, for reasons given in the article. – halfer May 11 '19 at 20:15

2 Answers2

4

Try this for healthcheck probes:

livenessProbe:
  tcpSocket:
    port: 8085
readinessProbe:
  tcpSocket:
    port: 8085
Vasili Angapov
  • 8,061
  • 15
  • 31
1

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

probhonjon
  • 302
  • 5
  • 8