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

OCPBUGS-52940: AWS Custom-DNS: Update services that run on control plane nodes #4939

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
19 changes: 19 additions & 0 deletions templates/common/aws/units/aws-update-dns.service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: aws-update-dns.service
enabled: {{if and (eq .Infra.Status.PlatformStatus.Type "AWS") (.Infra.Status.PlatformStatus.AWS) (.Infra.Status.PlatformStatus.AWS.CloudLoadBalancerConfig) (eq .Infra.Status.PlatformStatus.AWS.CloudLoadBalancerConfig.DNSType "ClusterHosted") }}true{{else}}false{{end}}
contents: |
[Unit]
Description=Update Default AWS Resolver
# We don't need to do this on the firstboot
After=firstboot-osupdate.target
# Wait for NetworkManager to report it's online
After=NetworkManager-wait-online.service
# Run before kubelet
Before=kubelet-dependencies.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/update-dns-server 169.254.169.254

[Install]
RequiredBy=kubelet-dependencies.target
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ path: "/usr/local/bin/update-dns-server"
contents:
inline: |
#!/bin/bash
# For GCP, updating the NetworkManager configuration file to
# Updating the NetworkManager configuration file to
# include the IP address of the local node as the default DNS
# resolver when UserProvisionedDNS is enabled.
# resolver when UserProvisionedDNS is enabled on cloud platforms.
# A CoreDNS static pod running on the node is responsible for
# resolving the api, api-int and *.apps URLs.

Expand All @@ -14,7 +14,7 @@ contents:
cat <<EOF | tee /etc/NetworkManager/conf.d/dns-servers.conf
# Added by OpenShift
[global-dns-domain-*]
servers=$(ip --json route get 8.8.8.8 | jq -r ".[0].prefsrc"),169.254.169.254
servers=$(ip --json route get 8.8.8.8 | jq -r ".[0].prefsrc"),$1
EOF

# network manager may already be running at this point.
Expand Down
2 changes: 1 addition & 1 deletion templates/common/gcp/units/gcp-update-dns.service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ contents: |
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/local/bin/update-dns-server
ExecStart=/usr/local/bin/update-dns-server 169.254.169.254

[Install]
RequiredBy=kubelet-dependencies.target