Skip to content

Commit 8eabe30

Browse files
authored
[platform] Use cozypkg instead of helm (#1057)
Signed-off-by: Andrei Kvapil <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced the use of the CozyPkg tool for package deployment and management, replacing previous Helm-based workflows across installer, platform, and system components. - **Refactor** - Updated Makefiles and scripts to use CozyPkg commands for showing, applying, diffing, suspending, resuming, and deleting packages. - Removed dynamic API version handling and simplified deployment command structures. - **Chores** - Updated Docker images to newer base versions and included CozyPkg installation steps. - Changed installer image references to use the latest available build. - Removed obsolete scripts and dependencies related to Helm and Kustomize. - Consolidated package installations and updated tooling in Dockerfiles for improved efficiency. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 0c9c688 + 908c759 commit 8eabe30

11 files changed

Lines changed: 33 additions & 74 deletions

File tree

‎packages/core/installer/Makefile‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,20 @@ pre-checks:
99
../../../hack/pre-checks.sh
1010

1111
show:
12-
helm template -n $(NAMESPACE) $(NAME) .
12+
cozypkg show -n $(NAMESPACE) $(NAME) --plain
1313

1414
apply:
15-
helm template -n $(NAMESPACE) $(NAME) . | kubectl apply -f -
15+
cozypkg show -n $(NAMESPACE) $(NAME) --plain | kubectl apply -f-
1616

1717
diff:
18-
helm template -n $(NAMESPACE) $(NAME) . | kubectl diff -f -
18+
cozypkg show -n $(NAMESPACE) $(NAME) --plain | kubectl diff -f -
1919

2020
update:
2121
hack/gen-profiles.sh
2222

2323
image: pre-checks image-matchbox image-cozystack image-talos
2424

2525
image-cozystack:
26-
make -C ../../.. repos
2726
docker buildx build -f images/cozystack/Dockerfile ../../.. \
2827
--provenance false \
2928
--tag $(REGISTRY)/installer:$(call settag,$(TAG)) \
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:alpine3.21 as k8s-await-election-builder
1+
FROM golang:1.24-alpine as k8s-await-election-builder
22

33
ARG K8S_AWAIT_ELECTION_GITREPO=https://github.com/LINBIT/k8s-await-election
44
ARG K8S_AWAIT_ELECTION_VERSION=0.4.1
@@ -13,34 +13,37 @@ RUN git clone ${K8S_AWAIT_ELECTION_GITREPO} /usr/local/go/k8s-await-election/ \
1313
&& make \
1414
&& mv ./out/k8s-await-election-${TARGETARCH} /k8s-await-election
1515

16-
FROM golang:alpine3.21 as builder
16+
FROM golang:1.24-alpine as builder
17+
18+
ARG TARGETOS
19+
ARG TARGETARCH
1720

1821
RUN apk add --no-cache make git
1922
RUN apk add helm --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
2023

2124
COPY . /src/
2225
WORKDIR /src
2326

27+
RUN go mod download
28+
2429
RUN go build -o /cozystack-assets-server -ldflags '-extldflags "-static" -w -s' ./cmd/cozystack-assets-server
2530

26-
# Check that versions_map is not changed
2731
RUN make repos
2832

29-
FROM alpine:3.21
33+
FROM alpine:3.22
34+
35+
RUN wget -O- https://github.com/cozystack/cozypkg/raw/refs/heads/main/hack/install.sh | sh -s
3036

31-
RUN apk add --no-cache make
32-
RUN apk add helm kubectl --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
33-
RUN apk add yq
34-
RUN apk add coreutils
37+
RUN apk add --no-cache make kubectl coreutils
3538

36-
COPY scripts /cozystack/scripts
39+
COPY --from=builder /src/scripts /cozystack/scripts
3740
COPY --from=builder /src/packages/core /cozystack/packages/core
3841
COPY --from=builder /src/packages/system /cozystack/packages/system
3942
COPY --from=builder /src/_out/repos /cozystack/assets/repos
4043
COPY --from=builder /src/_out/logos /cozystack/assets/logos
4144
COPY --from=builder /cozystack-assets-server /usr/bin/cozystack-assets-server
4245
COPY --from=k8s-await-election-builder /k8s-await-election /usr/bin/k8s-await-election
43-
COPY dashboards /cozystack/assets/dashboards
46+
COPY --from=builder /src/dashboards /cozystack/assets/dashboards
4447

4548
WORKDIR /cozystack
4649
ENTRYPOINT ["/usr/bin/k8s-await-election", "/cozystack/scripts/installer.sh" ]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
cozystack:
2-
image: ghcr.io/cozystack/cozystack/installer:v0.32.0-beta.1@sha256:57e449187e4f76c3346de7646b4fe11c7136e63216b05ebd7171f8fd5cb077d2
2+
image: ghcr.io/cozystack/cozystack/installer:latest@sha256:dedc7de5cd01f4b1336a4ff935ffc6600a52f63cdc020163dd9d35bf71373380

‎packages/core/platform/Makefile‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
NAME=platform
22
NAMESPACE=cozy-system
33

4-
API_VERSIONS_FLAGS=$(addprefix -a ,$(shell kubectl api-versions))
5-
64
show:
7-
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server $(API_VERSIONS_FLAGS)
5+
cozypkg show -n $(NAMESPACE) $(NAME) --plain
86

97
apply:
10-
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server $(API_VERSIONS_FLAGS) \
11-
| kubectl apply -f-
8+
cozypkg show -n $(NAMESPACE) $(NAME) --plain | kubectl apply -f-
129
kubectl delete helmreleases.helm.toolkit.fluxcd.io -l cozystack.io/marked-for-deletion=true -A
1310

1411
reconcile: apply
1512

1613
namespaces-show:
17-
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server $(API_VERSIONS_FLAGS) -s templates/namespaces.yaml
14+
cozypkg show -n $(NAMESPACE) $(NAME) --plain -s templates/namespaces.yaml
1815

1916
namespaces-apply:
20-
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server $(API_VERSIONS_FLAGS) -s templates/namespaces.yaml | kubectl apply -n $(NAMESPACE) -f-
17+
cozypkg show -n $(NAMESPACE) $(NAME) --plain -s templates/namespaces.yaml | kubectl apply -f-
2118

2219
diff:
23-
helm template -n $(NAMESPACE) $(NAME) . --dry-run=server $(API_VERSIONS_FLAGS) | kubectl diff -f-
20+
cozypkg show -n $(NAMESPACE) $(NAME) --plain | kubectl diff -f-

‎packages/core/testing/images/e2e-sandbox/Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ RUN curl -sSL "https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm
1717
RUN curl -sSL "https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_${TARGETOS}_${TARGETARCH}" -o /usr/local/bin/yq \
1818
&& chmod +x /usr/local/bin/yq
1919
RUN curl -sSL "https://fluxcd.io/install.sh" | bash
20+
RUN curl -sSL "https://github.com/cozystack/cozypkg/raw/refs/heads/main/hack/install.sh" | sh -s

‎packages/system/cozystack-api/images/cozystack-api/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23-alpine AS builder
1+
FROM golang:1.24-alpine AS builder
22

33
ARG TARGETOS
44
ARG TARGETARCH

‎packages/system/cozystack-controller/images/cozystack-controller/Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23-alpine AS builder
1+
FROM golang:1.24-alpine AS builder
22

33
ARG TARGETOS
44
ARG TARGETARCH

‎packages/system/fluxcd-operator/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ NAMESPACE=cozy-fluxcd
44
include ../../../scripts/package.mk
55

66
apply-locally:
7-
helm upgrade -i -n $(NAMESPACE) $(NAME) .
7+
cozypkg apply --plain -n $(NAMESPACE) $(NAME)
88

99
update:
1010
rm -rf charts

‎packages/system/fluxcd/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ NAMESPACE=cozy-$(NAME)
44
include ../../../scripts/package.mk
55

66
apply-locally:
7-
helm upgrade -i -n $(NAMESPACE) $(NAME) .
7+
cozypkg apply --plain -n $(NAMESPACE) $(NAME)
88

99
update:
1010
rm -rf charts

‎scripts/fluxcd-kustomize.sh‎

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

0 commit comments

Comments
 (0)