2 Commits

Author SHA1 Message Date
Jochem
ff781504b0 Bump version 2024-07-11 20:46:32 +02:00
Jochem
7af1bb90ad Add ingress and testing values 2024-07-11 14:27:47 +02:00
14 changed files with 27 additions and 100 deletions

View File

@@ -12,7 +12,7 @@ jobs:
fetch-depth: 0
- name: Set up Helm
uses: azure/setup-helm@v4.3.0
uses: azure/setup-helm@v4.2.0
with:
version: v3.14.4
@@ -22,7 +22,7 @@ jobs:
check-latest: true
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.7.0
uses: helm/chart-testing-action@v2.6.1
- name: Add repositories
run: |
@@ -48,7 +48,7 @@ jobs:
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true' || github.event.pull_request.base.ref == 'main'
uses: helm/kind-action@v1.12.0
uses: helm/kind-action@v1.10.0
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true' && github.ref != 'refs/heads/develop'

View File

@@ -7,8 +7,6 @@ jobs:
if: github.ref == 'refs/heads/main'
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -31,24 +29,6 @@ jobs:
done
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.7.0
uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
# see https://github.com/helm/chart-releaser/issues/183
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push charts to GHCR
run: |
shopt -s nullglob
for pkg in .cr-release-packages/*; do
if [ -z "${pkg:-}" ]; then
break
fi
helm push "${pkg}" "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"
done

View File

@@ -1,9 +1,9 @@
dependencies:
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 21.1.3
version: 19.6.1
- name: mysql
repository: https://charts.bitnami.com/bitnami
version: 13.0.0
digest: sha256:ab48525b17834c3b7e491483bb35fad9d11ddbf74368a352cafd59dbbe34d940
generated: "2025-05-19T07:25:23.570909791Z"
version: 11.1.8
digest: sha256:4b82fafdf2c4c72a003d1dc6df9343a089eb5d2f686927d134821854f9633c83
generated: "2024-07-09T10:22:10.255911997Z"

View File

@@ -2,17 +2,17 @@ apiVersion: v2
name: librenms
description: LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system.
type: application
version: 5.0.2
appVersion: "25.5.0"
version: 3.12.0
appVersion: "24.5.0"
maintainers:
- name: jacobw
url: https://github.com/jacobw
- name: TheChef23
url: https://github.com/TheChef23
dependencies:
- name: redis
version: "~21.1.0"
version: "~19.6.0"
repository: "https://charts.bitnami.com/bitnami"
condition: redis.enabled
- name: mysql
version: "~13.0.0"
version: "~11.1.0"
repository: "https://charts.bitnami.com/bitnami"
condition: mysql.enabled

View File

@@ -1,4 +1,4 @@
librenms:
appkey: base64:RTMmh+i10E2RMcDxookMu47BTzJQy87hOU+k/zcuPnA=
ingress:
enabled: true
enabled: "true"

View File

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

View File

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

View File

@@ -64,14 +64,3 @@ 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

@@ -6,19 +6,15 @@ metadata:
data:
TZ: {{ .Values.librenms.timezone}}
DB_TIMEOUT: "60"
RRDCACHED_SERVER: "{{ .Release.Name }}-rrdcached:42217"
{{- if .Values.redis.enabled }}
REDIS_HOST: {{ .Release.Name }}-redis-master
REDIS_PORT: "6379"
REDIS_DB: "0"
RRDCACHED_SERVER: "{{ .Release.Name }}-rrdcached:42217"
CACHE_DRIVER: redis
SESSION_DRIVER: redis
{{- end }}
{{- if .Values.mysql.enabled }}
DB_HOST: {{ .Release.Name }}-mysql
DB_USERNAME: {{.Values.mysql.auth.username}}
DB_DATABASE: {{.Values.mysql.auth.database}}
{{- end }}
---
kind: ConfigMap
apiVersion: v1
@@ -27,5 +23,7 @@ metadata:
data:
custom.php: |-
{{ tpl (.Files.Get "files/custom.php") . | indent 4 }}
env: |-
{{ tpl (.Files.Get "files/env") . | indent 4 }}
init.sh: |-
{{ .Files.Get "files/init.sh" | indent 4 }}
{{ tpl (.Files.Get "files/init.sh") . | indent 4 }}

View File

@@ -19,18 +19,13 @@ spec:
volumes:
- name: env-volume
emptyDir: {}
- name: key
secret:
secretName: {{ include "librenms.secretName" . }}
- name: files
configMap:
name: {{ .Release.Name }}-files
{{- if .Values.mysql.enabled }}
- name: mysql
secret:
secretName: {{ .Release.Name }}-mysql
optional: false
{{- end }}
initContainers:
- name: init
image: busybox:1.28
@@ -38,8 +33,6 @@ spec:
volumeMounts:
- name: env-volume
mountPath: /data/env-volume
- name: key
mountPath: /data/key
- name: files
mountPath: /data/files
containers:
@@ -50,13 +43,11 @@ spec:
- configMapRef:
name: {{ .Release.Name }}
env:
{{- if .Values.mysql.enabled }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-mysql
key: mysql-password
{{- end }}
{{- with .Values.librenms.extraEnvs }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -64,13 +55,11 @@ spec:
- name: files
mountPath: /data/files
- name: files
mountPath: /data/config/custom.php
mountPath: /opt/librenms/custom.php
subPath: custom.php
readOnly: true
{{- if .Values.mysql.enabled }}
- name: mysql
mountPath: "/opt/secrets/mysql/"
{{- end }}
- name: env-volume
mountPath: /data/.env
subPath: env

View File

@@ -20,17 +20,12 @@ spec:
volumes:
- name: env-volume
emptyDir: {}
- name: key
secret:
secretName: {{ include "librenms.secretName" . }}
- name: files
configMap:
name: {{ .Release.Name }}-files
{{- if .Values.mysql.enabled }}
- name: mysql
secret:
secretName: {{ .Release.Name }}-mysql
{{- end }}
initContainers:
- name: init
image: busybox:1.28
@@ -38,8 +33,6 @@ spec:
volumeMounts:
- name: env-volume
mountPath: /data/env-volume
- name: key
mountPath: /data/key
- name: files
mountPath: /data/files
containers:
@@ -49,13 +42,11 @@ spec:
env:
- name: SIDECAR_DISPATCHER
value: "1"
{{- if .Values.mysql.enabled }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-mysql
key: mysql-password
{{- end }}
{{- with .Values.librenms.poller.extraEnvs }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -70,18 +61,15 @@ spec:
- name: env-volume
mountPath: /data/.env
subPath: env
{{- if .Values.mysql.enabled }}
- name: mysql
mountPath: "/opt/secrets/mysql/"
readOnly: true
{{- if .Values.librenms.poller.resources }}
resources: {{ toYaml .Values.librenms.poller.resources | nindent 10 }}
{{- end }}
{{- if .Values.mysql.enabled }}
readinessProbe:
exec:
command: ["nc", "-z", "-v", "-w1", "{{ .Release.Name }}-mysql", "3306"]
initialDelaySeconds: 0
periodSeconds: 1
failureThreshold: 3
{{- end }}

View File

@@ -1,10 +0,0 @@
{{- 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

@@ -27,12 +27,10 @@ spec:
persistentVolumeClaim:
claimName: {{ .Release.Name }}-rrdcached-journal
{{end}}
{{- if .Values.mysql.enabled }}
- name: mysql
secret:
secretName: {{ .Release.Name }}-mysql
optional: false # default setting; "mysecret" must exist
{{- end }}
containers:
- name: rrdcached
@@ -44,11 +42,9 @@ spec:
mountPath: /data/db
- name: journal
mountPath: /data/journal
{{- if .Values.mysql.enabled }}
- name: mysql
mountPath: "/opt/mysql/"
readOnly: true
{{- end }}
{{end}}
env:
{{- with .Values.librenms.rrdcached.envs }}

View File

@@ -6,16 +6,12 @@ librenms:
# -- repository is the image repository to pull from.
repository: librenms/librenms
# -- tag is image tag to pull.
tag: 25.5.0
tag: 24.5.0
# -- Laravel appkey used by LibreNMS, this should be generated by you and is a
# 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