Use helm toolkit for readiness probes

Use helm toolkit template for readiness probes.

Change-Id: Ibcaf0deec74e3607d441b1d153fa54196e745981
This commit is contained in:
Ritchie, Frank (fr801x) 2023-08-22 14:33:35 -04:00
parent b76240f1df
commit fbeb69e3b2
4 changed files with 31 additions and 12 deletions

View File

@ -15,7 +15,7 @@ apiVersion: v1
appVersion: v1.0.0
description: OpenStack-Helm Nagios
name: nagios
version: 0.1.7
version: 0.1.8
home: https://www.nagios.org
sources:
- https://opendev.org/openstack/openstack-helm-addons

View File

@ -12,6 +12,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- define "apacheProxyReadinessProbeTemplate" }}
tcpSocket:
port: {{ tuple "nagios" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{- end }}
{{- define "nagiosReadinessProbeTemplate" }}
exec:
command:
- /tmp/nagios-readiness.sh
{{- end }}
{{- if .Values.manifests.deployment }}
{{- $envAll := . }}
@ -19,6 +30,7 @@ limitations under the License.
{{- $serviceAccountName := "nagios" }}
{{ tuple $envAll "nagios" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@ -120,17 +132,13 @@ spec:
{{ tuple $envAll "apache_proxy" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.apache_proxy | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "monitoring" "container" "apache_proxy" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
{{ dict "envAll" $envAll "component" "monitoring" "container" "apache_proxy" "type" "readiness" "probeTemplate" (include "apacheProxyReadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
command:
- /tmp/apache.sh
- start
ports:
- name: http
containerPort: {{ tuple "nagios" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
tcpSocket:
port: {{ tuple "nagios" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
initialDelaySeconds: 20
periodSeconds: 10
env:
- name: NAGIOSADMIN_USER
valueFrom:
@ -157,15 +165,10 @@ spec:
{{ tuple $envAll "nagios" | include "helm-toolkit.snippets.image" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.nagios | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ dict "envAll" $envAll "application" "monitoring" "container" "nagios" | include "helm-toolkit.snippets.kubernetes_container_security_context" | indent 10 }}
{{ dict "envAll" $envAll "component" "monitoring" "container" "nagios" "type" "readiness" "probeTemplate" (include "nagiosReadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | indent 10 }}
ports:
- name: nagios
containerPort: {{ tuple "nagios" "internal" "nagios" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
readinessProbe:
exec:
command:
- /tmp/nagios-readiness.sh
initialDelaySeconds: 60
periodSeconds: 30
env:
{{- if .Values.pod.env }}
{{ include "helm-toolkit.utils.to_k8s_env_vars" .Values.pod.env | indent 12 }}

View File

@ -269,6 +269,21 @@ pod:
# NODE_DOMAIN:
replicas:
nagios: 1
probes:
monitoring:
nagios:
readiness:
enabled: true
params:
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 10
apache_proxy:
readiness:
enabled: true
params:
initialDelaySeconds: 20
periodSeconds: 10
resources:
enabled: false
nagios:

View File

@ -8,4 +8,5 @@ nagios:
- 0.1.5 Switch nagios image from xenial to bionic
- 0.1.6 Added OCI registry authentication
- 0.1.7 Upgrade osh-selenium image to latest-ubuntu_focal
- 0.1.8 Use helm toolkit for readiness probes
...