Kubernetes

Assume you have a deployment running and you need to create a Service for exposing the pods. This is what is required/known:

Difficulty: unrated

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

Answer

kubectl expose deployment jabulik --name=jabulik-service --target-port=8080 --type=NodePort --port=8080 --dry-run=client -o yaml -> svc.yaml

vi svc.yaml (make sure selector is set to jabulik-app)

k apply -f svc.yaml