diff --git a/nagios/Chart.yaml b/nagios/Chart.yaml index 58cc15d846..9b3d343037 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.12 +version: 0.1.13 home: https://www.nagios.org sources: - https://opendev.org/openstack/openstack-helm-addons diff --git a/nagios/templates/configmap-additional-plugins.yaml b/nagios/templates/configmap-additional-plugins.yaml new file mode 100644 index 0000000000..42002062a8 --- /dev/null +++ b/nagios/templates/configmap-additional-plugins.yaml @@ -0,0 +1,27 @@ +{{/* +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. +*/}} + +{{- if .Values.manifests.configmap_additional_plugins }} +{{- $envAll := . }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: nagios-additional-plugins +type: Opaque +data: +{{- range .Values.conf.nagios.additionalPlugins }} + {{ .name }}: {{ .content | b64enc | quote }} +{{- end }} +{{- end }} diff --git a/nagios/templates/deployment.yaml b/nagios/templates/deployment.yaml index 3c71331a62..77c64fa83a 100644 --- a/nagios/templates/deployment.yaml +++ b/nagios/templates/deployment.yaml @@ -239,6 +239,14 @@ spec: {{- end }} - name: pod-var-log mountPath: /opt/nagios/var/log +{{- if not (empty .Values.conf.nagios.additionalPlugins) }} +{{- range .Values.conf.nagios.additionalPlugins }} + - name: additional-plugins + mountPath: /usr/lib/nagios/plugins/{{ .name }} + subPath: {{ .name }} + readOnly: true +{{- end }} +{{- end }} {{- dict "enabled" .Values.manifests.certificates "name" $envAll.Values.endpoints.monitoring.auth.admin.secret.tls.internal "path" "/etc/ssl/certs" "certs" tuple "ca.crt" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} volumes: - name: pod-tmp @@ -255,5 +263,9 @@ spec: configMap: name: nagios-bin defaultMode: 0555 + - name: additional-plugins + secret: + secretName: nagios-additional-plugins + defaultMode: 0755 {{- dict "enabled" .Values.manifests.certificates "name" $envAll.Values.endpoints.monitoring.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} {{- end }} diff --git a/nagios/values.yaml b/nagios/values.yaml index dc449b6874..95ea948a92 100644 --- a/nagios/values.yaml +++ b/nagios/values.yaml @@ -321,6 +321,7 @@ pod: manifests: certificates: false + configmap_additional_plugins: false configmap_bin: true configmap_etc: true deployment: true @@ -1225,4 +1226,5 @@ conf: use_pending_states=1 use_ssl_authentication=0 query_es_clauses: null + additionalPlugins: [] ... diff --git a/releasenotes/notes/nagios.yaml b/releasenotes/notes/nagios.yaml index 3e16001901..4a770fdd8a 100644 --- a/releasenotes/notes/nagios.yaml +++ b/releasenotes/notes/nagios.yaml @@ -13,4 +13,5 @@ nagios: - 0.1.10 Correct selenium v3 syntax - 0.1.11 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default - 0.1.12 Update nagios image tag to latest-ubuntu_jammy + - 0.1.13 Add the ability to use custom Nagios plugins ...