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

feat: add dnsPolicy support to Deployment #366

Merged
merged 1 commit into from
Dec 31, 2024
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ helm delete --namespace test my-application
| deployment.image.digest | string | `""` | Image digest. If set to a non-empty value, digest takes precedence on the tag. |
| deployment.image.pullPolicy | string | `"IfNotPresent"` | Image pull policy. |
| deployment.dnsConfig | object | `nil` | DNS config for the pods. |
| deployment.dnsPolicy | string | `""` | DNS Policy. |
| deployment.startupProbe | object | See below | Startup probe. Must specify either one of the following field when enabled: httpGet, exec, tcpSocket, grpc |
| deployment.startupProbe.enabled | bool | `false` | Enable Startup probe. |
| deployment.startupProbe.failureThreshold | int | `30` | Number of retries before marking the pod as failed. |
Expand Down
7 changes: 7 additions & 0 deletions application/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ spec:
imagePullSecrets:
{{ toYaml . | indent 12 }}
{{ end }}
{{- if $job.dnsConfig }}
dnsConfig:
{{ toYaml $job.dnsConfig | indent 12 }}
{{- end }}
{{- if $job.dnsPolicy }}
dnsPolicy: {{ $job.dnsPolicy }}
{{- end }}
{{- with $job.volumes }}
volumes:
{{ toYaml . | indent 12 }}
Expand Down
3 changes: 3 additions & 0 deletions application/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,9 @@ spec:
dnsConfig:
{{ toYaml .Values.deployment.dnsConfig | indent 8 }}
{{- end }}
{{- if .Values.deployment.dnsPolicy }}
dnsPolicy: {{ .Values.deployment.dnsPolicy }}
{{- end }}
{{- if or (.Values.deployment.openshiftOAuthProxy.enabled) (.Values.deployment.volumes) (and (eq .Values.persistence.enabled true) (eq .Values.persistence.mountPVC true) )}}
volumes:
{{- if .Values.deployment.openshiftOAuthProxy.enabled }}
Expand Down
7 changes: 7 additions & 0 deletions application/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ spec:
imagePullSecrets:
{{ toYaml . | indent 8 }}
{{ end }}
{{- if $job.dnsConfig }}
dnsConfig:
{{ toYaml $job.dnsConfig | indent 8 }}
{{- end }}
{{- if $job.dnsPolicy }}
dnsPolicy: {{ $job.dnsPolicy }}
{{- end }}
{{- with $job.volumes }}
volumes:
{{ toYaml . | indent 8 }}
Expand Down
9 changes: 9 additions & 0 deletions application/values-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ deployment:
options:
- name: ndots
value: '1'
dnsPolicy: ClusterFirst
# By default deploymentStrategy is set to rollingUpdate with maxSurge of 25% and maxUnavailable of 25%
# You can change type to `Recreate` or can uncomment `rollingUpdate` specification and adjust them to your usage.
strategy:
Expand Down Expand Up @@ -1307,6 +1308,10 @@ cronJob:
requests:
memory: 5Gi
cpu: 1
dnsConfig:
options:
- name: ndots
value: '1'

# Take backup of application namespace
backup:
Expand Down Expand Up @@ -1352,3 +1357,7 @@ job:
requests:
memory: 5Gi
cpu: 1
dnsConfig:
options:
- name: ndots
value: '1'
13 changes: 13 additions & 0 deletions application/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ cronJob:
# requests:
# memory: 5Gi
# cpu: 1
# dnsConfig:
# options:
# - name: ndots
# value: '1'
# dnsPolicy: ClusterFirst


job:
Expand Down Expand Up @@ -71,6 +76,11 @@ job:
# requests:
# memory: 5Gi
# cpu: 1
# dnsConfig:
# options:
# - name: ndots
# value: '1'
# dnsPolicy: ClusterFirst

deployment:
# -- (bool) Enable Deployment.
Expand Down Expand Up @@ -251,6 +261,9 @@ deployment:
# options:
# - name: ndots
# value: '1'
# -- (string) DNS Policy.
# @section -- Deployment Parameters
dnsPolicy: ""
# -- (object) Startup probe.
# @default -- See below
tomjo marked this conversation as resolved.
Show resolved Hide resolved
# Must specify either one of the following field when enabled: httpGet, exec, tcpSocket, grpc
Expand Down
Loading