From 5329991db01570339b9168dff93d013cc448b8e5 Mon Sep 17 00:00:00 2001 From: Sandhya Dasu Date: Tue, 14 May 2024 17:12:31 -0400 Subject: [PATCH 1/2] Set /etc/NetworkManager/conf.d/dns-servers.conf for GCP --- .../usr-local-bin-update-dns-server.yaml | 25 +++++++++++++++++++ .../gcp/units/gcp-update-dns.service.yaml | 19 ++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 templates/common/gcp/files/usr-local-bin-update-dns-server.yaml create mode 100644 templates/common/gcp/units/gcp-update-dns.service.yaml diff --git a/templates/common/gcp/files/usr-local-bin-update-dns-server.yaml b/templates/common/gcp/files/usr-local-bin-update-dns-server.yaml new file mode 100644 index 0000000000..bcce3a7a63 --- /dev/null +++ b/templates/common/gcp/files/usr-local-bin-update-dns-server.yaml @@ -0,0 +1,25 @@ +mode: 0755 +path: "/usr/local/bin/update-dns-server" +contents: + inline: | + #!/bin/bash + # For GCP, updating the NetworkManager configuration file to + # include the IP address of the local node as the default DNS + # resolver when UserProvisionedDNS is enabled. + # A CoreDNS static pod running on the node is responsible for + # resolving the api, api-int and *.apps URLs. + + mkdir -p /etc/NetworkManager/conf.d + + cat < Date: Mon, 13 Jan 2025 14:03:25 -0500 Subject: [PATCH 2/2] Conditionally run openshift-gcp-routes.service.yaml When user privisioned DNS is enabled, GCP provided Load Balancers are not configured. So, this service to add/update GCP provided LB's routes does not need to run. --- .../00-master/gcp/units/openshift-gcp-routes.service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/master/00-master/gcp/units/openshift-gcp-routes.service.yaml b/templates/master/00-master/gcp/units/openshift-gcp-routes.service.yaml index f26ba16bf9..c8756f9ae7 100644 --- a/templates/master/00-master/gcp/units/openshift-gcp-routes.service.yaml +++ b/templates/master/00-master/gcp/units/openshift-gcp-routes.service.yaml @@ -1,5 +1,5 @@ name: openshift-gcp-routes.service -enabled: true +enabled: {{if and (eq .Infra.Status.PlatformStatus.Type "GCP") (.Infra.Status.PlatformStatus.GCP) (.Infra.Status.PlatformStatus.GCP.CloudLoadBalancerConfig) (eq .Infra.Status.PlatformStatus.GCP.CloudLoadBalancerConfig.DNSType "ClusterHosted") }}false{{else}}true{{end}} contents: | [Unit] Description=Update GCP routes for forwarded IPs.