Skip to content

Commit

Permalink
Add persistent volume for future audit log (#36)
Browse files Browse the repository at this point in the history
Add the creating and mounting of a persistent valume at /var/log/audit
for the future audit logs to be written to using a default install
  • Loading branch information
coreydaley committed Jul 19, 2024
1 parent 975b738 commit 42ccce3
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/backstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.16.7
version: 2.16.8
2 changes: 1 addition & 1 deletion charts/backstage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# RHDH Backstage Helm Chart for OpenShift

[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/rhdh-chart&style=flat-square)](https://artifacthub.io/packages/search?repo=rhdh-chart)
![Version: 2.16.7](https://img.shields.io/badge/Version-2.16.7-informational?style=flat-square)
![Version: 2.16.8](https://img.shields.io/badge/Version-2.16.8-informational?style=flat-square)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A Helm chart for deploying Red Hat Developer Hub.
Expand Down
10 changes: 10 additions & 0 deletions charts/backstage/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ printf "%s-audit-log" .Release.Name }}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
10 changes: 10 additions & 0 deletions charts/backstage/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2530,6 +2530,10 @@
{
"mountPath": "/opt/app-root/src/dynamic-plugins-root",
"name": "dynamic-plugins-root"
},
{
"mountPath": "/var/log/audit",
"name": "audit-log-data"
}
],
"items": {
Expand Down Expand Up @@ -2588,6 +2592,12 @@
},
"name": "dynamic-plugins-root"
},
{
"name": "audit-log-data",
"persistentVolumeClaim": {
"claimName": "{{ printf \"%s-audit-log\" .Release.Name }}"
}
},
{
"configMap": {
"defaultMode": 420,
Expand Down
8 changes: 6 additions & 2 deletions charts/backstage/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ upstream:
secretKeyRef:
key: postgres-password
name: '{{- include "janus-idp.postgresql.secretName" . }}'

args:
# This additional `app-config`` file is generated by the initContainer below, and contains the merged configuration of installed dynamic plugins.
- '--config'
Expand All @@ -119,6 +118,9 @@ upstream:
# The initContainer below will install dynamic plugins in this volume mount.
- name: dynamic-plugins-root
mountPath: /opt/app-root/src/dynamic-plugins-root
# Audit Log data will be stored in this volume mount.
- name: audit-log-data
mountPath: /var/log/audit
extraVolumes:
# -- Ephemeral volume that will contain the dynamic plugins installed by the initContainer below at start.
- name: dynamic-plugins-root
Expand All @@ -131,7 +133,9 @@ upstream:
requests:
# -- Size of the volume that will contain the dynamic plugins. It should be large enough to contain all the plugins.
storage: 2Gi

- name: audit-log-data
persistentVolumeClaim:
claimName: '{{ printf "%s-audit-log" .Release.Name }}'
# Volume that will expose the `dynamic-plugins.yaml` file from the `dynamic-plugins` config map.
# The `dynamic-plugins` config map is created by the helm chart from the content of the `global.dynamic` field.
- name: dynamic-plugins
Expand Down

0 comments on commit 42ccce3

Please sign in to comment.