From 212cc5998a242f371104d10aba3a91fc3f606476 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Mon, 6 Jul 2020 21:31:12 -0400 Subject: [PATCH] Add preStop hook for UWSGI Change-Id: Ie0fa5e31d4d66b11567b2241ca24ac5ac8010fb7 Reference: https://stackoverflow.com/q/54459949 --- openstack_operator/templates/heat/deployment.yml.j2 | 4 ++++ openstack_operator/templates/horizon/deployment.yml.j2 | 4 ++++ openstack_operator/templates/keystone/deployment.yml.j2 | 4 ++++ openstack_operator/templates/magnum/deployment.yml.j2 | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/openstack_operator/templates/heat/deployment.yml.j2 b/openstack_operator/templates/heat/deployment.yml.j2 index d8a84771..e76499c7 100644 --- a/openstack_operator/templates/heat/deployment.yml.j2 +++ b/openstack_operator/templates/heat/deployment.yml.j2 @@ -78,6 +78,10 @@ spec: readinessProbe: tcpSocket: port: heat-{{ component }} + lifecycle: + preStop: + exec: + command: ["/bin/sleep", "5"] {% endif %} resources: limits: diff --git a/openstack_operator/templates/horizon/deployment.yml.j2 b/openstack_operator/templates/horizon/deployment.yml.j2 index f0d9b74a..d2e13721 100644 --- a/openstack_operator/templates/horizon/deployment.yml.j2 +++ b/openstack_operator/templates/horizon/deployment.yml.j2 @@ -56,6 +56,10 @@ spec: readinessProbe: tcpSocket: port: horizon + lifecycle: + preStop: + exec: + command: ["/bin/sleep", "5"] resources: limits: cpu: 2000m diff --git a/openstack_operator/templates/keystone/deployment.yml.j2 b/openstack_operator/templates/keystone/deployment.yml.j2 index daa6fc40..69d8b8de 100644 --- a/openstack_operator/templates/keystone/deployment.yml.j2 +++ b/openstack_operator/templates/keystone/deployment.yml.j2 @@ -116,6 +116,10 @@ spec: httpGet: path: /v3 port: keystone + lifecycle: + preStop: + exec: + command: ["/bin/sleep", "5"] resources: limits: cpu: 2000m diff --git a/openstack_operator/templates/magnum/deployment.yml.j2 b/openstack_operator/templates/magnum/deployment.yml.j2 index 179e73e8..3c0a8830 100644 --- a/openstack_operator/templates/magnum/deployment.yml.j2 +++ b/openstack_operator/templates/magnum/deployment.yml.j2 @@ -71,6 +71,10 @@ spec: readinessProbe: tcpSocket: port: magnum-{{ component }} + lifecycle: + preStop: + exec: + command: ["/bin/sleep", "5"] {% endif %} resources: limits: