Skip to content

Commit

Permalink
chore: add support for hostNetwork and dnsPolicy in chart (cloudn…
Browse files Browse the repository at this point in the history
…ative-pg#324)

In some Kubernetes clusters the default values for `dnsPolicy` and `hostNetwork`
is not set for the needs of the cluster or in some cases it just need to be changed,
this patch allows to set the `dnsPolicy` and the `hostNetwork` values for the operator
deployments to fit the cluster requirement.

Closes cloudnative-pg#177 

Signed-off-by: Marc Khair <[email protected]>
  • Loading branch information
marckhair authored Jul 30, 2024
1 parent c165c5c commit b134c4e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions charts/cloudnative-pg/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.hostNetwork }}
hostNetwork: {{ .Values.hostNetwork }}
{{- end }}
{{- if .Values.dnsPolicy }}
dnsPolicy: {{ .Values.dnsPolicy }}
{{- end }}
containers:
- args:
- controller
Expand Down
6 changes: 6 additions & 0 deletions charts/cloudnative-pg/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
"imagePullSecrets": {
"type": "array"
},
"hostNetwork": {
"type": "boolean"
},
"dnsPolicy": {
"type": "string"
},
"monitoring": {
"type": "object",
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions charts/cloudnative-pg/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

hostNetwork: false
dnsPolicy: ""

crds:
# -- Specifies whether the CRDs should be created when installing the chart.
create: true
Expand Down

0 comments on commit b134c4e

Please sign in to comment.