Skip to content

Commit 2ddb98e

Browse files
authored
Merge pull request #164 from librenms/develop
Merge develop into main
2 parents 57a3ea7 + 84466b8 commit 2ddb98e

File tree

15 files changed

+252
-92
lines changed

15 files changed

+252
-92
lines changed

.github/workflows/chart-testing.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,21 @@ jobs:
5555

5656
- name: Run chart-testing (install & upgrades)
5757
if: github.event.pull_request.base.ref == 'main'
58-
run: ct install --target-branch main --upgrade
58+
run: ct install --target-branch main --upgrade
59+
60+
- name: Debug - Check pod status (on failure)
61+
if: failure() && (steps.list-changed.outputs.changed == 'true' || github.event.pull_request.base.ref == 'main')
62+
run: |
63+
echo "=== Pod Status ==="
64+
kubectl get pods -A
65+
echo -e "\n=== Events ==="
66+
kubectl get events -A --sort-by='.lastTimestamp' | tail -50
67+
68+
- name: Debug - Pod logs (on failure)
69+
if: failure() && (steps.list-changed.outputs.changed == 'true' || github.event.pull_request.base.ref == 'main')
70+
run: |
71+
echo "=== Logs from failed pods ==="
72+
for pod in $(kubectl get pods -A -o json | jq -r '.items[] | select(.status.containerStatuses[]?.ready == false) | "\(.metadata.namespace)/\(.metadata.name)"'); do
73+
echo -e "\n--- Logs for $pod ---"
74+
kubectl logs -n ${pod%/*} ${pod#*/} --all-containers=true --tail=100 2>&1 || true
75+
done

