Merge pull request #70 from librenms/develop

Merge develop into main
This commit is contained in:
Jacob Winther 2025-04-26 14:32:17 +12:00 committed by GitHub
commit 74d812de38
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 39 additions and 7 deletions

View File

@ -2,7 +2,7 @@ apiVersion: v2
name: librenms
description: LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system.
type: application
version: 4.0.3
version: 5.0.0
appVersion: "25.4.0"
maintainers:
- name: jacobw

View File

@ -1 +0,0 @@
APP_KEY={{.Values.librenms.appkey}}

View File

@ -1,7 +1,7 @@
#!/bin/sh
TARGET="/data/env-volume/env"
echo "Target: $TARGET"
cp /data/files/env $TARGET
echo -e "\nNODE_ID=`hostname`" >> $TARGET
echo "APP_KEY=$(cat /data/key/appkey)" > $TARGET
echo "NODE_ID=$(hostname)" >> $TARGET
cat $TARGET

View File

@ -64,3 +64,14 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
{{/*
Create the name of the secret to use
*/}}
{{- define "librenms.secretName" -}}
{{- if .Values.librenms.existingSecret -}}
{{- .Values.librenms.existingSecret -}}
{{- else -}}
{{- .Release.Name -}}
{{- end -}}
{{- end -}}

View File

@ -23,7 +23,5 @@ metadata:
data:
custom.php: |-
{{ tpl (.Files.Get "files/custom.php") . | indent 4 }}
env: |-
{{ tpl (.Files.Get "files/env") . | indent 4 }}
init.sh: |-
{{ tpl (.Files.Get "files/init.sh") . | indent 4 }}
{{ .Files.Get "files/init.sh" | indent 4 }}

View File

@ -19,6 +19,9 @@ spec:
volumes:
- name: env-volume
emptyDir: {}
- name: key
secret:
secretName: {{ include "librenms.secretName" . }}
- name: files
configMap:
name: {{ .Release.Name }}-files
@ -33,6 +36,8 @@ spec:
volumeMounts:
- name: env-volume
mountPath: /data/env-volume
- name: key
mountPath: /data/key
- name: files
mountPath: /data/files
containers:

View File

@ -20,6 +20,9 @@ spec:
volumes:
- name: env-volume
emptyDir: {}
- name: key
secret:
secretName: {{ include "librenms.secretName" . }}
- name: files
configMap:
name: {{ .Release.Name }}-files
@ -33,6 +36,8 @@ spec:
volumeMounts:
- name: env-volume
mountPath: /data/env-volume
- name: key
mountPath: /data/key
- name: files
mountPath: /data/files
containers:

View File

@ -0,0 +1,10 @@
{{- if not .Values.librenms.existingSecret }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ .Release.Name }}
type: Opaque
data:
appkey: {{ .Values.librenms.appkey | b64enc | quote }}
{{- end }}

View File

@ -12,6 +12,10 @@ librenms:
# required setting. See the README for more information
appkey:
# -- Existing secret name to use for appkey
# Must have the key 'appkey' as above
existingSecret: false
# -- Timezone used by librenms for communication with RRD cached
timezone: UTC