Skip to content

Commit

Permalink
Resolve DNS resolution issues for Hetzner on Ubuntu 24.04
Browse files Browse the repository at this point in the history
Signed-off-by: Waleed Malik <ahmedwaleedmalik@gmail.com>
  • Loading branch information
ahmedwaleedmalik committed Oct 10, 2024
1 parent bc2dc58 commit 2e60d09
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
9 changes: 8 additions & 1 deletion deploy/osps/default/osp-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ metadata:
namespace: kube-system
spec:
osName: "ubuntu"
osVersion: "20.04"
osVersion: "24.04"
version: "v1.5.0"
provisioningUtility: "cloud-init"
supportedCloudProviders:
Expand Down Expand Up @@ -107,6 +107,13 @@ spec:
{{- template "configureProxyScript" }}
{{- template "configureHostCABundle" }}
{{- /* Starting with Ubuntu 24.04, there is an issue with DNS resolution that leaves machines without connectivity consistently. We even observed this issue on machines
where the netplan wasn't executed in the second cloud-init run. To fix this we are adding Cloudfare as fallback for DNS resolution */}}
{{- if eq .CloudProviderName "hetzner" }}
sed -i '/\[Resolve\]/a FallbackDNS=1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com' /etc/systemd/resolved.conf
systemctl restart systemd-resolved
{{- end }}
export DEBIAN_FRONTEND=noninteractive
apt update && apt install -y curl jq
curl -s -k -v --header 'Authorization: Bearer {{ .Token }}' {{ .ServerURL }}/api/v1/namespaces/cloud-init-settings/secrets/{{ .SecretName }} | jq '.data["cloud-config"]' -r| base64 -d > /etc/cloud/cloud.cfg.d/{{ .SecretName }}.cfg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ spec:
subnetID: test-subnet
vpcId: e-123f
osName: ubuntu
osVersion: "20.04"
osVersion: "24.04"
provisioningConfig:
files:
- content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ spec:
subnetID: test-subnet
vpcId: e-123f
osName: ubuntu
osVersion: "20.04"
osVersion: "24.04"
provisioningConfig:
files:
- content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ spec:
subnetID: test-subnet
vpcId: e-123f
osName: ubuntu
osVersion: "20.04"
osVersion: "24.04"
provisioningConfig:
files:
- content:
Expand Down
2 changes: 1 addition & 1 deletion pkg/controllers/osc/testdata/osc-ubuntu-aws-dualstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ spec:
subnetID: test-subnet
vpcId: e-123f
osName: ubuntu
osVersion: "20.04"
osVersion: "24.04"
provisioningConfig:
files:
- content:
Expand Down

0 comments on commit 2e60d09

Please sign in to comment.