diff --git a/nagios/Chart.yaml b/nagios/Chart.yaml index c66e5489c..05203bd6d 100644 --- a/nagios/Chart.yaml +++ b/nagios/Chart.yaml @@ -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 diff --git a/nagios/templates/deployment.yaml b/nagios/templates/deployment.yaml index 02fb93475..3c71331a6 100644 --- a/nagios/templates/deployment.yaml +++ b/nagios/templates/deployment.yaml @@ -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 }} diff --git a/nagios/values.yaml b/nagios/values.yaml index 5afe27bdb..5aa4de9c1 100644 --- a/nagios/values.yaml +++ b/nagios/values.yaml @@ -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: diff --git a/releasenotes/notes/nagios.yaml b/releasenotes/notes/nagios.yaml index 761211e0d..d6b6b8dc7 100644 --- a/releasenotes/notes/nagios.yaml +++ b/releasenotes/notes/nagios.yaml @@ -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 ...