Decrease terminationGracePeriodSeconds on glance-api

The glance-api pod has a terminationGracePeriodSeconds
of 600s(10min) and the others services has 30s. This high
terminationGracePeriodSeconds may cause timeout in some
cases and there is no reason for this high
terminationGracePeriodSeconds.
The terminationGracePeriodSeconds has been introduced on
https://review.opendev.org/c/openstack/openstack-helm/+/469974
but there is no explanation why it is too high.
the Glance don't gracefully terminate due to a authenticate
with kube-apiserver  with the error: "Unable to authenticate
the request" err="[invalid bearer token, Token has been invalidated]"
Looking after it I saw that it can be a timing error between the
communication of the kube-apiserver and the glance-api when is in
terminating state. Normally, the glance api terminate gracefully
before 30sec, but if the error of Unable to authenticate appear, it
kill faster to keep the things working like the other services does.

Test Plan:
PASS: Build on centOS
PASS: Build on Debian
PASS: Apply chart

Story: 2009959
Task: 44927

Signed-off-by: Arthur Luz de Avila <arthur.luzdeavila@windriver.com>
Change-Id: Id4ef301c9ee1fce9f78ee09b3ce7f896d59a5a96
This commit is contained in:
Arthur Luz de Avila 2022-04-04 10:37:06 -03:00
parent b3092e6c21
commit fff6c25952
4 changed files with 115 additions and 0 deletions

View File

@ -33,6 +33,7 @@ Patch11: 0011-Fix-nova-compute-ssh-init-to-execute-as-runAsUser.patch
Patch12: 0012-Replace-deprecated-Nova-VNC-configurations.patch Patch12: 0012-Replace-deprecated-Nova-VNC-configurations.patch
Patch13: 0013-Remove-TLS-from-openstack-services.patch Patch13: 0013-Remove-TLS-from-openstack-services.patch
Patch14: 0014-Remove-mariadb-and-rabbit-tls.patch Patch14: 0014-Remove-mariadb-and-rabbit-tls.patch
Patch15: 0015-Decrease-terminationGracePeriodSeconds-on-glance-api.patch
BuildRequires: helm BuildRequires: helm
BuildRequires: openstack-helm-infra BuildRequires: openstack-helm-infra
@ -58,6 +59,7 @@ Openstack Helm charts
%patch12 -p1 %patch12 -p1
%patch13 -p1 %patch13 -p1
%patch14 -p1 %patch14 -p1
%patch15 -p1
%build %build
# Stage helm-toolkit in the local repo # Stage helm-toolkit in the local repo

View File

@ -0,0 +1,56 @@
From 3b780510bee6e4af0e2ab98ca37202ec788b736a Mon Sep 17 00:00:00 2001
From: Arthur Luz de Avila <arthur.luzdeavila@windriver.com>
Date: Mon, 4 Apr 2022 09:44:44 -0300
Subject: [PATCH] Decrease terminationGracePeriodSeconds on glance-api
The glance-api pod has a terminationGracePeriodSeconds
of 600s(10min) and the others services has 30s. This high
terminationGracePeriodSeconds may cause timeout in some
cases and there is no reason for this high
terminationGracePeriodSeconds.
The terminationGracePeriodSeconds has been introduced on
https://review.opendev.org/c/openstack/openstack-helm/+/469974
but there is no explanation why it is too high.
Story: 2009959
Task: 44926
Signed-off-by: Arthur Luz de Avila <arthur.luzdeavila@windriver.com>
Change-Id: I9f9092e48c4f4ecf5a145dc42dbafe4f96cfa91c
---
glance/templates/deployment-api.yaml | 2 +-
glance/values.yaml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/glance/templates/deployment-api.yaml b/glance/templates/deployment-api.yaml
index 78e16715..360e8a88 100644
--- a/glance/templates/deployment-api.yaml
+++ b/glance/templates/deployment-api.yaml
@@ -54,7 +54,7 @@ spec:
{{ end }}
nodeSelector:
{{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value }}
- terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "600" }}
+ terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }}
initContainers:
{{ tuple $envAll "api" $mounts_glance_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
- name: glance-perms
diff --git a/glance/values.yaml b/glance/values.yaml
index ea3dd8e5..b84b49eb 100644
--- a/glance/values.yaml
+++ b/glance/values.yaml
@@ -945,9 +945,9 @@ pod:
min_available: 0
termination_grace_period:
api:
- timeout: 600
+ timeout: 30
registry:
- timeout: 600
+ timeout: 30
resources:
enabled: false
api:
--
2.17.1

View File

@ -12,3 +12,4 @@
0012-Replace-deprecated-Nova-VNC-configurations.patch 0012-Replace-deprecated-Nova-VNC-configurations.patch
0013-Remove-TLS-from-openstack-services.patch 0013-Remove-TLS-from-openstack-services.patch
0014-Remove-mariadb-and-rabbit-tls.patch 0014-Remove-mariadb-and-rabbit-tls.patch
0015-Decrease-terminationGracePeriodSeconds-on-glance-api.patch

View File

@ -0,0 +1,56 @@
From 3b780510bee6e4af0e2ab98ca37202ec788b736a Mon Sep 17 00:00:00 2001
From: Arthur Luz de Avila <arthur.luzdeavila@windriver.com>
Date: Mon, 4 Apr 2022 09:44:44 -0300
Subject: [PATCH] Decrease terminationGracePeriodSeconds on glance-api
The glance-api pod has a terminationGracePeriodSeconds
of 600s(10min) and the others services has 30s. This high
terminationGracePeriodSeconds may cause timeout in some
cases and there is no reason for this high
terminationGracePeriodSeconds.
The terminationGracePeriodSeconds has been introduced on
https://review.opendev.org/c/openstack/openstack-helm/+/469974
but there is no explanation why it is too high.
Story: 2009959
Task: 44926
Signed-off-by: Arthur Luz de Avila <arthur.luzdeavila@windriver.com>
Change-Id: I9f9092e48c4f4ecf5a145dc42dbafe4f96cfa91c
---
glance/templates/deployment-api.yaml | 2 +-
glance/values.yaml | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/glance/templates/deployment-api.yaml b/glance/templates/deployment-api.yaml
index 78e16715..360e8a88 100644
--- a/glance/templates/deployment-api.yaml
+++ b/glance/templates/deployment-api.yaml
@@ -54,7 +54,7 @@ spec:
{{ end }}
nodeSelector:
{{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value }}
- terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "600" }}
+ terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }}
initContainers:
{{ tuple $envAll "api" $mounts_glance_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
- name: glance-perms
diff --git a/glance/values.yaml b/glance/values.yaml
index ea3dd8e5..b84b49eb 100644
--- a/glance/values.yaml
+++ b/glance/values.yaml
@@ -945,9 +945,9 @@ pod:
min_available: 0
termination_grace_period:
api:
- timeout: 600
+ timeout: 30
registry:
- timeout: 600
+ timeout: 30
resources:
enabled: false
api:
--
2.17.1