Skip to content

Commit

Permalink
fix: bbolt data directory permissions (#151)
Browse files Browse the repository at this point in the history
* create initContainer to set permissions for data directory if backend is bbolt

* create configMap with script to set permissions if backend is bbolt

* data dir permissions set to 0750

* bump chart minor version and generate docs
  • Loading branch information
algchoo authored Aug 26, 2024
1 parent 5fb6f28 commit 733963b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/bindplane/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: bindplane
description: BindPlane OP is an observability pipeline.
type: application
# The chart's version
version: 1.13.11
version: 1.13.12
# The BindPlane OP tagged release. If the user does not
# set the `image.tag` values option, this version is used.
appVersion: 1.69.0
Expand Down
4 changes: 3 additions & 1 deletion charts/bindplane/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# bindplane

![Version: 1.13.11](https://img.shields.io/badge/Version-1.13.11-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.69.0](https://img.shields.io/badge/AppVersion-1.69.0-informational?style=flat-square)
![Version: 1.13.12](https://img.shields.io/badge/Version-1.13.12-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.69.0](https://img.shields.io/badge/AppVersion-1.69.0-informational?style=flat-square)

BindPlane OP is an observability pipeline.

Expand Down Expand Up @@ -149,3 +149,5 @@ BindPlane OP is an observability pipeline.
| transform_agent.replicas | int | `1` | Number of replicas to use for the transform agent. |
| transform_agent.tag | string | `""` | Transform Agent Image tag to use. Defaults to latest. |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
19 changes: 18 additions & 1 deletion charts/bindplane/templates/bindplane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,22 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.backend.postgres.sslsecret.name }}
initContainers:
{{- if eq .Values.backend.type "bbolt" }}
- name: set-data-permissions
image: busybox
command:
- sh
- -c
- /bin/sh /set-data-permissions.sh
volumeMounts:
- name: data-permissions-init
mountPath: /set-data-permissions.sh
subPath: set-data-permissions.sh
- name: {{ include "bindplane.fullname" . }}-data
mountPath: /data
{{- end }}
{{- if .Values.backend.postgres.sslsecret.name }}
- name: postgres-tls
image: busybox
command:
Expand Down Expand Up @@ -584,6 +598,9 @@ spec:
secretName: {{ .Values.prometheus.tls.secret.name }}
{{- end }}
{{- end }}
- name: data-permissions-init
configMap:
name: data-permissions-init
{{- if .Values.backend.postgres.sslsecret.name }}
- name: postgres-tls-dir
emptyDir: {}
Expand Down
11 changes: 11 additions & 0 deletions charts/bindplane/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
{{- if eq .Values.backend.type "bbolt" }}
kind: ConfigMap
apiVersion: v1
metadata:
name: data-permissions-init
data:
set-data-permissions.sh: |
#!/bin/sh
chown -R 65534:65534 /data
chmod 0750 /data
{{ end }}
{{- if .Values.backend.postgres.sslsecret.name }}
kind: ConfigMap
apiVersion: v1
Expand Down

0 comments on commit 733963b

Please sign in to comment.