Merge "Nagios: Update logging, add readiness probe"
This commit is contained in:
commit
9ff0a5afdf
27
nagios/templates/bin/_nagios-readiness.sh.tpl
Normal file
27
nagios/templates/bin/_nagios-readiness.sh.tpl
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Copyright 2019 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
# NOTE(sw5822): Redirect no-op operator output to Nagios log file to clean out
|
||||||
|
# Nagios's log file, since Nagios doesn't support logging to /dev/null
|
||||||
|
: > /opt/nagios/var/log/nagios.log
|
||||||
|
|
||||||
|
# Check whether Nagios endpoint is reachable
|
||||||
|
reply=$(curl -s -o /dev/null -w %{http_code} http://127.0.0.1:8000/nagios)
|
||||||
|
if [ \"$reply\" -lt 200 -o \"$reply\" -ge 400 ]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
@ -24,6 +24,8 @@ metadata:
|
|||||||
data:
|
data:
|
||||||
apache.sh: |
|
apache.sh: |
|
||||||
{{ tuple "bin/_apache.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
{{ tuple "bin/_apache.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
nagios-readiness.sh: |
|
||||||
|
{{ tuple "bin/_nagios-readiness.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
image-repo-sync.sh: |+
|
image-repo-sync.sh: |+
|
||||||
{{- include "helm-toolkit.scripts.image_repo_sync" . | indent 4 }}
|
{{- include "helm-toolkit.scripts.image_repo_sync" . | indent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -92,19 +92,6 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
initContainers:
|
initContainers:
|
||||||
{{ tuple $envAll "nagios" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
{{ tuple $envAll "nagios" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
||||||
- name: nagios-log-ownership
|
|
||||||
{{ tuple $envAll "nagios" | include "helm-toolkit.snippets.image" | indent 10 }}
|
|
||||||
securityContext:
|
|
||||||
runAsUser: 0
|
|
||||||
command:
|
|
||||||
- chown
|
|
||||||
- -R
|
|
||||||
- nagios:root
|
|
||||||
- /opt/nagios/var/log
|
|
||||||
volumeMounts:
|
|
||||||
- name: pod-var-log
|
|
||||||
mountPath: /opt/nagios/var/log
|
|
||||||
readOnly: false
|
|
||||||
containers:
|
containers:
|
||||||
- name: apache-proxy
|
- name: apache-proxy
|
||||||
{{ tuple $envAll "apache_proxy" | include "helm-toolkit.snippets.image" | indent 10 }}
|
{{ tuple $envAll "apache_proxy" | include "helm-toolkit.snippets.image" | indent 10 }}
|
||||||
@ -146,6 +133,12 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- name: nagios
|
- name: nagios
|
||||||
containerPort: {{ tuple "nagios" "internal" "nagios" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
containerPort: {{ tuple "nagios" "internal" "nagios" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /tmp/nagios-readiness.sh
|
||||||
|
initialDelaySeconds: 60
|
||||||
|
periodSeconds: 30
|
||||||
env:
|
env:
|
||||||
- name: SNMP_NOTIF_PRIMARY_TARGET_WITH_PORT
|
- name: SNMP_NOTIF_PRIMARY_TARGET_WITH_PORT
|
||||||
value: {{ $envAll.Values.conf.nagios.notification.snmp.primary_target }}
|
value: {{ $envAll.Values.conf.nagios.notification.snmp.primary_target }}
|
||||||
@ -190,6 +183,10 @@ spec:
|
|||||||
mountPath: /opt/nagios/etc/nagios_objects.cfg
|
mountPath: /opt/nagios/etc/nagios_objects.cfg
|
||||||
subPath: nagios_objects.cfg
|
subPath: nagios_objects.cfg
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
- name: nagios-bin
|
||||||
|
mountPath: /tmp/nagios-readiness.sh
|
||||||
|
subPath: nagios-readiness.sh
|
||||||
|
readOnly: true
|
||||||
{{- if not (empty .Values.conf.nagios.query_es_clauses) }}
|
{{- if not (empty .Values.conf.nagios.query_es_clauses) }}
|
||||||
- name: nagios-etc
|
- name: nagios-etc
|
||||||
mountPath: /opt/nagios/etc/objects/query_es_clauses.json
|
mountPath: /opt/nagios/etc/objects/query_es_clauses.json
|
||||||
@ -198,11 +195,9 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
- name: pod-var-log
|
- name: pod-var-log
|
||||||
mountPath: /opt/nagios/var/log
|
mountPath: /opt/nagios/var/log
|
||||||
readOnly: false
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: pod-var-log
|
- name: pod-var-log
|
||||||
hostPath:
|
emptyDir: {}
|
||||||
path: /opt/nagios/var/log
|
|
||||||
- name: nagios-etc
|
- name: nagios-etc
|
||||||
secret:
|
secret:
|
||||||
secretName: nagios-etc
|
secretName: nagios-etc
|
||||||
|
@ -1075,7 +1075,8 @@ conf:
|
|||||||
event_broker_options: -1
|
event_broker_options: -1
|
||||||
log_rotation_method: d
|
log_rotation_method: d
|
||||||
log_archive_path: /opt/nagios/var/log/archives
|
log_archive_path: /opt/nagios/var/log/archives
|
||||||
use_syslog: 1
|
use_syslog: 0
|
||||||
|
log_notifications: 0
|
||||||
log_service_retries: 1
|
log_service_retries: 1
|
||||||
log_host_retries: 1
|
log_host_retries: 1
|
||||||
log_event_handlers: 1
|
log_event_handlers: 1
|
||||||
@ -1088,7 +1089,7 @@ conf:
|
|||||||
service_interleave_factor: s
|
service_interleave_factor: s
|
||||||
host_inter_check_delay_method: s
|
host_inter_check_delay_method: s
|
||||||
max_host_check_spread: 30
|
max_host_check_spread: 30
|
||||||
max_concurrent_checks: 60
|
max_concurrent_checks: 300
|
||||||
check_result_reaper_frequency: 10
|
check_result_reaper_frequency: 10
|
||||||
max_check_result_reaper_time: 30
|
max_check_result_reaper_time: 30
|
||||||
check_result_path: /opt/nagios/var/spool/checkresults
|
check_result_path: /opt/nagios/var/spool/checkresults
|
||||||
|
Loading…
Reference in New Issue
Block a user