Making a service port externally visible

11/1/2016

I want to deploy a simple containerized app on GCE. I've created a deployment file and a service file. The latter includes type: NodePort and "ports": [{"port": 443, "targetPort": "myapp-port", "protocol": "TCP"}] declarations.

After running kubectl create -f deployment.json and kubectl create -f service.json, the deployment (including pods and replica sets) and service are created. However, the service is not visibly externally. How do I make it so? Preferably I would want to make this change in the service.json file, so it's under revision control.

-- Jon Smark
google-kubernetes-engine
kubernetes

1 Answer

11/3/2016

Probably because you missed

spec:
  type: LoadBalancer

http://kubernetes.io/docs/user-guide/load-balancer/

-- Michele Orsi
Source: StackOverflow