From ae688e7fb400580046e379c46dcc061e67c8fac5 Mon Sep 17 00:00:00 2001 From: Matt McEuen Date: Fri, 14 Sep 2018 15:55:04 -0500 Subject: [PATCH] Add release uuid to pods and rc objects (shipyard) 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: I75fc7516e0d32e7e0df0fecf1f9bec0e234adfcc --- charts/shipyard/templates/deployment-airflow-flower.yaml | 2 ++ charts/shipyard/templates/deployment-airflow-scheduler.yaml | 2 ++ charts/shipyard/templates/deployment-airflow-web.yaml | 2 ++ charts/shipyard/templates/deployment-shipyard.yaml | 2 ++ charts/shipyard/templates/job-airflow-db-init.yaml | 2 ++ charts/shipyard/templates/job-airflow-db-sync.yaml | 2 ++ charts/shipyard/templates/job-shipyard-db-init.yaml | 2 ++ charts/shipyard/templates/job-shipyard-db-sync.yaml | 2 ++ charts/shipyard/templates/statefulset-airflow-worker.yaml | 2 ++ charts/shipyard/templates/tests/test-shipyard-api.yaml | 1 + 10 files changed, 19 insertions(+) diff --git a/charts/shipyard/templates/deployment-airflow-flower.yaml b/charts/shipyard/templates/deployment-airflow-flower.yaml index faa64b43..8efecfae 100644 --- a/charts/shipyard/templates/deployment-airflow-flower.yaml +++ b/charts/shipyard/templates/deployment-airflow-flower.yaml @@ -24,6 +24,8 @@ apiVersion: apps/v1beta1 kind: Deployment metadata: name: airflow-flower + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} spec: replicas: {{ .Values.pod.replicas.airflow.flower }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} diff --git a/charts/shipyard/templates/deployment-airflow-scheduler.yaml b/charts/shipyard/templates/deployment-airflow-scheduler.yaml index 430cb664..f38b5021 100644 --- a/charts/shipyard/templates/deployment-airflow-scheduler.yaml +++ b/charts/shipyard/templates/deployment-airflow-scheduler.yaml @@ -24,6 +24,8 @@ apiVersion: apps/v1beta1 kind: Deployment metadata: name: airflow-scheduler + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} spec: replicas: {{ .Values.pod.replicas.airflow.scheduler }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} diff --git a/charts/shipyard/templates/deployment-airflow-web.yaml b/charts/shipyard/templates/deployment-airflow-web.yaml index 20ec52f9..faaecb62 100644 --- a/charts/shipyard/templates/deployment-airflow-web.yaml +++ b/charts/shipyard/templates/deployment-airflow-web.yaml @@ -24,6 +24,8 @@ apiVersion: apps/v1beta1 kind: Deployment metadata: name: airflow-web + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} spec: replicas: {{ .Values.pod.replicas.airflow.web }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} diff --git a/charts/shipyard/templates/deployment-shipyard.yaml b/charts/shipyard/templates/deployment-shipyard.yaml index f6491591..b459c04f 100644 --- a/charts/shipyard/templates/deployment-shipyard.yaml +++ b/charts/shipyard/templates/deployment-shipyard.yaml @@ -24,6 +24,8 @@ apiVersion: apps/v1beta1 kind: Deployment metadata: name: shipyard-api + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} spec: replicas: {{ .Values.pod.replicas.shipyard.api }} {{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }} diff --git a/charts/shipyard/templates/job-airflow-db-init.yaml b/charts/shipyard/templates/job-airflow-db-init.yaml index 709f1ba5..18a3e3a0 100644 --- a/charts/shipyard/templates/job-airflow-db-init.yaml +++ b/charts/shipyard/templates/job-airflow-db-init.yaml @@ -24,6 +24,8 @@ apiVersion: batch/v1 kind: Job metadata: name: airflow-db-init + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} spec: template: metadata: diff --git a/charts/shipyard/templates/job-airflow-db-sync.yaml b/charts/shipyard/templates/job-airflow-db-sync.yaml index 87b60e24..82396a5f 100644 --- a/charts/shipyard/templates/job-airflow-db-sync.yaml +++ b/charts/shipyard/templates/job-airflow-db-sync.yaml @@ -24,6 +24,8 @@ apiVersion: batch/v1 kind: Job metadata: name: airflow-db-sync + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} spec: template: metadata: diff --git a/charts/shipyard/templates/job-shipyard-db-init.yaml b/charts/shipyard/templates/job-shipyard-db-init.yaml index 1c8704f3..081dc2da 100644 --- a/charts/shipyard/templates/job-shipyard-db-init.yaml +++ b/charts/shipyard/templates/job-shipyard-db-init.yaml @@ -26,6 +26,8 @@ apiVersion: batch/v1 kind: Job metadata: name: shipyard-db-init + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} spec: template: metadata: diff --git a/charts/shipyard/templates/job-shipyard-db-sync.yaml b/charts/shipyard/templates/job-shipyard-db-sync.yaml index 437bd1b4..5f45c3a3 100644 --- a/charts/shipyard/templates/job-shipyard-db-sync.yaml +++ b/charts/shipyard/templates/job-shipyard-db-sync.yaml @@ -26,6 +26,8 @@ apiVersion: batch/v1 kind: Job metadata: name: shipyard-db-sync + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} spec: template: metadata: diff --git a/charts/shipyard/templates/statefulset-airflow-worker.yaml b/charts/shipyard/templates/statefulset-airflow-worker.yaml index 31f9939c..da2e7ed4 100644 --- a/charts/shipyard/templates/statefulset-airflow-worker.yaml +++ b/charts/shipyard/templates/statefulset-airflow-worker.yaml @@ -55,6 +55,8 @@ apiVersion: apps/v1beta1 kind: StatefulSet metadata: name: airflow-worker + annotations: + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} spec: serviceName: {{ tuple "airflow_worker" "discovery" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} podManagementPolicy: "Parallel" diff --git a/charts/shipyard/templates/tests/test-shipyard-api.yaml b/charts/shipyard/templates/tests/test-shipyard-api.yaml index 36f77e4f..77704041 100644 --- a/charts/shipyard/templates/tests/test-shipyard-api.yaml +++ b/charts/shipyard/templates/tests/test-shipyard-api.yaml @@ -25,6 +25,7 @@ metadata: name: "{{ .Release.Name }}-shipyard-api-test" annotations: "helm.sh/hook": "test-success" + {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} labels: {{ tuple $envAll "shipyard" "api-test" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: