I’d like to use Kubernetes, as I’m reading everywhere : “Kubernetes is, without a doubt, the leading container orchestrator available today.“
My issue here is with the networking. I need to expose external IP to each of the pods. I need that my pods are seen as if they were traditional VM or HW servers. Meaning that I need all the ports to be exposed.
What I see so far, is I can expose only a limited list of ports.
Am I correct ? Or do I miss something ?
Cheers, Raoul
In Kubernetes, you will need service to communicate with pods. To expose the pods outside the kubernetes cluster, you will need k8s service of NodePort
type.
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
selector:
app: MyApp
type: NodePort
ports:
-
port: 30000
nodePort: 30000
name: my-port-30000
-
port: 30001
nodePort: 30001
name: my-port-30001
-
port: 30002
nodePort: 30002
name: my-port-30002
Then you will be able to reach your pods at, http://<node-ip>:nodePort
or http://<clusterIP>:port
.