.github/workflows/set-appVersion.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Updste LibreNMS appVersion
1+
name: Update LibreNMS appVersion
22
on:
33
push:
44
branches:
55
- renovate/*
66

77
jobs:
8-
set-appverions:
8+
set-appversion:
99
runs-on: ubuntu-24.04
1010

1111
permissions:

charts/librenms/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: librenms
33
description: LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system.
44
type: application
5-
version: 6.0.1
5+
version: 6.1.0
66
appVersion: "25.11.0"
77
maintainers:
88
- name: jacobw

charts/librenms/README.gotmpl

Lines changed: 45 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
# LibreNMS
1+
{{ template "chart.header" . }}
22
{{ template "chart.badgesSection" . }}
33

4+
{{ template "chart.description" . }}
5+
46
## TL;DR
57

68
```shell
79
$ helm repo add librenms https://www.librenms.org/helm-charts
8-
$ helm install my-release librenms/librenms --set appkey=<LibreNMS Application key>
10+
$ helm install my-release librenms/librenms
911
```
1012

1113
## Prerequisites
@@ -19,31 +21,58 @@ To install the chart with the release name `my-release` and default configuratio
1921

2022
```shell
2123
$ helm repo add librenms https://www.librenms.org/helm-charts
22-
$ helm install my-release librenms/librenms --set appkey=<LibreNMS Application key>
24+
$ helm install my-release librenms/librenms
2325
```
2426

25-
## Values
26-
Check the [values.yaml](./values.yaml) file for the available settings for this chart and its
27-
dependencies.
27+
LibreNMS automatically generates a secure Laravel APP_KEY on first run and stores it in the persistent `/data` volume.
2828

29-
### Required values:
30-
```
29+
## Persistence
30+
31+
By default, the frontend uses a PersistentVolumeClaim to store the `/data` directory, which contains:
32+
- Application configuration (including the auto-generated APP_KEY in `/data/.env`)
33+
- RRD database files
34+
- Logs
35+
- Custom plugins
36+
37+
To disable persistence (not recommended for production):
38+
39+
```yaml
3140
librenms:
32-
appkey:
41+
frontend:
42+
persistence:
43+
enabled: false
3344
```
3445

35-
This should be filled with a laravel appkey, this can be generated using the laravel artisan command:
36-
```
37-
php artisan key:generate
38-
```
39-
The value should look like:
46+
To customize the storage class or size:
47+
48+
```yaml
49+
librenms:
50+
frontend:
51+
persistence:
52+
storageClassName: "fast-ssd"
53+
size: 5Gi
4054
```
55+
56+
## Values
57+
Check the [values.yaml](./values.yaml) file for the available settings for this chart and its dependencies.
58+
59+
### Optional: Custom APP_KEY
60+
61+
By default, LibreNMS auto-generates the APP_KEY on first container startup. To manually set an APP_KEY (e.g., for migration from another instance):
62+
63+
```yaml
4164
librenms:
42-
appkey: base64:RTMmh+i10E2RMcDxookMu47BTzJQy87hOU+k/zcuPnA=
65+
appkey: base64:YOUR_BASE64_ENCODED_32_BYTES
66+
```
67+
68+
Generate a custom APP_KEY using Laravel's artisan command:
69+
```bash
70+
php artisan key:generate --show
4371
```
72+
4473
### Recommendations
4574

46-
* `librenms.poller.replicas`: Depending on the scale of your installation, the amount of poller pods needs to b scaled up. Use the poller page in the LibreNMS interface to check for scaling issues.
75+
* `librenms.poller.replicas`: Depending on the scale of your installation, the amount of poller pods needs to be scaled up. Use the poller page in the LibreNMS interface to check for scaling issues.
4776

4877
### Available values
4978

charts/librenms/README.md

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
# LibreNMS
2-
![Version: 5.2.0](https://img.shields.io/badge/Version-5.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 25.11.0](https://img.shields.io/badge/AppVersion-25.11.0-informational?style=flat-square)
1+
# librenms
2+
3+
![Version: 6.0.0](https://img.shields.io/badge/Version-6.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 25.11.0](https://img.shields.io/badge/AppVersion-25.11.0-informational?style=flat-square)
4+
5+
LibreNMS is an autodiscovering PHP/MySQL-based network monitoring system.
36

47
## TL;DR
58

69
```shell
710
$ helm repo add librenms https://www.librenms.org/helm-charts
8-
$ helm install my-release librenms/librenms --set appkey=<LibreNMS Application key>
11+
$ helm install my-release librenms/librenms
912
```
1013

1114
## Prerequisites
@@ -19,35 +22,62 @@ To install the chart with the release name `my-release` and default configuratio
1922

2023
```shell
2124
$ helm repo add librenms https://www.librenms.org/helm-charts
22-
$ helm install my-release librenms/librenms --set appkey=<LibreNMS Application key>
25+
$ helm install my-release librenms/librenms
2326
```
2427

25-
## Values
26-
Check the [values.yaml](./values.yaml) file for the available settings for this chart and its
27-
dependencies.
28+
LibreNMS automatically generates a secure Laravel APP_KEY on first run and stores it in the persistent `/data` volume.
2829

29-
### Required values:
30-
```
30+
## Persistence
31+
32+
By default, the frontend uses a PersistentVolumeClaim to store the `/data` directory, which contains:
33+
- Application configuration (including the auto-generated APP_KEY in `/data/.env`)
34+
- RRD database files
35+
- Logs
36+
- Custom plugins
37+
38+
To disable persistence (not recommended for production):
39+
40+
```yaml
3141
librenms:
32-
appkey:
42+
frontend:
43+
persistence:
44+
enabled: false
3345
```
3446
35-
This should be filled with a laravel appkey, this can be generated using the laravel artisan command:
36-
```
37-
php artisan key:generate
38-
```
39-
The value should look like:
47+
To customize the storage class or size:
48+
49+
```yaml
50+
librenms:
51+
frontend:
52+
persistence:
53+
storageClassName: "fast-ssd"
54+
size: 5Gi
4055
```
56+
57+
## Values
58+
Check the [values.yaml](./values.yaml) file for the available settings for this chart and its dependencies.
59+
60+
### Optional: Custom APP_KEY
61+
62+
By default, LibreNMS auto-generates the APP_KEY on first container startup. To manually set an APP_KEY (e.g., for migration from another instance):
63+
64+
```yaml
4165
librenms:
42-
appkey: base64:RTMmh+i10E2RMcDxookMu47BTzJQy87hOU+k/zcuPnA=
66+
appkey: base64:YOUR_BASE64_ENCODED_32_BYTES
67+
```
68+
69+
Generate a custom APP_KEY using Laravel's artisan command:
70+
```bash
71+
php artisan key:generate --show
4372
```
73+
4474
### Recommendations
4575

46-
* `librenms.poller.replicas`: Depending on the scale of your installation, the amount of poller pods needs to b scaled up. Use the poller page in the LibreNMS interface to check for scaling issues.
76+
* `librenms.poller.replicas`: Depending on the scale of your installation, the amount of poller pods needs to be scaled up. Use the poller page in the LibreNMS interface to check for scaling issues.
4777

4878
### Available values
4979

50-
The following table lists the main configurable parameters of the librenms chart v5.2.0 and their default values. Please, refer to [values.yaml](./values.yaml) for the full list of configurable parameters.
80+
The following table lists the main configurable parameters of the librenms chart v6.0.0 and their default values. Please, refer to [values.yaml](./values.yaml) for the full list of configurable parameters.
5181

5282
## Values
5383

@@ -59,16 +89,20 @@ The following table lists the main configurable parameters of the librenms chart
5989
| ingress.className | string | `""` | Ingress class name |
6090
| ingress.enabled | bool | `false` | Enable or disable ingress |
6191
| ingress.hosts | list | `[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}]` | Ingress ingress rules |
62-
| librenms.appkey | string | `nil` | Laravel appkey used by LibreNMS, this should be generated by you and is a required setting. See the README for more information |
92+
| librenms.appkey | string | `nil` | Laravel APP_KEY is automatically generated by LibreNMS on first run and stored in /data/.env. It persists across pod restarts via the /data volume. Only set this if you need to use a specific key (e.g., for migration from another instance). Format: base64:BASE64_ENCODED_32_BYTES (generate with: php artisan key:generate --show) |
6393
| librenms.configuration | string | `"$config['distributed_poller_group'] = '0';\n$config['distributed_poller'] = true;\n"` | Custom configuration options for LibreNMS. For more information on options in this file check the following link: https://docs.librenms.org/Support/Configuration/ |
64-
| librenms.existingSecret | bool | `false` | Existing secret name to use for appkey Must have the key 'appkey' as above |
94+
| librenms.existingSecret | bool | `false` | If you need to provide a custom APP_KEY, create a secret with an 'appkey' key and specify the secret name here. Leave empty (false) to let LibreNMS auto-generate. The secret will be mounted and injected into /data/.env by the LibreNMS container. |
6595
| librenms.extraEnvFrom | list | `[]` | Extra envFrom sources applied to all LibreNMS components |
6696
| librenms.extraEnvs | list | `[]` | Extra environment variables applied to all LibreNMS components |
6797
| librenms.frontend.extraEnvFrom | list | `[]` | Extra envFrom sources for frontend containers |
6898
| librenms.frontend.extraEnvs | list | `[]` | Extra environment variables for frontend containers |
6999
| librenms.frontend.extraVolumeMounts | list | `[]` | Extra volume mounts for frontend containers |
70100
| librenms.frontend.extraVolumes | list | `[]` | Extra volumes for frontend pods |
71101
| librenms.frontend.nodeSelector | object | `{}` | nodeSelector for frontend pods |
102+
| librenms.frontend.persistence | object | `{"enabled":true,"size":"1Gi","storageClassName":""}` | Persistent storage for frontend /data directory (required for APP_KEY persistence) |
103+
| librenms.frontend.persistence.enabled | bool | `true` | Enable persistent volume for frontend |
104+
| librenms.frontend.persistence.size | string | `"1Gi"` | Size of the frontend persistent volume |
105+
| librenms.frontend.persistence.storageClassName | string | `""` | Storage class name for frontend PVC |
72106
| librenms.frontend.privileged | bool | `false` | |
73107
| librenms.frontend.readinessProbe.httpGet.path | string | `"/login"` | Check endpoint path |
74108
| librenms.frontend.readinessProbe.httpGet.port | int | `8000` | Check endpoint port |
@@ -133,7 +167,7 @@ $ helm delete my-release
133167
| Repository | Name | Version |
134168
|------------|------|---------|
135169
| https://charts.bitnami.com/bitnami | mysql | ~14.0.0 |
136-
| https://charts.bitnami.com/bitnami | redis | 21.2.14 |
170+
| https://charts.bitnami.com/bitnami | redis | 24.0.0 |
137171

138172
## Maintainers
139173

charts/librenms/ci/test-values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
librenms:
2-
appkey: base64:RTMmh+i10E2RMcDxookMu47BTzJQy87hOU+k/zcuPnA=
32
extraEnvs:
43
- name: GLOBAL_DEBUG
54
value: "true"

charts/librenms/files/init.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/sh
2+
# Generate stable NODE_ID from hostname for distributed polling
23
TARGET="/data/env-volume/env"
3-
echo "Target: $TARGET"
4-
echo "APP_KEY=$(cat /data/key/appkey)" > $TARGET
5-
echo "NODE_ID=$(hostname)" >> $TARGET
6-
4+
echo "Generating NODE_ID from hostname: $(hostname)"
5+
echo "NODE_ID=$(hostname)" > $TARGET
76
cat $TARGET

charts/librenms/templates/_helpers.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Create the name of the secret to use
7171
{{- define "librenms.secretName" -}}
7272
{{- if .Values.librenms.existingSecret -}}
7373
{{- .Values.librenms.existingSecret -}}
74-
{{- else -}}
75-
{{- .Release.Name -}}
74+
{{- else if .Values.librenms.appkey -}}
75+
{{- .Release.Name -}}-appkey
7676
{{- end -}}
7777
{{- end -}}

charts/librenms/templates/librenms-cron.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ spec:
1616
nodeSelector:
1717
{{- toYaml . | nindent 12 }}
1818
{{- end }}
19+
{{- with .Values.librenms.snmp_scanner.securityContext }}
20+
securityContext:
21+
{{- toYaml . | nindent 12 }}
22+
{{- end }}
1923
volumes:
2024
- name: files
2125
configMap:

charts/librenms/templates/librenms-deployment.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,31 +26,17 @@ spec:
2626
{{- toYaml . | nindent 8 }}
2727
{{- end }}
2828
volumes:
29-
- name: env-volume
30-
emptyDir: {}
31-
- name: key
32-
secret:
33-
secretName: {{ include "librenms.secretName" . }}
3429
- name: files
3530
configMap:
3631
name: {{ .Release.Name }}-files
32+
{{- if .Values.librenms.frontend.persistence.enabled }}
33+
- name: data
34+
persistentVolumeClaim:
35+
claimName: {{ .Release.Name }}-frontend-data
36+
{{- end }}
3737
{{- with .Values.librenms.frontend.extraVolumes }}
3838
{{- toYaml . | nindent 6 }}
3939
{{- end }}
40-
initContainers:
41-
- name: init
42-
image: '{{ .Values.librenms.initContainer.image.repository }}:{{ .Values.librenms.initContainer.image.tag }}'
43-
command: ["/bin/sh","/data/files/init.sh"]
44-
{{- if .Values.librenms.initContainer.resources }}
45-
resources: {{ toYaml .Values.librenms.initContainer.resources | nindent 12 }}
46-
{{- end }}
47-
volumeMounts:
48-
- name: env-volume
49-
mountPath: /data/env-volume
50-
- name: key
51-
mountPath: /data/key
52-
- name: files
53-
mountPath: /data/files
5440
containers:
5541
- name: librenms
5642
image: '{{ .Values.librenms.image.repository }}:{{ .Values.librenms.image.tag }}'
@@ -74,22 +60,30 @@ spec:
7460
secretKeyRef:
7561
name: {{ .Release.Name }}-mysql
7662
key: mysql-password
63+
{{- if or .Values.librenms.appkey .Values.librenms.existingSecret }}
64+
- name: APP_KEY
65+
valueFrom:
66+
secretKeyRef:
67+
name: {{ include "librenms.secretName" . }}
68+
key: appkey
69+
{{- end }}
7770
{{- with .Values.librenms.extraEnvs }}
7871
{{- toYaml . | nindent 8 }}
7972
{{- end }}
8073
{{- with .Values.librenms.frontend.extraEnvs }}
8174
{{- toYaml . | nindent 8 }}
8275
{{- end }}
8376
volumeMounts:
77+
{{- if .Values.librenms.frontend.persistence.enabled }}
78+
- name: data
79+
mountPath: /data
80+
{{- end }}
8481
- name: files
8582
mountPath: /data/files
8683
- name: files
8784
mountPath: /data/config/custom.php
8885
subPath: custom.php
8986
readOnly: true
90-
- name: env-volume
91-
mountPath: /data/.env
92-
subPath: env
9387
{{- with .Values.librenms.frontend.extraVolumeMounts }}
9488
{{- toYaml . | nindent 8 }}
9589
{{- end }}

0 commit comments

Comments
 (0)