Welcome to the Linux Foundation Forum!

Can you explain : "Labels are immutable as of API version apps/v1."

Options

Hello,
I don't understand this sentence : "Labels are immutable as of API version apps/v1." For me "immutable" is something that you cannot change. But you can change labels of every objects.

So I try to modify labels of a deployment : it's allowed. Also modifications of Pod labels are allowed.

The only part that cannot be modified is maybe the spec.template.metadata.labels and spec.selector.matchLabels fields.

Best regards,
Julien

Comments

  • chrispokorni
    Options

    Hi @Vampouille,

    It is the label selector that is immutable, to prevent an accidental mass orphaning of all the pods managed by the operator.

    Regards,
    -Chris

  • Vampouille
    Options

    @chrispokorni Thanks for the reply. What do you think about changing this sentence to : "Selector field is immutable in Deployment, DaemonSet and StatefulSet" ?

  • chrispokorni
    Options

    Hi @Vampouille,

    Sounds good.
    What about the ReplicaSet, ReplicationController, or Job selectors?

    Regards,
    -Chris

  • Vampouille
    Options

    Hello @chrispokorni,

    From my point of view, things regarding ReplicationController can be removed. It's really historical now.

Categories

Upcoming Training