Skip to content

Commit bbc4e5f

Browse files
committed
add dns server to ovs-if-br-ex nm connection
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
1 parent 32e5222 commit bbc4e5f

File tree

1 file changed

+38
-7
lines changed

1 file changed

+38
-7
lines changed

pkg/bundle/setup/clustersetup.sh

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,51 @@ address=/$hostName.crc.testing/192.168.126.11
114114
EOF
115115

116116
stop_if_failed $? "failed to write Dnsmasq configuration in $DNSMASQ_CONF"
117-
pr_info "adding Dnsmasq as primary DNS"
117+
#pr_info "adding Dnsmasq as primary DNS"
118118
sleep 2
119-
nmcli connection modify Wired\ connection\ 1 ipv4.dns "$IIP,169.254.169.254"
119+
#nmcli connection modify Wired\ connection\ 1 ipv4.dns "$IIP,169.254.169.254"
120120
stop_if_failed $? "failed to modify NetworkManager settings"
121-
pr_info "restarting NetworkManager"
122-
sleep 2
123-
systemctl restart NetworkManager
124-
stop_if_failed $? "failed to restart NetworkManager"
125-
pr_info "enabling & starting Dnsmasq service"
121+
# pr_info "restarting NetworkManager"
122+
# sleep 2
123+
# systemctl restart NetworkManager
124+
# stop_if_failed $? "failed to restart NetworkManager"
125+
# pr_info "enabling & starting Dnsmasq service"
126126
systemctl enable dnsmasq.service
127127
systemctl start dnsmasq.service
128128
sleep 2
129129
stop_if_failed $? "failed to start Dnsmasq service"
130130
}
131131

132+
update_ovs_nm_config() {
133+
cat << EOF > /etc/systemd/system/crc-cloud-ovs-nm.service
134+
[Unit]
135+
Description=CRC Cloud Unit for configuring nm ovs connection
136+
Requires=ovs-configuration.service
137+
After=ovs-configuration.service
138+
139+
[Service]
140+
Type=oneshot
141+
ExecStart=nmcli con modify --temporary ovs-if-br-ex ipv4.dns "$IIP,169.254.169.254"
142+
StandardOutput=journal
143+
144+
[Install]
145+
RequiredBy=kubelet-dependencies.target
146+
EOF
147+
148+
stop_if_failed $? "failed to write systemd unit file for network manager ovs connection update"
149+
pr_info "adding Dnsmasq as primary DNS"
150+
sleep 2
151+
152+
systemctl enable crc-cloud-ovs-nm.service
153+
systemctl start crc-cloud-ovs-nm.service
154+
stop_if_failed $? "failed to modify NetworkManager settings"
155+
156+
pr_info "restarting NetworkManager"
157+
sleep 2
158+
systemctl restart NetworkManager
159+
stop_if_failed $? "failed to restart NetworkManager"
160+
}
161+
132162
enable_and_start_kubelet() {
133163
pr_info "enabling & starting Kubelet service"
134164
systemctl enable kubelet
@@ -247,6 +277,7 @@ set_credentials() {
247277
}
248278

249279
setup_dsnmasq
280+
update_ovs_nm_config
250281

251282
enable_and_start_kubelet
252283
replace_default_pubkey

0 commit comments

Comments
 (0)