Browse Source

Add release uuid to pods and rc objects (prom)

This PS adds the ability to attach a release uuid to pods and rc
objects as desired.  This can be used, for example, to force an
artificial manifest change in CICD scenarios, for upgradability
testing purposes.

Change-Id: I8d0ffac306258f940c63799e86e7e26b5c2c5add
Matt McEuen 7 months ago
parent
commit
eae60aba15

+ 2
- 0
charts/apiserver/templates/daemonset.yaml View File

@@ -23,6 +23,8 @@ apiVersion: "extensions/v1beta1"
23 23
 kind: DaemonSet
24 24
 metadata:
25 25
   name: {{ .Values.service.name }}-anchor
26
+  annotations:
27
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
26 28
 spec:
27 29
 {{ tuple $envAll "kubernetes-apiserver-anchor" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
28 30
   template:

+ 2
- 0
charts/apiserver/templates/etc/_kubernetes-apiserver.yaml.tpl View File

@@ -22,6 +22,8 @@ metadata:
22 22
   labels:
23 23
     {{ .Values.service.name }}-service: enabled
24 24
 {{ tuple $envAll "kubernetes" "apiserver" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
25
+  annotations:
26
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
25 27
 spec:
26 28
   hostNetwork: true
27 29
   containers:

+ 2
- 0
charts/controller_manager/templates/daemonset.yaml View File

@@ -23,6 +23,8 @@ apiVersion: "extensions/v1beta1"
23 23
 kind: DaemonSet
24 24
 metadata:
25 25
   name: {{ .Values.service.name }}-anchor
26
+  annotations:
27
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
26 28
 spec:
27 29
 {{ tuple $envAll "kubernetes-controller-manager-anchor" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
28 30
   template:

+ 2
- 0
charts/controller_manager/templates/etc/_kubernetes-controller-manager.yaml.tpl View File

@@ -22,6 +22,8 @@ metadata:
22 22
   labels:
23 23
     {{ .Values.service.name }}-service: enabled
24 24
 {{ tuple $envAll "kubernetes" "controller-manager" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
25
+  annotations:
26
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
25 27
 spec:
26 28
   hostNetwork: true
27 29
   containers:

+ 2
- 0
charts/coredns/templates/deployment.yaml View File

@@ -23,6 +23,8 @@ metadata:
23 23
   labels:
24 24
     {{ .Values.service.name }}: enabled
25 25
     kubernetes.io/name: "CoreDNS"
26
+  annotations:
27
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
26 28
 spec:
27 29
   replicas: {{ .Values.pod.replicas.coredns }}
28 30
   strategy:

+ 1
- 0
charts/coredns/templates/pod-test.yaml View File

@@ -23,6 +23,7 @@ metadata:
23 23
   name: {{ print .Release.Name "-test" }}
24 24
   annotations:
25 25
     "helm.sh/hook": test-success
26
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
26 27
   labels:
27 28
 {{ tuple $envAll "coredns" "test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
28 29
 spec:

+ 2
- 0
charts/etcd/templates/daemonset-anchor.yaml View File

@@ -26,6 +26,8 @@ apiVersion: extensions/v1beta1
26 26
 kind: DaemonSet
27 27
 metadata:
28 28
   name: {{ .Values.service.name }}-anchor
29
+  annotations:
30
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
29 31
 spec:
30 32
 {{ tuple $envAll "anchor" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
31 33
   template:

+ 2
- 0
charts/etcd/templates/etc/_kubernetes-etcd.yaml.tpl View File

@@ -28,6 +28,8 @@ metadata:
28 28
   labels:
29 29
     {{ .Values.service.name }}-service: enabled
30 30
 {{ tuple $envAll $applicationName "etcd" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
31
+  annotations:
32
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
31 33
 spec:
32 34
   hostNetwork: true
33 35
   containers:

+ 1
- 0
charts/etcd/templates/tests/test-etcd-health.yaml View File

@@ -26,6 +26,7 @@ metadata:
26 26
   annotations:
27 27
     "helm.sh/hook": "test-success"
28 28
     scheduler.alpha.kubernetes.io/critical-pod: ''
29
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
29 30
   labels:
30 31
 {{ tuple $envAll $applicationName "etcd-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
31 32
 spec:

+ 2
- 0
charts/haproxy/templates/daemonset.yaml View File

@@ -20,6 +20,8 @@ apiVersion: extensions/v1beta1
20 20
 kind: DaemonSet
21 21
 metadata:
22 22
   name: haproxy-anchor
23
+  annotations:
24
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
23 25
 spec:
24 26
 {{ tuple $envAll "haproxy_anchor" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
25 27
   template:

+ 2
- 0
charts/haproxy/templates/etc/_haproxy.yaml.tpl View File

@@ -23,6 +23,8 @@ metadata:
23 23
   namespace: {{ .Release.Namespace }}
24 24
   labels:
25 25
 {{ tuple $envAll "haproxy" "server" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
26
+  annotations:
27
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
26 28
 spec:
27 29
   hostNetwork: true
28 30
   containers:

+ 1
- 0
charts/haproxy/templates/tests/test-haproxy-health.yaml View File

@@ -24,6 +24,7 @@ metadata:
24 24
   name: "{{ .Release.Name }}-haproxy-test"
25 25
   annotations:
26 26
     "helm.sh/hook": "test-success"
27
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
27 28
   labels:
28 29
 {{ tuple $envAll "kubernetes" "haproxy-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
29 30
 spec:

+ 2
- 0
charts/promenade/templates/deployment-api.yaml View File

@@ -21,6 +21,8 @@ apiVersion: extensions/v1beta1
21 21
 kind: Deployment
22 22
 metadata:
23 23
   name: promenade-api
24
+  annotations:
25
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
24 26
 spec:
25 27
   replicas: {{ .Values.pod.replicas.api }}
26 28
 {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}

+ 1
- 0
charts/promenade/templates/tests/test-promenade-api.yaml View File

@@ -25,6 +25,7 @@ metadata:
25 25
   name: "{{ .Release.Name }}-api-test"
26 26
   annotations:
27 27
     "helm.sh/hook": "test-success"
28
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
28 29
   labels:
29 30
 {{ tuple $envAll "promenade" "api-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
30 31
 spec:

+ 2
- 0
charts/proxy/templates/daemonset.yaml View File

@@ -22,6 +22,8 @@ apiVersion: "extensions/v1beta1"
22 22
 kind: DaemonSet
23 23
 metadata:
24 24
   name: kubernetes-proxy
25
+  annotations:
26
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
25 27
 spec:
26 28
 {{ tuple $envAll "proxy" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
27 29
   template:

+ 2
- 0
charts/scheduler/templates/etc/_kubernetes-scheduler.yaml.tpl View File

@@ -24,6 +24,8 @@ metadata:
24 24
   labels:
25 25
     {{ .Values.service.name }}-service: enabled
26 26
 {{ tuple $envAll "kubernetes" "scheduler" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
27
+  annotations:
28
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
27 29
 spec:
28 30
   hostNetwork: true
29 31
   containers:

+ 2
- 0
charts/scheduler/templates/sched-anchor.yaml View File

@@ -20,6 +20,8 @@ apiVersion: "extensions/v1beta1"
20 20
 kind: DaemonSet
21 21
 metadata:
22 22
   name: kubernetes-scheduler-anchor
23
+  annotations:
24
+    {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
23 25
 spec:
24 26
 {{ tuple $envAll "scheduler" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
25 27
   template:

Loading…
Cancel
Save