Update control-plane-namespace label (#4061)

* Update control-plane-namespace label

Upgrade command ignores changes to the namespace object

Add linkerd.io/control-plane-ns=linkerd label to the control-plane namespace

Fixes #3958

* Add controlPlaneNamespace label to namespace.yaml
* Modify tests for updated controlPlaneNamespace label
* Fix faulty values.yaml value
* Localize reference for controlPlaneNamespace label in kubernetes_helper.go

Signed-off-by: Supratik Das <rick.das08@gmail.com>
This commit is contained in:
Supratik Das 2020-02-25 02:27:28 +05:30 committed by GitHub
parent 2ad141d27a
commit d9956f3b35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 22 additions and 1 deletions

View File

@ -13,4 +13,5 @@ metadata:
labels:
{{.Values.global.linkerdNamespaceLabel}}: "true"
config.linkerd.io/admission-webhooks: disabled
{{.Values.global.controllerNamespaceLabel}}: {{.Values.global.namespace}}
{{ end -}}

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -14,6 +14,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
# Source: linkerd2/templates/identity-rbac.yaml
---

View File

@ -14,6 +14,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
# Source: linkerd2/templates/identity-rbac.yaml
---

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
LinkerdNamespaceLabel: "true"
config.linkerd.io/admission-webhooks: disabled
ControllerNamespaceLabel: Namespace
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -12,6 +12,7 @@ metadata:
labels:
linkerd.io/is-control-plane: "true"
config.linkerd.io/admission-webhooks: disabled
linkerd.io/control-plane-ns: linkerd
---
###
### Identity Controller Service RBAC

View File

@ -82,7 +82,7 @@ func (h *KubernetesHelper) createNamespaceIfNotExists(namespace string, annotati
// CreateControlPlaneNamespaceIfNotExists creates linkerd control plane namespace.
func (h *KubernetesHelper) CreateControlPlaneNamespaceIfNotExists(namespace string) error {
labels := map[string]string{"linkerd.io/is-control-plane": "true", "config.linkerd.io/admission-webhooks": "disabled"}
labels := map[string]string{"linkerd.io/is-control-plane": "true", "config.linkerd.io/admission-webhooks": "disabled", "linkerd.io/control-plane-ns": namespace}
annotations := map[string]string{"linkerd.io/inject": "disabled"}
return h.createNamespaceIfNotExists(namespace, annotations, labels)
}