GKE (Google Cloud) Kubernetes Exposed Service Connection Refused

10/1/2018

I've exposed a service on GKE using the following load balancer config. I can port-forward (kubectl port-forward svc/app-external 3000:80) locally, and the service forwards to the deployed Rails application running on a container at port 3000. However, going to the IP address listed under LoadBalancer Ingress gives connection refused.

It's my understanding that load balancers should automatically be configured by Google cloud to receive connections, but maybe I'm missing something. Any help would be appreciated. Below is my load balancer config.

apiVersion: v1
kind: Service
metadata:
  labels:
    app: app
  name: app-external
spec:
  externalTrafficPolicy: Cluster
  ports:
  - port: 80
    protocol: TCP
    targetPort: http-server
  selector:
    app: app
  sessionAffinity: None
  loadBalancerIP: x.x.x.x
  type: LoadBalancer

Update

Ouput from kubectl get service

NAME           | TYPE       | CLUSTER-IP  | EXTERNAL-IP  | PORT(S)
---------------|------------|-------------|--------------|------------
app-external   |LoadBalancer|xx.xx.xxx.xxx|xx.xxx.xxx.xxx|80:32014/TCP
---------------|------------|-------------|--------------|------------
kubernetes     | ClusterIP  | xx.xx.xxx.x |    <none>    |   443/TCP

I'm using the external IP to access it.

-- Benjamin Newland
google-cloud-platform
google-kubernetes-engine
kubernetes

0 Answers