Skip to content

Commit

Permalink
worker volumes also need events volume support (#120)
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Mason <[email protected]>
  • Loading branch information
mikemrm authored Jun 20, 2023
1 parent 0172eb4 commit cddb64a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 6 deletions.
45 changes: 43 additions & 2 deletions chart/permissions-api/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{- .Values.config.server.port | default 8080 }}
{{- end }}

{{- define "permapi.volumes" }}
{{- define "permapi.server.volumes" }}
{{- if or .Values.config.spicedb.caSecretName .Values.config.spicedb.policyConfigMapName }}
{{- with .Values.config.spicedb.caSecretName }}
- name: spicedb-ca
Expand All @@ -21,7 +21,7 @@
{{- end }}
{{- end }}

{{- define "permapi.volumeMounts" }}
{{- define "permapi.server.volumeMounts" }}
{{- if or .Values.config.spicedb.caSecretName .Values.config.spicedb.policyConfigMapName }}
{{- if .Values.config.spicedb.caSecretName }}
- name: spicedb-ca
Expand All @@ -35,3 +35,44 @@
[]
{{- end }}
{{- end }}

{{- define "permapi.worker.volumes" }}
{{- if or .Values.config.spicedb.caSecretName .Values.config.spicedb.policyConfigMapName .Values.config.events.nats.credsSecretName }}
{{- with .Values.config.spicedb.caSecretName }}
- name: spicedb-ca
secret:
secretName: {{ . }}
{{- end }}
{{- with .Values.config.events.nats.credsSecretName }}
- name: nats-creds
secret:
secretName: {{ . }}
{{- end }}
{{- with .Values.config.spicedb.policyConfigMapName }}
- name: policy-file
configMap:
name: {{ . }}
{{- end }}
{{- else -}}
[]
{{- end }}
{{- end }}

{{- define "permapi.worker.volumeMounts" }}
{{- if or .Values.config.spicedb.caSecretName .Values.config.spicedb.policyConfigMapName .Values.config.events.nats.credsSecretName }}
{{- if .Values.config.spicedb.caSecretName }}
- name: spicedb-ca
mountPath: /etc/ssl/spicedb/
{{- end }}
{{- if .Values.config.events.nats.credsSecretName }}
- name: nats-creds
mountPath: /nats
{{- end }}
{{- if .Values.config.spicedb.policyConfigMapName }}
- name: policy-file
mountPath: /policy
{{- end }}
{{- else -}}
[]
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions chart/permissions-api/templates/deployment-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts: {{ include "permapi.volumeMounts" . | nindent 12 }}
volumeMounts: {{ include "permapi.server.volumeMounts" . | nindent 12 }}
{{- with .Values.deployment.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -138,4 +138,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes: {{ include "permapi.volumes" . | nindent 8 }}
volumes: {{ include "permapi.server.volumes" . | nindent 8 }}
4 changes: 2 additions & 2 deletions chart/permissions-api/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts: {{ include "permapi.volumeMounts" . | nindent 12 }}
volumeMounts: {{ include "permapi.worker.volumeMounts" . | nindent 12 }}
{{- with .Values.deployment.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand All @@ -160,4 +160,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes: {{ include "permapi.volumes" . | nindent 8 }}
volumes: {{ include "permapi.worker.volumes" . | nindent 8 }}

0 comments on commit cddb64a

Please sign in to comment.