May 2018
Intermediate to advanced
554 pages
13h 51m
English
A LoadBalancer service type only works in the cloud environment that supports external load balancers. This allows outside traffic to be routed into target Pods. In GCP, a TCP load balancer will be created by a LoadBalancer service type:
// leveraging LoadBalancer service# cat gke-service.yamlapiVersion: apps/v1kind: Deploymentmetadata: name: nginxspec: replicas: 1 selector: matchLabels: run: nginx template: metadata: labels: run: nginx spec: containers: - image: nginx name: nginx ports: - containerPort: 80---apiVersion: v1kind: Servicemetadata: name: nginxspec: ports: - port: 80 targetPort: 80 type: LoadBalancer ...
Read now
Unlock full access