Skip to content

Commit 2172d03

Browse files
committed
update: remove extra configs in favor of yq
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
1 parent 471bb7c commit 2172d03

19 files changed

Lines changed: 85 additions & 1017 deletions

Dockerfile

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,61 @@
1-
ARG BASE_IMAGE=docker.io/kindest/node:v1.35.0@sha256:452d707d4862f52530247495d180205e029056831160e22870e37e3f6c1ac31f
2-
ARG CNI_PLUGINS_VERSION=v1.9.0
3-
ARG HELM_VERSION=v4.0.4
4-
ARG FLANNEL_VERSION=v0.27.4
1+
ARG BASE_IMAGE=docker.io/kindest/node:v1.33.0@sha256:91e9ed777db80279c22d1d1068c091b899b2078506e4a0f797fbf6e397c0b0b2
2+
ARG CNI_PLUGINS_VERSION=v1.7.1
3+
ARG HELM_VERSION=v3.17.3
4+
ARG FLANNEL_VERSION=v0.26.7
5+
ARG CALICO_VERSION=v3.30.5
56
FROM ${BASE_IMAGE}
67
COPY Dockerfile.d/SHA256SUMS.d/ /tmp/SHA256SUMS.d
78
ARG CNI_PLUGINS_VERSION
89
ARG HELM_VERSION
910
ARG FLANNEL_VERSION
10-
# This are private on our cluster and need to be copied to here
11-
COPY cspca.llnl.gov.cer.pem /usr/local/share/ca-certificates/
12-
COPY cspca.cer.pem /usr/local/share/ca-certificates/
11+
ARG CALICO_VERSION
1312
RUN update-ca-certificates
1413
RUN arch="$(uname -m | sed -e s/x86_64/amd64/ -e s/aarch64/arm64/)" && \
14+
# CNI Plugins
1515
fname="cni-plugins-linux-${arch}-${CNI_PLUGINS_VERSION}.tgz" && \
16-
curl --insecure -o "${fname}" -fSL "https://github.com/containernetworking/plugins/releases/download/${CNI_PLUGINS_VERSION}/${fname}" && \
16+
curl -o "${fname}" -fSL "https://github.com/containernetworking/plugins/releases/download/${CNI_PLUGINS_VERSION}/${fname}" && \
1717
grep "${fname}" "/tmp/SHA256SUMS.d/cni-plugins-${CNI_PLUGINS_VERSION}" | sha256sum -c && \
1818
mkdir -p /opt/cni/bin && \
1919
tar xzf "${fname}" -C /opt/cni/bin && \
2020
rm -f "${fname}" && \
21+
# Helm
2122
fname="helm-${HELM_VERSION}-linux-${arch}.tar.gz" && \
22-
curl --insecure -o "${fname}" -fSL "https://get.helm.sh/${fname}" && \
23+
curl -o "${fname}" -fSL "https://get.helm.sh/${fname}" && \
2324
grep "${fname}" "/tmp/SHA256SUMS.d/helm-${HELM_VERSION}" | sha256sum -c && \
2425
tar xzf "${fname}" -C /usr/local/bin --strip-components=1 -- "linux-${arch}/helm" && \
2526
rm -f "${fname}" && \
27+
# Flannel
2628
fname="flannel.tgz" && \
27-
curl --insecure -o "${fname}" -fSL "https://github.com/flannel-io/flannel/releases/download/${FLANNEL_VERSION}/${fname}" && \
29+
curl -o "${fname}" -fSL "https://github.com/flannel-io/flannel/releases/download/${FLANNEL_VERSION}/${fname}" && \
2830
grep "${fname}" "/tmp/SHA256SUMS.d/flannel-${FLANNEL_VERSION}" | sha256sum -c && \
2931
tar xzf "${fname}" -C / && \
30-
rm -f "${fname}"
32+
rm -f "${fname}" && \
33+
# Calico (calicoctl)
34+
fname="calicoctl-linux-${arch}" && \
35+
curl -o "${fname}" -fSL "https://github.com/projectcalico/calico/releases/download/${CALICO_VERSION}/${fname}" && \
36+
grep "${fname}" "/tmp/SHA256SUMS.d/calico-${CALICO_VERSION}" | sha256sum -c && \
37+
chmod +x "${fname}" && \
38+
mv "${fname}" /usr/local/bin/calicoctl && \
39+
# Calico manifest - derive v3.31 from v3.31.5
40+
calico_branch="$(echo "${CALICO_VERSION}" | cut -d. -f1,2)" && \
41+
fname="calico.yaml" && \
42+
curl -o "/${fname}" -fSL "https://raw.githubusercontent.com/projectcalico/calico/refs/heads/release-${calico_branch}/manifests/calico.yaml" && \
43+
grep "${fname}" "/tmp/SHA256SUMS.d/calico-manifest-${CALICO_VERSION}" | sha256sum -c
44+
3145
# gettext-base: for `envsubst`
3246
# moreutils: for `sponge`
3347
# socat: for `socat` (to silence "[WARNING FileExisting-socat]" from kubeadm)
48+
# ipset: for using calico and command line utils
49+
# yq: needed to install custom calico manifests
3450
RUN apt-get update && apt-get install -y --no-install-recommends \
3551
gettext-base \
3652
moreutils \
37-
socat ipset wget
38-
ADD Dockerfile.d/etc_udev_rules.d_90-flannel.rules /etc/udev/rules.d/90-flannel.rules
39-
ADD Dockerfile.d/etc_udev_rules.d_95-calico.rules /etc/udev/rules.d/95-calico.rules
40-
ADD Dockerfile.d/u7s-entrypoint.sh /
53+
socat \
54+
ipset \
55+
yq \
56+
&& rm -rf /var/lib/apt/lists/*
4157
# Calico
4258
ENV FELIX_IGNORELOOSERPF=true
43-
RUN wget https://github.com/projectcalico/calico/releases/download/v3.30.5/calicoctl-linux-amd64 -O /tmp/calicoctl && \
44-
chmod +x /tmp/calicoctl && mv /tmp/calicoctl /usr/local/bin
59+
ADD Dockerfile.d/etc_udev_rules.d_90-flannel-calico.rules /etc/udev/rules.d/90-flannel-calico.rules
60+
ADD Dockerfile.d/u7s-entrypoint.sh /
4561
ENTRYPOINT ["/u7s-entrypoint.sh", "/usr/local/bin/entrypoint", "/sbin/init"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ed105288f27c7ba4cae143bcaa3f6425f02d84fa94a4786cc8e3d371412c1a36 calico.yaml
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
6cdfb17b0276f648f4fdb051a5d75617a50b3c328d4cccfc40d087b96c361d80 calicoctl-linux-amd64
2+
7611343e7a56e770b95e2bb882dda787efbbd4331b1dd6316ff8ea189238dfaa calicoctl-linux-arm64

Dockerfile.d/etc_udev_rules.d_90-flannel.rules renamed to Dockerfile.d/etc_udev_rules.d_90-flannel-calico.rules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
# https://github.com/kubernetes/kops/pull/9074
44
# https://github.com/karmab/kcli/commit/b1a8eff658d17cf4e28162f0fa2c8b2b10e5ad00
55
SUBSYSTEM=="net", ACTION=="add|change|move", ENV{INTERFACE}=="flannel.1", RUN+="/usr/sbin/ethtool -K flannel.1 tx-checksum-ip-generic off"
6+
SUBSYSTEM=="net", ACTION=="add|change|move", ENV{INTERFACE}=="vxlan.calico", RUN+="/usr/sbin/ethtool -K vxlan.calico tx-checksum-ip-generic off"

Dockerfile.d/etc_udev_rules.d_95-calico.rules

Lines changed: 0 additions & 1 deletion
This file was deleted.

Makefile

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

@@ -146,8 +146,6 @@ sync-external-ip:
146146

147147
.PHONY: kubeadm-join
148148
kubeadm-join:
149-
# Our kernel is too old for usernetes, so we need this
150-
sed -i "s/--token/--ignore-preflight-errors=all --token/g" join-command
151149
$(NODE_SHELL) /bin/bash /usernetes/join-command
152150
@echo "# Run 'make sync-external-ip' on the control plane"
153151

@@ -157,11 +155,7 @@ kubeadm-reset:
157155

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

166160
.PHONY: install-calico
167161
install-calico:

Makefile.d/calico/deploy/config-map.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)