May 2018
Intermediate to advanced
554 pages
13h 51m
English
In the ordinary course of events, Pods can be stopped accidentally. Then, the IP of the Pod can be changed. When we expose the port for a Pod or a Deployment, we create a Kubernetes Service that acts as a proxy or a load balancer. Kubernetes would create a virtual IP, which receives the request from clients and proxies the traffic to the Pods in a service. Let's review how to do this:
$ cat nodeport-deployment.yamlapiVersion: apps/v1kind: Deploymentmetadata: name: nodeport-deployspec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: my-nginx image: nginx---apiVersion: v1kind: Service ...
Read now
Unlock full access