From 73f554523d34541ed55f6ca7b7e3e6c206751aa6 Mon Sep 17 00:00:00 2001 From: Ani Argjiri Date: Fri, 19 Jul 2024 16:58:20 +0200 Subject: [PATCH] fix: update dns ttl for linode dns provider (#1654) Co-authored-by: Sander Rodenhuis --- charts/team-ns/templates/_ingress.tpl | 4 ++++ charts/team-ns/templates/ingress/harbor-public.yaml | 4 ++++ helmfile.d/helmfile-15.ingress-core.yaml | 1 + helmfile.d/helmfile-60.teams.yaml | 1 + values/oauth2-proxy/oauth2-proxy-raw.gotmpl | 4 ++++ 5 files changed, 14 insertions(+) diff --git a/charts/team-ns/templates/_ingress.tpl b/charts/team-ns/templates/_ingress.tpl index 1b5dc955b3..1effe9afee 100644 --- a/charts/team-ns/templates/_ingress.tpl +++ b/charts/team-ns/templates/_ingress.tpl @@ -57,6 +57,10 @@ kind: Ingress metadata: annotations: externaldns: "true" + {{- if and $v.dns.provider (and $v.dns.provider.linode) }} + # Check Linode Api documentation for allowed values in seconds: https://developers-linode.netlify.app/api/v4/domains + external-dns.alpha.kubernetes.io/ttl: "1h" + {{- end }} {{- if $hasTlsPass }} nginx.ingress.kubernetes.io/ssl-passthrough: "true" {{- else }} diff --git a/charts/team-ns/templates/ingress/harbor-public.yaml b/charts/team-ns/templates/ingress/harbor-public.yaml index 5e984563c4..7ff95e7e8a 100644 --- a/charts/team-ns/templates/ingress/harbor-public.yaml +++ b/charts/team-ns/templates/ingress/harbor-public.yaml @@ -12,6 +12,10 @@ kind: Ingress metadata: annotations: externaldns: "true" + {{- if and $v.dns.provider (and $v.dns.provider.linode) }} + # Check Linode Api documentation for allowed values in seconds: https://developers-linode.netlify.app/api/v4/domains + external-dns.alpha.kubernetes.io/ttl: "1h" + {{- end }} nginx.ingress.kubernetes.io/proxy-buffering: "off" nginx.ingress.kubernetes.io/proxy-request-buffering: "off" nginx.ingress.kubernetes.io/enable-modsecurity: "false" diff --git a/helmfile.d/helmfile-15.ingress-core.yaml b/helmfile.d/helmfile-15.ingress-core.yaml index dad78351cd..65c3db6a3f 100644 --- a/helmfile.d/helmfile-15.ingress-core.yaml +++ b/helmfile.d/helmfile-15.ingress-core.yaml @@ -58,3 +58,4 @@ releases: builds: {{- $tca | get "builds" list | toYaml | nindent 10 }} policies: {{- $tca | get "policies" list | toYaml | nindent 10 }} sealedsecrets: {{- $tca | get "sealedsecrets" list | toYaml | nindent 10 }} + dns: {{- $v.dns | toYaml | nindent 10 }} diff --git a/helmfile.d/helmfile-60.teams.yaml b/helmfile.d/helmfile-60.teams.yaml index dba8b067cf..333600f32b 100644 --- a/helmfile.d/helmfile-60.teams.yaml +++ b/helmfile.d/helmfile-60.teams.yaml @@ -244,6 +244,7 @@ releases: oidc: {{- $v | get "oidc" dict | toYaml | nindent 10 }} domain: {{ $domain }} ingress: {{- $v.ingress | toYaml | nindent 10 }} + dns: {{- $v.dns | toYaml | nindent 10 }} - {{- omit $team "apps" | toYaml | nindent 8 }} teamId: {{ $teamId }} teamIds: {{- toYaml (keys $v.teamConfig) | nindent 10 }} diff --git a/values/oauth2-proxy/oauth2-proxy-raw.gotmpl b/values/oauth2-proxy/oauth2-proxy-raw.gotmpl index b6e87bad61..c72c9d9726 100644 --- a/values/oauth2-proxy/oauth2-proxy-raw.gotmpl +++ b/values/oauth2-proxy/oauth2-proxy-raw.gotmpl @@ -10,6 +10,10 @@ resources: metadata: annotations: externaldns: "true" + {{- if and $v.dns.provider (and $v.dns.provider.linode) }} + # Check Linode Api documentation for allowed values in seconds: https://developers-linode.netlify.app/api/v4/domains + external-dns.alpha.kubernetes.io/ttl: "1h" + {{- end }} nginx.ingress.kubernetes.io/ssl-redirect: "true" {{- if and (eq $v.cluster.provider "custom") (hasKey $v.ingress.platformClass "entrypoint") (ne $ingress.entrypoint "") }} external-dns.alpha.kubernetes.io/target: {{ $v.ingress.platformClass }}