K8n NodePort not available to public

4/2/2017

If the Google Container Engine cluster has the service configured as LoadBalancer it's available to the general public as expected. But if I change that to NodePort it is not available as <nodeIp>:<nodePort>. The service (web-service.yml) looks like that:

apiVersion: v1
kind: Service
metadata:
 name: web
 labels:
   name: web
spec:
 type: NodePort
# type: LoadBalancer
 ports:
   - port: 80
     targetPort: 8080
     protocol: TCP
     nodePort: 30000
 selector:
   name: web

I would be very happy if someone could tell me why it isn't working.

Here is some background The cluster consists of a MongoDB deployment (db-deployment.yml) with an according service (db-service.yml) and a Jetty deployment (web-deployment.yml) with an according service (web-service.yml)

It can be found at GitHub as part of this project with the according Readme.md file.

-- Sandro
google-cloud-platform
kubernetes

1 Answer

4/3/2017

Did you open the port (30000) in the firewall? Also make sure you use the public IP of your VM.

See this answer

-- Oswin Noetzelmann
Source: StackOverflow