Skip to content

Commit

Permalink
feat: added volume and volume mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswk committed Oct 22, 2024
1 parent 00dd51b commit 30d129a
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/unleash-proxy/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type: application
# 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: 0.8.9
version: 0.8.10

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
10 changes: 9 additions & 1 deletion charts/unleash-proxy/examples/addingExistingSecrets.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Adds environment variables
env:
env:
- name: LOG_LEVEL
value: info

Expand All @@ -21,3 +21,11 @@ proxy:
enabled: true
name: unleash-proxy-secret
key: clientKeys

volumes:
- name: secrets-store-inline
mountPath: "/mnt/secrets-store"
volumeMounts:
- name: secrets-store-inline
mountPath: "/mnt/secrets-store"
readOnly: true
13 changes: 12 additions & 1 deletion charts/unleash-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,15 @@ spec:
- mountPath: /mnt/secrets
name: mount-secrets
readOnly: true
{{ if .Values.volumeMounts }}
{{- toYaml .Values.volumeMounts | nindent 12 }}
{{- end }}
{{- else }}
{{ if .Values.volumeMounts }}
volumeMounts:
{{- toYaml .Values.volumeMounts | nindent 12 }}
{{- end }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.edge.enable }}
Expand Down Expand Up @@ -161,7 +169,7 @@ spec:
- mountPath: "/data/config"
name: edge-features
{{- end }}
{{- if or .Values.edge.enable .Values.mountSecretName }}
{{- if or .Values.edge.enable .Values.mountSecretName .Values.volumes }}
volumes:
{{- if .Values.mountSecretName }}
- name: mount-secrets
Expand All @@ -173,6 +181,9 @@ spec:
configMap:
name: edge-features
{{- end }}
{{- if .Values.volumes }}
{{- toYaml .Values.volumes | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
4 changes: 4 additions & 0 deletions charts/unleash-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,7 @@ podDisruptionBudget:
enabled: false
minAvailable:
maxUnavailable: 1

# Add additional volumes and mounts, for example to read other secrets.
volumes: []
volumeMounts: []
2 changes: 1 addition & 1 deletion charts/unleash/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: https://docs.getunleash.io/img/logo.svg

type: application

version: 5.3.1
version: 5.3.2

appVersion: "6.3.0"

Expand Down
14 changes: 13 additions & 1 deletion charts/unleash/examples/existingSecrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,16 @@ existingSecrets:
valueFrom:
secretKeyRef:
name: secretname
key: secretkey
key: secretkey

volumeMounts:
- name: secrets-store-inline
mountPath: "/mnt/secrets-store"
readOnly: true

volumes:
- name: secrets-store-inline
mountPath: "/mnt/secrets-store"

postgres:
enabled: false
14 changes: 10 additions & 4 deletions charts/unleash/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,16 @@ spec:
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- if .Values.configMaps }}
{{- if or .Values.configMaps .Values.volumeMounts }}
volumeMounts:
{{- range $key, $value := .Values.configMaps }}
- name: config-dir
mountPath: {{ .mountPath }}
subPath: {{ $key }}
{{- end }}
{{- if .Values.volumeMounts }}
{{- toYaml .Values.volumeMounts | nindent 12 }}
{{- end }}
{{- end }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
Expand All @@ -162,11 +165,14 @@ spec:
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.configMaps }}
{{- if or .Values.configMaps .Values.volumes }}
volumes:
- name: config-dir
configMap:
name: {{ include "unleash.fullname" . }}
{{- if .Values.volumes }}
{{- toYaml .Values.volumes | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand All @@ -175,13 +181,13 @@ spec:
{{- with .Values.affinity }}
affinity:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.topologySpreadConstraints }}
topologySpreadConstraints:
topologySpreadConstraints:
{{- range . }}
- {{ toYaml . | nindent 8 | trim }}
labelSelector:
Expand Down
7 changes: 6 additions & 1 deletion charts/unleash/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ podDisruptionBudget:
minAvailable:
maxUnavailable: 1

topologySpreadConstraints: {}
topologySpreadConstraints:
{}
# - maxSkew: 1
# topologyKey: topology.kubernetes.io/zone
# whenUnsatisfiable: DoNotSchedule

# Add additional volumes and mounts, for example to read other secrets.
volumes: []
volumeMounts: []

0 comments on commit 30d129a

Please sign in to comment.