Skip to content

Commit

Permalink
Add environment variables to OPA container
Browse files Browse the repository at this point in the history
Signed-off-by: zawada1 <[email protected]>
  • Loading branch information
atzawada authored and eshepelyuk committed Nov 9, 2021
1 parent ad4b61e commit c79740e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/opa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Reference](https://www.openpolicyagent.org/docs/configuration.html).
| `opa` | OPA configuration. | See [values.yaml](values.yaml) |
| `mgmt` | kube-mgmt configuration. | See [values.yaml](values.yaml) |
| `mgmt.port` | kube-mgmt/prometheus port used to communicate with opa. | See [values.yaml](values.yaml) |
| `mgmt.extraEnv` | Additional environment variables to be added to the kube-mgmt container | `[]` |
| `sar.resources` | CPU and memory limits for the sar container. | `{}` |
| `priorityClassName` | The name of the priorityClass for the pods. | Unset |
| `prometheus.enabled` | Flag to expose the `/metrics` endpoint to be scraped. | `false` |
Expand All @@ -100,6 +101,7 @@ Reference](https://www.openpolicyagent.org/docs/configuration.html).
| `securityContext` | Security context for the containers | `{enabled: false, runAsNonRoot: true, runAsUser: 1}` |
| `deploymentStrategy` | Specify deployment spec rollout strategy | `{}` |
| `extraArgs` | Additional arguments to be added to the opa container | `[]` |
| `extraEnv` | Additional environment variables to be added to the opa container | `[]` |
| `extraContainers` | Additional containers to be added to the deployment | `[]` |
| `extraVolumes` | Additional volumes to be added to the deployment | `[]` |
| `extraPorts` | Additional ports to OPA service. Useful to expose `extraContainer` ports. | `[]` |
8 changes: 8 additions & 0 deletions charts/opa/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ spec:
{{- end }}
image: {{ .Values.image }}:{{ .Values.imageTag }}
imagePullPolicy: {{ .Values.imagePullPolicy }}
env:
{{- if .Values.extraEnv }}
{{ toYaml .Values.extraEnv | indent 12 }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
args:
Expand Down Expand Up @@ -153,6 +157,10 @@ spec:
- name: mgmt
image: {{ .Values.mgmt.image }}:{{ coalesce .Values.mgmt.imageTag .Chart.AppVersion }}
imagePullPolicy: {{ .Values.mgmt.imagePullPolicy }}
env:
{{- if .Values.mgmt.extraEnv }}
{{ toYaml .Values.mgmt.extraEnv | indent 12 }}
{{- end }}
resources:
{{ toYaml .Values.mgmt.resources | indent 12 }}
args:
Expand Down
4 changes: 4 additions & 0 deletions charts/opa/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ port: 443

extraArgs: []

# Extra environment variables to be loaded into the OPA container
extraEnv: []

mgmt:
enabled: false
image: openpolicyagent/kube-mgmt
Expand All @@ -133,6 +136,7 @@ mgmt:
# NOTE insecure http port conjointly used for mgmt access and prometheus metrics export
port: 8181
extraArgs: []
extraEnv: []
resources: {}
data:
enabled: false
Expand Down

0 comments on commit c79740e

Please sign in to comment.