diff --git a/charts/clabernetes/templates/deployment.yaml b/charts/clabernetes/templates/deployment.yaml index 21af4114..6c0753f6 100644 --- a/charts/clabernetes/templates/deployment.yaml +++ b/charts/clabernetes/templates/deployment.yaml @@ -9,6 +9,7 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} revision: "{{ .Release.Revision }}" + app.kubernetes.io/name: "{{ .Values.appName }}-manager" clabernetes/app: {{ .Values.appName }} clabernetes/name: "{{ .Values.appName }}-manager" clabernetes/component: manager diff --git a/charts/clabernetes/tests/clicker/test-fixtures/golden/deployment.yaml b/charts/clabernetes/tests/clicker/test-fixtures/golden/deployment.yaml index 759f8d36..3396f820 100755 --- a/charts/clabernetes/tests/clicker/test-fixtures/golden/deployment.yaml +++ b/charts/clabernetes/tests/clicker/test-fixtures/golden/deployment.yaml @@ -10,6 +10,7 @@ metadata: release: release-name heritage: Helm revision: "1" + app.kubernetes.io/name: "clabernetes-plus-clicker-manager" clabernetes/app: clabernetes-plus-clicker clabernetes/name: "clabernetes-plus-clicker-manager" clabernetes/component: manager diff --git a/charts/clabernetes/tests/default_vaules/test-fixtures/golden/deployment.yaml b/charts/clabernetes/tests/default_vaules/test-fixtures/golden/deployment.yaml index a0b01c15..5d629a96 100755 --- a/charts/clabernetes/tests/default_vaules/test-fixtures/golden/deployment.yaml +++ b/charts/clabernetes/tests/default_vaules/test-fixtures/golden/deployment.yaml @@ -10,6 +10,7 @@ metadata: release: release-name heritage: Helm revision: "1" + app.kubernetes.io/name: "clabernetes-manager" clabernetes/app: clabernetes clabernetes/name: "clabernetes-manager" clabernetes/component: manager diff --git a/constants/labels.go b/constants/labels.go index 46e5d103..3562e4f9 100644 --- a/constants/labels.go +++ b/constants/labels.go @@ -1,6 +1,10 @@ package constants const ( + // LabelKubernetesName is the key for the standard kubernetes app.kubernetes.io/name label -- + // some tools use this label so we want to put it on all the deployments we spawn. + LabelKubernetesName = "app.kubernetes.io/name" + // LabelApp is the label key for the simple app name. LabelApp = "clabernetes/app" diff --git a/controllers/topology/deployment.go b/controllers/topology/deployment.go index 1bd9465a..33ddf6fb 100644 --- a/controllers/topology/deployment.go +++ b/controllers/topology/deployment.go @@ -109,10 +109,11 @@ func (r *DeploymentReconciler) renderDeploymentBase( deploymentName := fmt.Sprintf("%s-%s", owningTopologyName, nodeName) selectorLabels := map[string]string{ - clabernetesconstants.LabelApp: clabernetesconstants.Clabernetes, - clabernetesconstants.LabelName: deploymentName, - clabernetesconstants.LabelTopologyOwner: owningTopologyName, - clabernetesconstants.LabelTopologyNode: nodeName, + clabernetesconstants.LabelKubernetesName: deploymentName, + clabernetesconstants.LabelApp: clabernetesconstants.Clabernetes, + clabernetesconstants.LabelName: deploymentName, + clabernetesconstants.LabelTopologyOwner: owningTopologyName, + clabernetesconstants.LabelTopologyNode: nodeName, } labels := map[string]string{} diff --git a/controllers/topology/test-fixtures/golden/deployment/render-deployment/containerlab-debug.json b/controllers/topology/test-fixtures/golden/deployment/render-deployment/containerlab-debug.json index 710c6835..383fed88 100755 --- a/controllers/topology/test-fixtures/golden/deployment/render-deployment/containerlab-debug.json +++ b/controllers/topology/test-fixtures/golden/deployment/render-deployment/containerlab-debug.json @@ -4,6 +4,7 @@ "namespace": "clabernetes", "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -17,6 +18,7 @@ "replicas": 1, "selector": { "matchLabels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -27,6 +29,7 @@ "metadata": { "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", diff --git a/controllers/topology/test-fixtures/golden/deployment/render-deployment/docker-daemon.json b/controllers/topology/test-fixtures/golden/deployment/render-deployment/docker-daemon.json index 4d9a68b1..95cb6734 100755 --- a/controllers/topology/test-fixtures/golden/deployment/render-deployment/docker-daemon.json +++ b/controllers/topology/test-fixtures/golden/deployment/render-deployment/docker-daemon.json @@ -4,6 +4,7 @@ "namespace": "clabernetes", "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -17,6 +18,7 @@ "replicas": 1, "selector": { "matchLabels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -27,6 +29,7 @@ "metadata": { "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", diff --git a/controllers/topology/test-fixtures/golden/deployment/render-deployment/insecure-registries.json b/controllers/topology/test-fixtures/golden/deployment/render-deployment/insecure-registries.json index 50bdf2b1..c594fc3b 100755 --- a/controllers/topology/test-fixtures/golden/deployment/render-deployment/insecure-registries.json +++ b/controllers/topology/test-fixtures/golden/deployment/render-deployment/insecure-registries.json @@ -4,6 +4,7 @@ "namespace": "clabernetes", "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -17,6 +18,7 @@ "replicas": 1, "selector": { "matchLabels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -27,6 +29,7 @@ "metadata": { "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", diff --git a/controllers/topology/test-fixtures/golden/deployment/render-deployment/launcher-log-level.json b/controllers/topology/test-fixtures/golden/deployment/render-deployment/launcher-log-level.json index 72cece89..7ea6529f 100755 --- a/controllers/topology/test-fixtures/golden/deployment/render-deployment/launcher-log-level.json +++ b/controllers/topology/test-fixtures/golden/deployment/render-deployment/launcher-log-level.json @@ -4,6 +4,7 @@ "namespace": "clabernetes", "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -17,6 +18,7 @@ "replicas": 1, "selector": { "matchLabels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -27,6 +29,7 @@ "metadata": { "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", diff --git a/controllers/topology/test-fixtures/golden/deployment/render-deployment/privileged-launcher.json b/controllers/topology/test-fixtures/golden/deployment/render-deployment/privileged-launcher.json index 38a21d0f..46cf4a79 100755 --- a/controllers/topology/test-fixtures/golden/deployment/render-deployment/privileged-launcher.json +++ b/controllers/topology/test-fixtures/golden/deployment/render-deployment/privileged-launcher.json @@ -4,6 +4,7 @@ "namespace": "clabernetes", "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -14,6 +15,7 @@ "replicas": 1, "selector": { "matchLabels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -24,6 +26,7 @@ "metadata": { "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", diff --git a/controllers/topology/test-fixtures/golden/deployment/render-deployment/simple.json b/controllers/topology/test-fixtures/golden/deployment/render-deployment/simple.json index 59970695..ba78a44b 100755 --- a/controllers/topology/test-fixtures/golden/deployment/render-deployment/simple.json +++ b/controllers/topology/test-fixtures/golden/deployment/render-deployment/simple.json @@ -4,6 +4,7 @@ "namespace": "clabernetes", "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -17,6 +18,7 @@ "replicas": 1, "selector": { "matchLabels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1", @@ -27,6 +29,7 @@ "metadata": { "creationTimestamp": null, "labels": { + "app.kubernetes.io/name": "render-deployment-test-srl1", "clabernetes/app": "clabernetes", "clabernetes/name": "render-deployment-test-srl1", "clabernetes/topologyNode": "srl1",