Skip to content

Commit

Permalink
add dns server to ovs-if-br-ex nm connection
Browse files Browse the repository at this point in the history
since crc bundles switched to IPI with  SNO
configutation default cni network plugin is
ovn-k which creates this a bridge device in
the VM and a network manager connection  to
manage it, the DNS configuration need to be
added to this connection
  • Loading branch information
anjannath committed Oct 23, 2024
1 parent 32e5222 commit 2aa352c
Showing 1 changed file with 30 additions and 7 deletions.
37 changes: 30 additions & 7 deletions pkg/bundle/setup/clustersetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,19 +114,41 @@ address=/$hostName.crc.testing/192.168.126.11
EOF

stop_if_failed $? "failed to write Dnsmasq configuration in $DNSMASQ_CONF"
pr_info "enabling & starting Dnsmasq service"
systemctl enable dnsmasq.service
systemctl start dnsmasq.service
sleep 2
stop_if_failed $? "failed to start Dnsmasq service"
}

update_ovs_nm_config() {
cat << EOF > /etc/systemd/system/crc-cloud-ovs-nm.service
[Unit]
Description=CRC Cloud Unit for configuring nm ovs connection
Requires=ovs-configuration.service
After=ovs-configuration.service
[Service]
Type=oneshot
ExecStart=nmcli con modify --temporary ovs-if-br-ex ipv4.dns "$IIP,169.254.169.254"
StandardOutput=journal
[Install]
RequiredBy=kubelet-dependencies.target
EOF

stop_if_failed $? "failed to write systemd unit file for network manager ovs connection update"
pr_info "adding Dnsmasq as primary DNS"
sleep 2
nmcli connection modify Wired\ connection\ 1 ipv4.dns "$IIP,169.254.169.254"

systemctl enable crc-cloud-ovs-nm.service
systemctl start crc-cloud-ovs-nm.service
stop_if_failed $? "failed to modify NetworkManager settings"

pr_info "restarting NetworkManager"
sleep 2
systemctl restart NetworkManager
systemctl restart NetworkManager
stop_if_failed $? "failed to restart NetworkManager"
pr_info "enabling & starting Dnsmasq service"
systemctl enable dnsmasq.service
systemctl start dnsmasq.service
sleep 2
stop_if_failed $? "failed to start Dnsmasq service"
}

enable_and_start_kubelet() {
Expand Down Expand Up @@ -247,6 +269,7 @@ set_credentials() {
}

setup_dsnmasq
update_ovs_nm_config

enable_and_start_kubelet
replace_default_pubkey
Expand Down

0 comments on commit 2aa352c

Please sign in to comment.