Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[helm] Make dns policy configurable #138

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/opa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Reference](https://www.openpolicyagent.org/docs/configuration.html).
| `podDisruptionBudget.minAvailable` | Sets the minimum number of pods to be available. Cannot be set at the same time as maxUnavailable. | `1` |
| `podDisruptionBudget.maxUnavailable` | Sets the maximum number of pods to be unavailable. Cannot be set at the same time as minAvailable. | Unset |
| `hostNetwork.enabled` | Use hostNetwork setting on OPA pod | `false` |
| `dnsPolicyOverride` | DNS policy to use on OPA pod | `` |
| `image.repository` | OPA image to deploy. | `openpolicyagent/opa` |
| `image.tag` | OPA image tag to deploy. | See [values.yaml](values.yaml) |
| `port` | Port in the pod to which OPA will bind itself. | `443` |
Expand Down
8 changes: 8 additions & 0 deletions charts/opa/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,11 @@ admissionregistration.k8s.io/v1beta1
{{- $tag := .Values.mgmt.image.tag | default .Chart.AppVersion -}}
{{ printf "%s:%s" .Values.mgmt.image.repository $tag }}
{{- end -}}

{{- define "opa.dnsPolicy" -}}
{{- if .Values.dnsPolicyOverride -}}
dnsPolicy: "{{ .Values.dnsPolicyOverride }}"
{{ else if .Values.hostNetwork.enabled -}}
dnsPolicy: "ClusterFirstWithHostNet"
{{ end -}}
{{ end -}}
1 change: 1 addition & 0 deletions charts/opa/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ spec:
{{- if .Values.hostNetwork.enabled }}
hostNetwork: true
{{- end }}
{{- include "opa.dnsPolicy" . | nindent 6 -}}
containers:
- name: opa
ports:
Expand Down