diff --git a/manifests/ovirt/coredns.yaml b/manifests/ovirt/coredns.yaml index ebab8ac3d1..61deea1f1d 100644 --- a/manifests/ovirt/coredns.yaml +++ b/manifests/ovirt/coredns.yaml @@ -30,8 +30,6 @@ spec: - "/etc/kubernetes/kubeconfig" - "--api-vip" - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.APIServerInternalIP }}" - - "--dns-vip" - - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.NodeDNSIP }}" - "--ingress-vip" - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.IngressIP }}" - "/config" diff --git a/manifests/ovirt/keepalived.conf.tmpl b/manifests/ovirt/keepalived.conf.tmpl index 7ae696c17d..5d2ec43b42 100644 --- a/manifests/ovirt/keepalived.conf.tmpl +++ b/manifests/ovirt/keepalived.conf.tmpl @@ -18,18 +18,3 @@ vrrp_instance {{`{{.Cluster.Name}}`}}_API { {{`{{ .Cluster.APIVIP }}`}}/{{`{{ .Cluster.VIPNetmask }}`}} } } - -vrrp_instance {{`{{.Cluster.Name}}`}}_DNS { - state MASTER - interface {{`{{.VRRPInterface}}`}} - virtual_router_id {{`{{.Cluster.DNSVirtualRouterID }}`}} - priority 140 - advert_int 1 - authentication { - auth_type PASS - auth_pass {{`{{.Cluster.Name}}`}}_dns_vip - } - virtual_ipaddress { - {{`{{ .Cluster.DNSVIP }}`}}/{{`{{ .Cluster.VIPNetmask }}`}} - } -} diff --git a/manifests/ovirt/keepalived.yaml b/manifests/ovirt/keepalived.yaml index a920977d25..e6ec5f6a8d 100644 --- a/manifests/ovirt/keepalived.yaml +++ b/manifests/ovirt/keepalived.yaml @@ -30,8 +30,6 @@ spec: - "/etc/kubernetes/kubeconfig" - "--api-vip" - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.APIServerInternalIP }}" - - "--dns-vip" - - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.NodeDNSIP }}" - "--ingress-vip" - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.IngressIP }}" - "/config" diff --git a/pkg/operator/assets/bindata.go b/pkg/operator/assets/bindata.go index d4a0bf9a4e..5e82704573 100644 --- a/pkg/operator/assets/bindata.go +++ b/pkg/operator/assets/bindata.go @@ -2095,8 +2095,6 @@ spec: - "/etc/kubernetes/kubeconfig" - "--api-vip" - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.APIServerInternalIP }}" - - "--dns-vip" - - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.NodeDNSIP }}" - "--ingress-vip" - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.IngressIP }}" - "/config" @@ -2192,21 +2190,6 @@ vrrp_instance {{`+"`"+`{{.Cluster.Name}}`+"`"+`}}_API { {{`+"`"+`{{ .Cluster.APIVIP }}`+"`"+`}}/{{`+"`"+`{{ .Cluster.VIPNetmask }}`+"`"+`}} } } - -vrrp_instance {{`+"`"+`{{.Cluster.Name}}`+"`"+`}}_DNS { - state MASTER - interface {{`+"`"+`{{.VRRPInterface}}`+"`"+`}} - virtual_router_id {{`+"`"+`{{.Cluster.DNSVirtualRouterID }}`+"`"+`}} - priority 140 - advert_int 1 - authentication { - auth_type PASS - auth_pass {{`+"`"+`{{.Cluster.Name}}`+"`"+`}}_dns_vip - } - virtual_ipaddress { - {{`+"`"+`{{ .Cluster.DNSVIP }}`+"`"+`}}/{{`+"`"+`{{ .Cluster.VIPNetmask }}`+"`"+`}} - } -} `) func manifestsOvirtKeepalivedConfTmplBytes() ([]byte, error) { @@ -2256,8 +2239,6 @@ spec: - "/etc/kubernetes/kubeconfig" - "--api-vip" - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.APIServerInternalIP }}" - - "--dns-vip" - - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.NodeDNSIP }}" - "--ingress-vip" - "{{ .ControllerConfig.Infra.Status.PlatformStatus.Ovirt.IngressIP }}" - "/config" diff --git a/templates/common/ovirt/files/NetworkManager-resolv-prepender.yaml b/templates/common/ovirt/files/NetworkManager-resolv-prepender.yaml new file mode 100644 index 0000000000..1a95ffd312 --- /dev/null +++ b/templates/common/ovirt/files/NetworkManager-resolv-prepender.yaml @@ -0,0 +1,38 @@ +filesystem: "root" +mode: 0755 +path: "/etc/NetworkManager/dispatcher.d/30-resolv-prepender" +contents: + inline: | + #!/bin/bash + set -eo pipefail + IFACE=$1 + STATUS=$2 + case "$STATUS" in + up|down|dhcp4-change|dhcp6-change) + logger -s "NM resolv-prepender triggered by ${1} ${2}." + + # Ensure resolv.conf exists before we try to run podman + cp /var/run/NetworkManager/resolv.conf /etc/resolv.conf + + NAMESERVER_IP=$(/usr/bin/podman run --rm \ + --authfile /var/lib/kubelet/config.json \ + --net=host \ + {{ .Images.baremetalRuntimeCfgImage }} \ + node-ip \ + show \ + "{{.Infra.Status.PlatformStatus.Ovirt.APIServerInternalIP}}" \ + "{{.Infra.Status.PlatformStatus.Ovirt.IngressIP}}") + DOMAIN="{{.EtcdDiscoveryDomain}}" + if [[ -n "$NAMESERVER_IP" ]]; then + logger -s "NM resolv-prepender: Prepending 'nameserver $NAMESERVER_IP' to /etc/resolv.conf (other nameservers from /var/run/NetworkManager/resolv.conf)" + sed -e "/^search/d" \ + -e "/Generated by/c# Generated by Ovirt resolv prepender NM dispatcher script\nsearch $DOMAIN\nnameserver $NAMESERVER_IP" \ + /var/run/NetworkManager/resolv.conf > /etc/resolv.tmp + fi + # Only leave the first 3 nameservers in /etc/resolv.conf + sed -i ':a $!{N; ba}; s/\(^\|\n\)nameserver/\n# nameserver/4g' /etc/resolv.tmp + mv -f /etc/resolv.tmp /etc/resolv.conf + ;; + *) + ;; + esac diff --git a/templates/common/ovirt/files/ovirt-coredns.yaml b/templates/common/ovirt/files/ovirt-coredns.yaml index 4ba5a13b22..c68831247a 100644 --- a/templates/common/ovirt/files/ovirt-coredns.yaml +++ b/templates/common/ovirt/files/ovirt-coredns.yaml @@ -32,8 +32,6 @@ contents: - "/etc/kubernetes/kubeconfig" - "--api-vip" - "{{ .Infra.Status.PlatformStatus.Ovirt.APIServerInternalIP }}" - - "--dns-vip" - - "{{ .Infra.Status.PlatformStatus.Ovirt.NodeDNSIP }}" - "--ingress-vip" - "{{ .Infra.Status.PlatformStatus.Ovirt.IngressIP }}" - "/config" diff --git a/templates/common/ovirt/files/ovirt-keepalived.yaml b/templates/common/ovirt/files/ovirt-keepalived.yaml index 06b6ef1113..f910e7fef8 100644 --- a/templates/common/ovirt/files/ovirt-keepalived.yaml +++ b/templates/common/ovirt/files/ovirt-keepalived.yaml @@ -97,8 +97,6 @@ contents: - "/etc/keepalived/keepalived.conf" - "--api-vip" - "{{ .Infra.Status.PlatformStatus.Ovirt.APIServerInternalIP }}" - - "--dns-vip" - - "{{ .Infra.Status.PlatformStatus.Ovirt.NodeDNSIP }}" - "--ingress-vip" - "{{ .Infra.Status.PlatformStatus.Ovirt.IngressIP }}" volumeMounts: diff --git a/templates/common/ovirt/files/ovirt-mdns-publisher.yaml b/templates/common/ovirt/files/ovirt-mdns-publisher.yaml index 79d78adbd5..27a7c443b6 100644 --- a/templates/common/ovirt/files/ovirt-mdns-publisher.yaml +++ b/templates/common/ovirt/files/ovirt-mdns-publisher.yaml @@ -32,8 +32,6 @@ contents: - "/etc/kubernetes/kubeconfig" - "--api-vip" - "{{ .Infra.Status.PlatformStatus.Ovirt.APIServerInternalIP }}" - - "--dns-vip" - - "{{ .Infra.Status.PlatformStatus.Ovirt.NodeDNSIP }}" - "--ingress-vip" - "{{ .Infra.Status.PlatformStatus.Ovirt.IngressIP }}" - "/config" diff --git a/templates/master/00-master/ovirt/files/dhcp-dhclient-conf.yaml b/templates/master/00-master/ovirt/files/dhcp-dhclient-conf.yaml index 8a75bbd1e9..0a3d18bc86 100644 --- a/templates/master/00-master/ovirt/files/dhcp-dhclient-conf.yaml +++ b/templates/master/00-master/ovirt/files/dhcp-dhclient-conf.yaml @@ -4,4 +4,3 @@ path: "/etc/dhcp/dhclient.conf" contents: inline: | supersede domain-search "{{ .EtcdDiscoveryDomain }}"; - prepend domain-name-servers {{ .Infra.Status.PlatformStatus.Ovirt.NodeDNSIP }}; diff --git a/templates/master/00-master/ovirt/files/ovirt-keepalived-keepalived.yaml b/templates/master/00-master/ovirt/files/ovirt-keepalived-keepalived.yaml index 4642eb75b2..5393a415d9 100644 --- a/templates/master/00-master/ovirt/files/ovirt-keepalived-keepalived.yaml +++ b/templates/master/00-master/ovirt/files/ovirt-keepalived-keepalived.yaml @@ -9,12 +9,6 @@ contents: weight 50 } - vrrp_script chk_dns { - script "/usr/bin/host -t SRV _etcd-server-ssl._tcp.{{ .EtcdDiscoveryDomain }} localhost" - interval 1 - weight 50 - } - # TODO: Improve this check. The port is assumed to be alive. # Need to assess what is the ramification if the port is not there. vrrp_script chk_ingress { @@ -41,24 +35,6 @@ contents: } } - vrrp_instance {{`{{ .Cluster.Name }}`}}_DNS { - state BACKUP - interface {{`{{ .VRRPInterface }}`}} - virtual_router_id {{`{{ .Cluster.DNSVirtualRouterID }}`}} - priority 40 - advert_int 1 - authentication { - auth_type PASS - auth_pass {{`{{ .Cluster.Name }}`}}_dns_vip - } - virtual_ipaddress { - {{`{{ .Cluster.DNSVIP }}`}}/{{`{{ .Cluster.VIPNetmask }}`}} - } - track_script { - chk_dns - } - } - vrrp_instance {{`{{ .Cluster.Name }}`}}_INGRESS { state BACKUP interface {{`{{ .VRRPInterface }}`}} diff --git a/templates/worker/00-worker/ovirt/files/dhcp-dhclient-conf.yaml b/templates/worker/00-worker/ovirt/files/dhcp-dhclient-conf.yaml index 8a75bbd1e9..0a3d18bc86 100644 --- a/templates/worker/00-worker/ovirt/files/dhcp-dhclient-conf.yaml +++ b/templates/worker/00-worker/ovirt/files/dhcp-dhclient-conf.yaml @@ -4,4 +4,3 @@ path: "/etc/dhcp/dhclient.conf" contents: inline: | supersede domain-search "{{ .EtcdDiscoveryDomain }}"; - prepend domain-name-servers {{ .Infra.Status.PlatformStatus.Ovirt.NodeDNSIP }};