From 09b6cbaba572bbe91d259dfe734b6c9553a5ab74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=A4fer?= Date: Mon, 25 Mar 2019 16:47:08 +0100 Subject: [PATCH] Trigger rollout with a change to spec.template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The documentation clearly says: ``` Note: A Deployment’s rollout is triggered if and only if the Deployment’s pod template (that is, .spec.template) is changed, for example if the labels or container images of the template are updated. Other updates, such as scaling the Deployment, do not trigger a rollout. ``` Read: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment --- deployment/human-connection/deployment-backend.yaml | 3 +-- deployment/human-connection/deployment-web.yaml | 3 +-- scripts/patch-deployment.yaml | 8 +++++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/deployment/human-connection/deployment-backend.yaml b/deployment/human-connection/deployment-backend.yaml index 13cc7f7ed..29992ef7e 100644 --- a/deployment/human-connection/deployment-backend.yaml +++ b/deployment/human-connection/deployment-backend.yaml @@ -4,8 +4,6 @@ metadata: name: nitro-backend namespace: human-connection - labels: - commit: "COMMIT" spec: replicas: 1 minReadySeconds: 15 @@ -20,6 +18,7 @@ template: metadata: labels: + human-connection.org/commit: COMMIT human-connection.org/selector: deployment-human-connection-backend name: "nitro-backend" spec: diff --git a/deployment/human-connection/deployment-web.yaml b/deployment/human-connection/deployment-web.yaml index d69ebf617..885762e0a 100644 --- a/deployment/human-connection/deployment-web.yaml +++ b/deployment/human-connection/deployment-web.yaml @@ -3,8 +3,6 @@ kind: Deployment metadata: name: nitro-web namespace: human-connection - labels: - commit: "COMMIT" spec: replicas: 2 minReadySeconds: 15 @@ -15,6 +13,7 @@ spec: template: metadata: labels: + human-connection.org/commit: COMMIT human-connection.org/selector: deployment-human-connection-web name: nitro-web spec: diff --git a/scripts/patch-deployment.yaml b/scripts/patch-deployment.yaml index 05afe9b31..c229b8e7c 100644 --- a/scripts/patch-deployment.yaml +++ b/scripts/patch-deployment.yaml @@ -1,3 +1,5 @@ -metadata: - labels: - commit: +spec: + template: + metadata: + labels: + human-connection.org/commit: