Fixing cni simlinks

This commit is contained in:
juvdiaz 2026-06-02 14:33:00 -06:00
parent ad81d37119
commit cff162c186
1 changed files with 8 additions and 2 deletions

View File

@ -21,6 +21,7 @@ resource "null_resource" "kubeadm_control_plane" {
kubeconfig_owner = var.kubeconfig_owner
registry_endpoint = var.registry_endpoint
registry_config_version = "7"
cni_plugins_version = "2"
node_dns_servers = join(" ", var.node_dns_servers)
persistent_volume_dirs = join(",", var.persistent_volume_dirs)
}
@ -204,9 +205,11 @@ install_cni_plugins() {
local plugin
sudo mkdir -p /opt/cni/bin
sudo find /opt/cni/bin -maxdepth 1 -type f ! -perm -111 -delete
sudo find /opt/cni/bin -maxdepth 1 -type l ! -exec test -x {} \; -delete
if [ -d /usr/lib/cni ]; then
for plugin in /usr/lib/cni/*; do
[ -f "$plugin" ] || continue
[ -f "$plugin" ] && [ -x "$plugin" ] || continue
sudo ln -sf "$plugin" "/opt/cni/bin/$(basename "$plugin")"
done
fi
@ -343,6 +346,7 @@ resource "null_resource" "kubeadm_worker" {
ssh_key_path = each.value.ssh_key_path
registry_endpoint = var.registry_endpoint
registry_config_version = "7"
cni_plugins_version = "2"
node_dns_servers = join(" ", var.node_dns_servers)
persistent_volume_dirs = join(",", var.persistent_volume_dirs)
tailscale_nodeport_version = "3"
@ -543,9 +547,11 @@ install_cni_plugins() {
local plugin
sudo mkdir -p /opt/cni/bin
sudo find /opt/cni/bin -maxdepth 1 -type f ! -perm -111 -delete
sudo find /opt/cni/bin -maxdepth 1 -type l ! -exec test -x {} \; -delete
if [ -d /usr/lib/cni ]; then
for plugin in /usr/lib/cni/*; do
[ -f "$plugin" ] || continue
[ -f "$plugin" ] && [ -x "$plugin" ] || continue
sudo ln -sf "$plugin" "/opt/cni/bin/$(basename "$plugin")"
done
fi