-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cilium: enforce device detection and enable image building (#151)
Signed-off-by: Andrei Kvapil <[email protected]>
- Loading branch information
Showing
10 changed files
with
306 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,30 @@ | ||
CILIUM_TAG=$(shell awk '$$1 == "version:" {print $$2}' charts/cilium/Chart.yaml) | ||
|
||
NAME=cilium | ||
NAMESPACE=cozy-$(NAME) | ||
|
||
include ../../../scripts/common-envs.mk | ||
include ../../../scripts/package-system.mk | ||
|
||
update: | ||
rm -rf charts | ||
helm repo add cilium https://helm.cilium.io/ | ||
helm repo update cilium | ||
helm pull cilium/cilium --untar --untardir charts --version 1.15 | ||
ln -s ../../images charts/cilium/images | ||
sed -i 's/include "cilium.image" .Values.image/include "cilium.image" ./g' charts/cilium/templates/cilium-agent/daemonset.yaml | ||
sed -i -e '/Used in iptables/d' -e '/SYS_MODULE/d' charts/cilium/values.yaml | ||
patch -p3 --no-backup-if-mismatch < patches/fix-cgroups.patch | ||
version=$$(awk '$$1 == "version:" {print $$2}' charts/cilium/Chart.yaml) && \ | ||
sed -i "s/ARG VERSION=.*/ARG VERSION=v$${version}/" images/cilium/Dockerfile | ||
|
||
image: | ||
docker buildx build images/cilium \ | ||
--provenance false \ | ||
--tag $(REGISTRY)/cilium:$(call settag,$(CILIUM_TAG)) \ | ||
--tag $(REGISTRY)/cilium:$(call settag,$(CILIUM_TAG)-$(TAG)) \ | ||
--cache-from type=registry,ref=$(REGISTRY)/cilium:latest \ | ||
--cache-to type=inline \ | ||
--metadata-file images/cilium.json \ | ||
--push=$(PUSH) \ | ||
--load=$(LOAD) | ||
echo "$(REGISTRY)/cilium:$(call settag,$(TAG))" > images/cilium.tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../images |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"containerimage.config.digest": "sha256:5d7a65f2d5c41bd53cccaa55d4f5d28933c08f5294e732b9a00427d091c1d78f", | ||
"containerimage.digest": "sha256:f9f46b6c57cbe9ccb2686be7e58236e3bfae0942c4be687f0bf16270832f09ab" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ghcr.io/aenix-io/cozystack/cilium:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# syntax=docker/dockerfile:experimental | ||
|
||
ARG VERSION=v1.15.5 | ||
|
||
FROM golang:1.22-bookworm as builder | ||
|
||
WORKDIR /source | ||
|
||
COPY enforce-device-detection.diff /enforce-device-detection.diff | ||
|
||
RUN wget -O- https://github.com/cilium/cilium/archive/refs/tags/v1.15.5.tar.gz | tar xzf - --strip-components=1 | ||
RUN git apply /enforce-device-detection.diff | ||
RUN make build-agent | ||
|
||
FROM quay.io/cilium/cilium:${VERSION} | ||
COPY --from=builder /source/daemon/cilium-agent /usr/bin/cilium-agent |
Oops, something went wrong.