According to the udemy tutorial, I have question .
I just cannot understand this statement " This will automatically use the pod’s labels as selectors"
The command is creating a service type ClusterIP and its name is redis-service, how it know which labels to select?
Create a Service named redis-service of type ClusterIP to expose pod redis on port 6379
kubectl expose pod redis --port=6379 --name redis-service --dry-run=client -o yaml
(This will automatically use the pod’s labels as selectors)