diff --git a/helm/robusta/templates/runner.yaml b/helm/robusta/templates/runner.yaml index b83df3c07..ea6e659b7 100644 --- a/helm/robusta/templates/runner.yaml +++ b/helm/robusta/templates/runner.yaml @@ -42,6 +42,32 @@ spec: securityContext: {{- toYaml . | nindent 8 }} {{- end }} + {{- if .Values.runner.dnsConfig.enabled }} + {{- $policy := .Values.runner.dnsConfig.policy }} + {{- $hasConfig := or .Values.runner.dnsConfig.nameservers .Values.runner.dnsConfig.searches .Values.runner.dnsConfig.options }} + + {{- if and (eq $policy "None") (not $hasConfig) }} + {{- fail "dnsConfig: when dnsPolicy is 'None', you must set at least one of nameservers, searches, or options" }} + {{- end }} + dnsPolicy: {{ $policy | quote }} + {{- if $hasConfig }} + dnsConfig: + {{- with .Values.runner.dnsConfig.nameservers }} + nameservers: + {{- toYaml . | nindent 10 }} + {{- end }} + {{- with .Values.runner.dnsConfig.searches }} + searches: + {{- toYaml . | nindent 10 }} + {{- end }} + {{- with .Values.runner.dnsConfig.options }} + options: + {{- toYaml . | nindent 10 }} + {{- end }} + {{- end }} + {{ else }} + dnsPolicy: ClusterFirst + {{- end }} {{- if .Values.runner.hardenedFs }} initContainers: - name: setup-venv diff --git a/helm/robusta/values.yaml b/helm/robusta/values.yaml index 880e3f97f..27379b999 100644 --- a/helm/robusta/values.yaml +++ b/helm/robusta/values.yaml @@ -756,6 +756,13 @@ runner: # Enable hardened filesystem security (read-only root filesystem with writable volume mounts) hardenedFs: false setKRRSecurityContext: false + #Enabled custom DNS configuration for runner + dnsConfig: + enabled: false + policy: ClusterFirst + nameservers: [] + searches: [] + options: [] # CRD permissions for common Kubernetes operators and tools crdPermissions: argo: true