Skip to content

Commit a32eddd

Browse files
committed
cni: add back calico to test on ipa
I tested manually yesterday, but the install of calicoctl should be automated. Signed-off-by: vsoch <vsoch@users.noreply.github.com>
1 parent 2179cd9 commit a32eddd

6 files changed

Lines changed: 24 additions & 13 deletions

File tree

Dockerfile.d/Dockerfile.base

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,19 @@ RUN arch="$(uname -m | sed -e s/x86_64/amd64/ -e s/aarch64/arm64/)" && \
2323
curl --insecure -o "${fname}" -fSL "https://github.com/flannel-io/flannel/releases/download/${FLANNEL_VERSION}/${fname}" && \
2424
grep "${fname}" "/tmp/SHA256SUMS.d/flannel-${FLANNEL_VERSION}" | sha256sum -c && \
2525
tar xzf "${fname}" -C / && \
26-
rm -f "${fname}"
26+
rm -f "${fname}" && \
27+
# Calico (calicoctl)
28+
fname="calicoctl-linux-${arch}" && \
29+
curl -o "${fname}" -fSL "https://github.com/projectcalico/calico/releases/download/${CALICO_VERSION}/${fname}" && \
30+
grep "${fname}" "/tmp/SHA256SUMS.d/calico-${CALICO_VERSION}" | sha256sum -c && \
31+
chmod +x "${fname}" && \
32+
mv "${fname}" /usr/local/bin/calicoctl && \
33+
# Calico manifest - derive v3.31 from v3.31.5
34+
calico_branch="$(echo "${CALICO_VERSION}" | cut -d. -f1,2)" && \
35+
fname="calico.yaml" && \
36+
curl -o "/${fname}" -fSL "https://raw.githubusercontent.com/projectcalico/calico/refs/heads/release-${calico_branch}/manifests/calico.yaml" && \
37+
grep "${fname}" "/tmp/SHA256SUMS.d/calico-manifest-${CALICO_VERSION}" | sha256sum -c
38+
2739
# gettext-base: for `envsubst`
2840
# moreutils: for `sponge`
2941
# socat: for `socat` (to silence "[WARNING FileExisting-socat]" from kubeadm)

Makefile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ join-command:
140140
.PHONY: kubeadm-init
141141
kubeadm-init:
142142
$(NODE_SHELL) sh -euc "envsubst </usernetes/kubeadm-config.yaml >/tmp/kubeadm-config.yaml"
143-
$(NODE_SHELL) kubeadm init --ignore-preflight-errors all --config /tmp/kubeadm-config.yaml --skip-token-print
143+
$(NODE_SHELL) kubeadm init --config /tmp/kubeadm-config.yaml --skip-token-print
144144
$(MAKE) sync-external-ip
145145
@echo "# Run 'make join-command' to print the join command"
146146

@@ -150,8 +150,6 @@ sync-external-ip:
150150

151151
.PHONY: kubeadm-join
152152
kubeadm-join:
153-
# Our kernel is too old for usernetes, so we need this
154-
sed -i "s/--token/--ignore-preflight-errors=all --token/g" $(HERE)/join-command
155153
$(NODE_SHELL) /bin/bash /usernetes/join-command
156154
@echo "# Run 'make sync-external-ip' on the control plane"
157155

@@ -161,8 +159,9 @@ kubeadm-reset:
161159

162160
.PHONY: install-flannel
163161
install-flannel:
164-
# Kubernetes 1.30.x removed the check for br_netfilter from kubeadm.
165-
# Flannel over version 0.25 checks for br_netfilter, which won't be in the podman node.
166-
# We don't actually need it there, just on the physical node, so we use newer K8s and older flannel
167-
$(NODE_SHELL) kubectl apply -f https://github.com/flannel-io/flannel/releases/download/v0.25.1/kube-flannel.yml
168-
#$(NODE_SHELL) /usernetes/Makefile.d/install-flannel.sh
162+
$(NODE_SHELL) /usernetes/Makefile.d/install-flannel.sh
163+
164+
.PHONY: install-calico
165+
install-calico:
166+
# Calico daemonset changes and node-level address changes
167+
$(NODE_SHELL) /usernetes/Makefile.d/calico/install-calico.sh

service/usernetes-control-plane.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ After=network-online.target
44

55
[Service]
66
Type=simple
7-
ExecStart=/usr/workspace/usernetes/service/usernetes-start-control-plane.sh podman
7+
ExecStart=/usr/workspace/usernetes/usernetes-ipa/service/usernetes-start-control-plane.sh podman
88
LimitMEMLOCK=infinity
99
# Environment="USERNETES_CONTAINER_TECH_ARG=podman"
1010

service/usernetes-start-control-plane.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euo pipefail
55
# These are variables we likely will change
66
# LC only supplies podman
77
USERNETES_CONTAINER_TECH=${1:-"podman"}
8-
USERNETES_TEMPLATE_PATH=/usr/workspace/usernetes/usernetes-develop
8+
USERNETES_TEMPLATE_PATH=/usr/workspace/usernetes/usernetes-ipa
99

1010
# We will copy join command here
1111
shared_join_command_dir="/usr/workspace/usernetes"

service/usernetes-start-worker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euo pipefail
55
# These are variables we likely will change
66
# LC only supplies podman
77
USERNETES_CONTAINER_TECH=${1:-"podman"}
8-
USERNETES_TEMPLATE_PATH=/usr/workspace/usernetes/usernetes-develop
8+
USERNETES_TEMPLATE_PATH=/usr/workspace/usernetes/usernetes-ipa
99

1010
# Logging functions for consistency (like Akihiro!)
1111
log() {

service/usernetes-worker.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ After=network-online.target
44

55
[Service]
66
Type=simple
7-
ExecStart=/usr/workspace/usernetes/service/usernetes-start-worker.sh podman
7+
ExecStart=/usr/workspace/usernetes/usernetes-ipa/service/usernetes-start-worker.sh podman
88
# Environment="USERNETES_CONTAINER_TECH_ARG=podman"
99
LimitMEMLOCK=infinity
1010

0 commit comments

Comments
 (0)