Kubernetes: remove label - unknown shorthand flag: 'c' in -color

1/2/2019

I've created a label with:

kubectl label pods <pod id> color=green

but removing it using:

kubectl label pods bar -color

gives:

unknown shorthand flag: 'c' in -color

Any suggestions?

-- Snowcrash
kubernetes

1 Answer

1/2/2019

The dash goes at the end of the label name to remove it, per kubectl help label:

# Update pod 'foo' by removing a label named 'bar' if it exists.
# Does not require the --overwrite flag.
kubectl label pods foo bar-

So try kubectl label pods bar color-.

-- kevingessner
Source: StackOverflow