Merge "Glance liveness/readiness params to values.yaml"

This commit is contained in:
Zuul 2023-08-14 18:37:48 +00:00 committed by Gerrit Code Review
commit 7494f0e25e
4 changed files with 49 additions and 30 deletions

View File

@ -14,7 +14,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Glance
name: glance
version: 0.4.10
version: 0.4.11
home: https://docs.openstack.org/glance/latest/
icon: https://www.openstack.org/themes/openstack/images/project-mascots/Glance/OpenStack_Project_Glance_vertical.png
sources:

View File

@ -12,6 +12,36 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "readinessProbeTemplate" }}
{{- if .Values.manifests.certificates }}
exec:
command:
- python
- -c
- "import requests; requests.get('http://127.0.0.1:{{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}')"
{{- else }}
httpGet:
scheme: {{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
path: /
port: {{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- end }}
{{- end }}
{{- define "livenessProbeTemplate" }}
{{- if .Values.manifests.certificates }}
exec:
command:
- python
- -c
- "import requests; requests.get('http://127.0.0.1:{{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}')"
{{- else }}
httpGet:
scheme: {{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
path: /
port: {{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- end }}
{{- end }}
{{- if .Values.manifests.deployment_api }}
{{- $envAll := . }}
@ -146,6 +176,8 @@ spec:
{{ tuple $envAll "glance_api" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "glance" "container" "glance_api" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
{{ dict "envAll" $envAll "component" "api" "container" "glance-api" "type" "readiness" "probeTemplate" (include "readinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
{{ dict "envAll" $envAll "component" "api" "container" "glance-api" "type" "liveness" "probeTemplate" (include "livenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
command:
- /tmp/glance-api.sh
- start
@ -160,38 +192,10 @@ spec:
command:
- /tmp/glance-api.sh
- stop
{{- if $envAll.Values.manifests.certificates }}
readinessProbe:
exec:
command:
- python
- -c
- "import requests; requests.get('http://127.0.0.1:{{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}')"
periodSeconds: 15
timeoutSeconds: 10
livenessProbe:
exec:
command:
- python
- -c
- "import requests; requests.get('http://127.0.0.1:{{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}')"
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 10
{{- else }}
{{- if not $envAll.Values.manifests.certificates }}
ports:
- name: g-api
containerPort: {{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
httpGet:
scheme: HTTP
path: /
port: {{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
livenessProbe:
httpGet:
scheme: HTTP
path: /
port: {{ tuple "image" "service" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- end }}
volumeMounts:
- name: pod-tmp

View File

@ -879,6 +879,20 @@ pod:
termination_grace_period:
api:
timeout: 30
probes:
api:
glance-api:
readiness:
enabled: true
params:
periodSeconds: 15
timeoutSeconds: 10
liveness:
enabled: true
params:
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 10
resources:
enabled: false
api:

View File

@ -44,4 +44,5 @@ glance:
- 0.4.8 Add 2023.1 overrides
- 0.4.9 Use service tokens
- 0.4.10 Add exec probe timeouts
- 0.4.11 Bring liveness/readiness params out to values.yaml
...