0

I am having trouble exposing ports other than port 80 on my Google Cloud Kubernetes cluster. Below is the Kubernetes service yaml file, but for some reason only port 80 is exposed. I have SSHed into the pods and can confirm that they are internally serving on the other ports listed below, but they don't seem to be exposed.

Any insight into the problem or what I should check to debug it?

apiVersion: v1
kind: Service
metadata:
  name: my-frontend
  namespace: ocr-cluster
  labels:
    component: ocr
spec:
  type: LoadBalancer
  selector:
    component: ocr
  ports:
  # Working:
  - name: http
    port: 80
    protocol: TCP
  # Not working
  - name: rabbit
    port: 15672
    protocol: TCP
  - name: flower
    port: 5555
    protocol: TCP
speedplane
  • 111
  • 4
  • Try to look for information in GCE [activity logs](https://cloud.google.com/compute/docs/activity-logs) to see if the LB got created correctly. Other useful commands that might shed some light are kubernetes events (kubectl get events --namespace ocr-cluster) and the state of the service ( kubectl describe services my-frontend --namespace ocr-cluster, kubectl get services my-frontend --namespace ocr-cluster) – Carlos Feb 27 '17 at 23:28
  • Were you able to solve this issue? If so please post an answer, it will benefit the rest of the community. – Carlos Mar 27 '17 at 22:54

1 Answers1

1

I was able to solve this issue only by manually specifying the static IP of the LoadBalancer within the yaml file. This seems very wrong, and I'd bet that either I'm doing something else incorrectly, or there is some bug somewhere.

My yaml file looks something like this:

apiVersion: v1
kind: Service
metadata:
  name: ocr-frontend
  namespace: ocr-da-cluster
  labels:
    component: ocr
spec:
  type: LoadBalancer
  # Unfortunately, we need to specify the IP address here.
  loadBalancerIP: 104.154.151.248
  ...
speedplane
  • 111
  • 4