Ho do you set the following label in an already applied deployment?
kubectl label deployments my-deployment-v1 app=my-deployment
Is setting:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: my-deployment-v1
labels:
app: my-deployment
And I need, the following for a service to find it:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: my-deployment-v1
spec:
template:
metadata:
labels:
app: my-deployment
You need to patch your resource like this:
kubectl patch deployments/my-deployment-v1 \
-p '{"spec":{"template":{"metadata":{"labels":{"app":"my-deployment"}}}}}'