Skip to content

Commit

Permalink
Merge pull request #25 from oskar-christensson/oskar-christensson/add…
Browse files Browse the repository at this point in the history
…-opa-startup-data-support

add support for mounting in files for opa startup data  cli argument
  • Loading branch information
RazcoDev authored Mar 1, 2023
2 parents 2dc94c6 + 00aa7a5 commit 9302a2c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
12 changes: 12 additions & 0 deletions templates/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ data:
rbac.rego: |
{{- .Files.Get "test/e2e/rbac.rego" | nindent 4 }}
{{- end }}
---
{{- if .Values.client.opaStartupData }}
apiVersion: v1
kind: ConfigMap
metadata:
name: opa-startup-data
data:
{{- range $name, $value := .Values.client.opaStartupData }}
{{ $name }}: |
{{ $value | nindent 4 }}
{{- end }}
{{- end }}
13 changes: 13 additions & 0 deletions templates/deployment-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.client.opaStartupData }}
volumes:
- name: opa-startup-data
configMap:
name: opa-startup-data
defaultMode: 0444
{{- end }}
containers:
- name: opal-client
image: {{ printf "%s/permitio/opal-client:%s" .Values.imageRegistry .Chart.AppVersion | quote }}
Expand All @@ -44,6 +51,12 @@ spec:
value: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .Values.client.opaStartupData }}
volumeMounts:
- mountPath: /opt/opa/startup-data
name: opa-startup-data
readOnly: true
{{- end }}
readinessProbe:
httpGet:
path: /healthcheck
Expand Down
3 changes: 3 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
},
"extraEnv": {
"type": "object", "title": "extra environment variables list", "default": null
},
"opaStartupData": {
"type": "object", "title": "client startup data for embedded opa", "default": null
}
}
}
Expand Down

0 comments on commit 9302a2c

Please sign in to comment.