diff --git a/.github/workflows/mirror-calico-images.sh b/.github/workflows/mirror-calico-images.sh index bc62974c5..eb997723f 100755 --- a/.github/workflows/mirror-calico-images.sh +++ b/.github/workflows/mirror-calico-images.sh @@ -21,6 +21,7 @@ images=( calico/kube-controllers calico/csi calico/node-driver-registrar + calico/apiserver ) # we iterate over the images we want to mirror diff --git a/kola/tests/kubeadm/kubeadm.go b/kola/tests/kubeadm/kubeadm.go index 0198d15c1..531631e3f 100644 --- a/kola/tests/kubeadm/kubeadm.go +++ b/kola/tests/kubeadm/kubeadm.go @@ -257,6 +257,7 @@ func init() { // kubeadmBaseTest asserts that the cluster is up and running func kubeadmBaseTest(c cluster.TestCluster, params map[string]interface{}) { + params["Platform"] = c.Platform() params["Arch"] = strings.SplitN(kola.QEMUOptions.Board, "-", 2)[0] kubectl, err := setup(c, params) if err != nil { diff --git a/kola/tests/kubeadm/templates.go b/kola/tests/kubeadm/templates.go index a1db03203..c83c434df 100644 --- a/kola/tests/kubeadm/templates.go +++ b/kola/tests/kubeadm/templates.go @@ -365,6 +365,11 @@ curl --retry-delay 1 \ # kubelet config for both controller and worker cgroup=$(docker info | awk '/Cgroup Driver/ { print $3}') +{{ if eq .Platform "do" }} +systemctl start --quiet coreos-metadata +ipv4=$(cat /run/metadata/flatcar | grep -v -E '(IPV6|GATEWAY)' | grep IP | grep -E '(PUBLIC|LOCAL|DYNAMIC)' | cut -d = -f 2) +{{ end }} + # we create the kubeadm config # plugin-volume-dir and flex-volume-plugin-dir are required since /usr is read-only mounted # etcd is also defined as external. The provided one has some issues with docker and selinux @@ -379,6 +384,10 @@ kind: InitConfiguration nodeRegistration: kubeletExtraArgs: volume-plugin-dir: "/opt/libexec/kubernetes/kubelet-plugins/volume/exec/" +{{ if eq .Platform "do" }} + # On Digital Ocean, the private node IP is not reachable from one node to the other - let's use the public one. + node-ip: "${ipv4}" +{{ end }} --- apiVersion: kubeadm.k8s.io/v1beta3 kind: ClusterConfiguration @@ -412,6 +421,12 @@ spec: imagePath: flatcar/calico # Configures Calico networking. calicoNetwork: +{{ if eq .Platform "do" }} + # On Digital Ocean, there is two network interfaces: eth0 and eth1 + # We use the one with a public IP (eth0) + nodeAddressAutodetectionV4: + interface: eth0 +{{ end }} # Note: The ipPools section cannot be modified post-install. ipPools: - blockSize: 26 @@ -537,7 +552,7 @@ cat << EOF > worker-config.yaml EOF systemctl start --quiet coreos-metadata -ipv4=$(cat /run/metadata/flatcar | grep -v -E '(IPV6|GATEWAY)' | grep IP | grep -E '(PRIVATE|LOCAL|DYNAMIC)' | cut -d = -f 2) +ipv4=$(cat /run/metadata/flatcar | grep -v -E '(IPV6|GATEWAY)' | grep IP | grep -E '({{ if eq .Platform "do" }}PUBLIC{{ else }}PRIVATE{{ end }}|LOCAL|DYNAMIC)' | cut -d = -f 2) kubeadm join --config worker-config.yaml --node-name "${ipv4}" ` diff --git a/kola/tests/kubeadm/testdata/master-calico-script.sh b/kola/tests/kubeadm/testdata/master-calico-script.sh index 13d56d55b..34910dadf 100644 --- a/kola/tests/kubeadm/testdata/master-calico-script.sh +++ b/kola/tests/kubeadm/testdata/master-calico-script.sh @@ -40,6 +40,8 @@ curl --retry-delay 1 \ # kubelet config for both controller and worker cgroup=$(docker info | awk '/Cgroup Driver/ { print $3}') + + # we create the kubeadm config # plugin-volume-dir and flex-volume-plugin-dir are required since /usr is read-only mounted # etcd is also defined as external. The provided one has some issues with docker and selinux @@ -54,6 +56,7 @@ kind: InitConfiguration nodeRegistration: kubeletExtraArgs: volume-plugin-dir: "/opt/libexec/kubernetes/kubelet-plugins/volume/exec/" + --- apiVersion: kubeadm.k8s.io/v1beta3 kind: ClusterConfiguration @@ -87,6 +90,7 @@ spec: imagePath: flatcar/calico # Configures Calico networking. calicoNetwork: + # Note: The ipPools section cannot be modified post-install. ipPools: - blockSize: 26 diff --git a/kola/tests/kubeadm/testdata/master-cilium-script.sh b/kola/tests/kubeadm/testdata/master-cilium-script.sh index 61a1e6e5c..f60f6a765 100644 --- a/kola/tests/kubeadm/testdata/master-cilium-script.sh +++ b/kola/tests/kubeadm/testdata/master-cilium-script.sh @@ -40,6 +40,8 @@ curl --retry-delay 1 \ # kubelet config for both controller and worker cgroup=$(docker info | awk '/Cgroup Driver/ { print $3}') + + # we create the kubeadm config # plugin-volume-dir and flex-volume-plugin-dir are required since /usr is read-only mounted # etcd is also defined as external. The provided one has some issues with docker and selinux @@ -54,6 +56,7 @@ kind: InitConfiguration nodeRegistration: kubeletExtraArgs: volume-plugin-dir: "/opt/libexec/kubernetes/kubelet-plugins/volume/exec/" + --- apiVersion: kubeadm.k8s.io/v1beta3 kind: ClusterConfiguration diff --git a/kola/tests/kubeadm/testdata/master-flannel-script.sh b/kola/tests/kubeadm/testdata/master-flannel-script.sh index 8dc1215f4..e21a04a8b 100644 --- a/kola/tests/kubeadm/testdata/master-flannel-script.sh +++ b/kola/tests/kubeadm/testdata/master-flannel-script.sh @@ -40,6 +40,8 @@ curl --retry-delay 1 \ # kubelet config for both controller and worker cgroup=$(docker info | awk '/Cgroup Driver/ { print $3}') + + # we create the kubeadm config # plugin-volume-dir and flex-volume-plugin-dir are required since /usr is read-only mounted # etcd is also defined as external. The provided one has some issues with docker and selinux @@ -54,6 +56,7 @@ kind: InitConfiguration nodeRegistration: kubeletExtraArgs: volume-plugin-dir: "/opt/libexec/kubernetes/kubelet-plugins/volume/exec/" + --- apiVersion: kubeadm.k8s.io/v1beta3 kind: ClusterConfiguration