Refresher: Kubernetes services
In the previous chapters, you have learned about Service objects, which can be used to expose Pods to load-balanced traffic, both internal as well as external. Internally, they are implemented as virtual IP addresses managed by kube-proxy at each of the Nodes. We are going to do a quick recap of different types of services:
ClusterIP
NodePort
LoadBalancer
To make it easier to explain, we will assume that we have a Deployment running three replicas of Pods running the nginx
container, which has the following YAML manifest:
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment-example spec: replicas: 3 selector: matchLabels: environment: test template: metadata: labels: environment: test ...