Skip to content

Commit

Permalink
Merge pull request #81 from PrivateBin/feat/additional-mounts
Browse files Browse the repository at this point in the history
feat: add extra volumes mount
  • Loading branch information
elrido authored Jan 15, 2023
2 parents 21a13ae + af47ea5 commit a3ae8f1
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ See values.yaml for full documentation
| `configs` | Optional Privatebin configuration file | `{}` |
| `podAnnotations` | Additional annotations to add to the pods | `{}` |
| `additionalLabels` | Additional labels to add to resources | `{}` |
| `extraVolumes` | Additional volumes to add to the pods | `[]` |
| `extraVolumeMounts` | Additional volume mounts to add to the pods | `[]` |


## Upgrades

Expand Down
2 changes: 1 addition & 1 deletion charts/privatebin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: privatebin
home: https://privatebin.info/
icon: https://raw.githubusercontent.com/PrivateBin/assets/master/images/preview/icon.png
type: application
version: 0.16.0
version: 0.17.0
maintainers:
- name: bdashrad
email: [email protected]
Expand Down
13 changes: 13 additions & 0 deletions charts/privatebin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,16 @@ Return the appropriate apiVersion for podsecuritypolicy.
{{- print "policy/v1beta1" -}}
{{- end -}}
{{- end -}}

{{/*
Renders a value that contains template.
Usage:
{{ include "privatebin.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $) }}
*/}}
{{- define "privatebin.tplvalues.render" -}}
{{- if typeIs "string" .value }}
{{- tpl .value .context }}
{{- else }}
{{- tpl (.value | toYaml) .context }}
{{- end }}
{{- end -}}
6 changes: 6 additions & 0 deletions charts/privatebin/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ spec:
mountPath: /tmp
- name: nginx-cache
mountPath: /var/lib/nginx/tmp
{{- if .Values.extraVolumeMounts }}
{{- include "privatebin.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down Expand Up @@ -107,4 +110,7 @@ spec:
medium: "Memory"
- name: nginx-cache
emptyDir: {}
{{- if .Values.extraVolumes }}
{{- include "privatebin.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/privatebin/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ spec:
mountPath: /tmp
- name: nginx-cache
mountPath: /var/lib/nginx/tmp
{{- if .Values.extraVolumeMounts }}
{{- include "privatebin.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -102,6 +105,9 @@ spec:
medium: "Memory"
- name: nginx-cache
emptyDir: {}
{{- if .Values.extraVolumes }}
{{- include "privatebin.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | nindent 8 }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: storage
Expand Down
14 changes: 14 additions & 0 deletions charts/privatebin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ securityContext:
fsGroup: 82
readOnlyRootFilesystem: true

extraVolumes: []
# Optionally specify extra list of additional volumes for PrivateBin pod.
# Example
# - name: nginx-params
# configMap:
# name: nginx-params

extraVolumeMounts: []
# Optionally specify extra list of additional volumeMounts for PrivateBin pod.
# Example
# - mountPath: /etc/nginx/server.d
# name: nginx-params


ingress:
enabled: false
annotations: {}
Expand Down

0 comments on commit a3ae8f1

Please sign in to comment.