From ca5dd3f3542cacff9b7e9ac5c2a074627fcd8fb0 Mon Sep 17 00:00:00 2001 From: Jesse Haka Date: Mon, 18 Nov 2024 22:51:13 +0200 Subject: [PATCH] add external dns support for openstack --- .../update_cluster/openstack_floatingip/in-v1alpha2.yaml | 2 ++ .../addons/external-dns.addons.k8s.io/k8s-1.19.yaml.template | 4 ++++ upup/pkg/fi/cloudup/template_functions.go | 2 ++ 3 files changed, 8 insertions(+) diff --git a/tests/integration/update_cluster/openstack_floatingip/in-v1alpha2.yaml b/tests/integration/update_cluster/openstack_floatingip/in-v1alpha2.yaml index fc948995bccfe..8adea1914626f 100644 --- a/tests/integration/update_cluster/openstack_floatingip/in-v1alpha2.yaml +++ b/tests/integration/update_cluster/openstack_floatingip/in-v1alpha2.yaml @@ -15,6 +15,8 @@ spec: externalNetwork: external cloudProvider: openstack configBase: memfs://tests/floatingip-openstack.k8s.local + externalDns: + provider: external-dns etcdClusters: - etcdMembers: - instanceGroup: master-us-test1-a diff --git a/upup/models/cloudup/resources/addons/external-dns.addons.k8s.io/k8s-1.19.yaml.template b/upup/models/cloudup/resources/addons/external-dns.addons.k8s.io/k8s-1.19.yaml.template index 9caf028c159e7..301da472a7729 100644 --- a/upup/models/cloudup/resources/addons/external-dns.addons.k8s.io/k8s-1.19.yaml.template +++ b/upup/models/cloudup/resources/addons/external-dns.addons.k8s.io/k8s-1.19.yaml.template @@ -63,6 +63,10 @@ spec: value: "127.0.0.1" - name: KUBERNETES_SERVICE_PORT value: "443" +{{ range $name, $value := DNSControllerEnvs }} + - name: {{ $name }} + value: {{ $value }} +{{ end }} ports: - name: http protocol: TCP diff --git a/upup/pkg/fi/cloudup/template_functions.go b/upup/pkg/fi/cloudup/template_functions.go index 68f6c1d452446..2af4c894a2dda 100644 --- a/upup/pkg/fi/cloudup/template_functions.go +++ b/upup/pkg/fi/cloudup/template_functions.go @@ -815,6 +815,8 @@ func (tf *TemplateFunctions) ExternalDNSArgv() ([]string, error) { switch cloudProvider { case kops.CloudProviderAWS: argv = append(argv, "--provider=aws") + case kops.CloudProviderOpenstack: + argv = append(argv, "--provider=designate") case kops.CloudProviderGCE: project := cluster.Spec.CloudProvider.GCE.Project argv = append(argv, "--provider=google")