Load Balancer with Kubernetes returns ERR_EMPTY_RESPONSE
I’m trying to use a Load Balancer in front of my Kubernetes cluster. The Load Balancer says that the droplet status is healthy, but whenever I try to load the IP or the domain that I pointed to that IP, it just hangs and then I get ERREMPTYRESPONSE in Chrome saying that the page didn’t send any data. Here’s the config for my service:
apiVersion: v1 kind: Service metadata: name: my-app-load-balancer spec: type: LoadBalancer selector: app: my-app ports: - protocol: TCP port: 80 targetPort: 3000 name: http
And here’s the config for my deployment:
apiVersion: apps/v1 kind: Deployment metadata: name: my-app-deployment spec: replicas: 1 selector: matchLabels: app: my-app template: metadata: labels: app: my-app spec: containers: - name: my-app image: gcr.io/my-app/my-app:v1 imagePullPolicy: Always ports: - containerPort: 3000 imagePullSecrets: - name: gcr-json-key
And when I run
kubectl get services, I get this:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE my-app-load-balancer LoadBalancer xxxx xxxx 80:30262/TCP 5h41m
And when I run
kubectl logs $POD_NAME, I get that no requests have been received, just the initial listening message when the app server starts up:
[2019-03-18 04:03:13.89389]  [info] Listening at "http://*:3000"
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.