Kubernetes

What the following command does?

kubectl expose rs some-replicaset --name=replicaset-svc --target-port=2017 --type=NodePort

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

It exposes a ReplicaSet by creating a service called 'replicaset-svc'. The exposed port is 2017 (this is the port used by the application) and the service type is NodePort which means it will be reachable externally.