cloudfoundry / cf-for-k8s

The open source deployment manifest for Cloud Foundry on Kubernetes
Apache License 2.0
301 stars 115 forks source link

Pushing the test-node-app results in FAILED with a connection refuse error for 127.0.0.1 port 8080 #711

Open martijnvandenboom opened 2 years ago

martijnvandenboom commented 2 years ago

After following tutorials on installing cf-for-k8s I get to the step to push my first app but it fails.

I get the following error: "error": "Connection refused - Connection refused - connect(2) for \"127.0.0.1\" port 8080 (127.0.0.1:8080)"

Can you help me to resolve the issue? I would like to know more about how I can troubleshoot this situation. Do you have any tips?

Tutorials:

  1. https://cf-for-k8s.io/docs/
  2. https://www.devopsschool.com/blog/getting-started-with-cloud-foundry-for-kubernetes-using-cf-for-k8s-in-linuxubuntu/

Details: The netstat command is not showing any connections on port 8080.

Command: $ cf push test-node-app -v -p ./tests/smoke/assets/test-node-app

Terminal output: See attachments Output push test-node-app.pdf

cf-gitbot commented 2 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/182390413

The labels on this github issue will be updated when the story is started.

thomas-worm-fernuni commented 1 year ago

I have the same problem when deploying in an Azure Kubernetes Services cluster.

It seems to be an issue with registry buddy. It receives a shutdown signal on api-server and api-worker, so it shuts down while the app gets pushed:

Server is listening at 127.0.0.1:8080...
2022/07/14 06:29:58 Server is attempting to shut down...
2022/07/14 06:29:58 Server stopped
thomas-worm-fernuni commented 1 year ago

The SIGTERM signal is caused by the health check:

When I remove the livenessProbe from cf-api-server and cf-api-worker the push succeeds:

        #livenessProbe:
        #  exec:
        #    command:
        #    - curl
        #    - --silent
        #    - --fail
        #    - --show-error
        #    - localhost:8080/healthz
        #  failureThreshold: 3
        #  initialDelaySeconds: 5
        #  periodSeconds: 10
        #  successThreshold: 1
        #  timeoutSeconds: 1

Why is the livenessProbe causing this? The registry-buddy listens hard-coded on 127.0.0.1. This seems to be a problem for the livenessProbe. registry-buddy should listen on 0.0.0.0.