File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ build: build-deps
2626 make -C packages/system/bucket image
2727 make -C packages/system/objectstorage-controller image
2828 make -C packages/core/testing image
29+ make -C packages/core/platform image
2930 make -C packages/core/installer image
3031 make manifests
3132
Original file line number Diff line number Diff line change @@ -26,10 +26,6 @@ WORKDIR /src
2626
2727RUN go mod download
2828
29- RUN go build -o /cozystack-assets-server -ldflags '-extldflags "-static" -w -s' ./cmd/cozystack-assets-server
30-
31- RUN make repos
32-
3329FROM alpine:3.22
3430
3531RUN wget -O- https://github.com/cozystack/cozypkg/raw/refs/heads/main/hack/install.sh | sh -s -- -v 1.2.0
@@ -39,10 +35,7 @@ RUN apk add --no-cache make kubectl helm coreutils git jq
3935COPY --from=builder /src/scripts /cozystack/scripts
4036COPY --from=builder /src/packages/core /cozystack/packages/core
4137COPY --from=builder /src/packages/system /cozystack/packages/system
42- COPY --from=builder /src/_out/repos /cozystack/assets/repos
43- COPY --from=builder /cozystack-assets-server /usr/bin/cozystack-assets-server
4438COPY --from=k8s-await-election-builder /k8s-await-election /usr/bin/k8s-await-election
45- COPY --from=builder /src/dashboards /cozystack/assets/dashboards
4639
4740WORKDIR /cozystack
4841ENTRYPOINT ["/usr/bin/k8s-await-election" , "/cozystack/scripts/installer.sh" ]
Original file line number Diff line number Diff line change @@ -68,33 +68,10 @@ spec:
6868 valueFrom :
6969 fieldRef :
7070 fieldPath : metadata.name
71- - name : assets
72- image : " {{ .Values.cozystack.image }}"
73- command :
74- - /usr/bin/cozystack-assets-server
75- - " -dir=/cozystack/assets"
76- - " -address=:8123"
77- ports :
78- - name : http
79- containerPort : 8123
8071 tolerations :
8172 - key : " node.kubernetes.io/not-ready"
8273 operator : " Exists"
8374 effect : " NoSchedule"
8475 - key : " node.cilium.io/agent-not-ready"
8576 operator : " Exists"
8677 effect : " NoSchedule"
87- ---
88- apiVersion : v1
89- kind : Service
90- metadata :
91- name : cozystack
92- namespace : cozy-system
93- spec :
94- ports :
95- - name : http
96- port : 80
97- targetPort : 8123
98- selector :
99- app : cozystack
100- type : ClusterIP
Original file line number Diff line number Diff line change 11NAME =platform
22NAMESPACE =cozy-system
33
4+ include ../../../scripts/common-envs.mk
5+
46show :
57 cozypkg show -n $(NAMESPACE ) $(NAME ) --plain
68
@@ -18,3 +20,15 @@ namespaces-apply:
1820
1921diff :
2022 cozypkg show -n $(NAMESPACE ) $(NAME ) --plain | kubectl diff -f-
23+
24+ image : image-assets
25+ image-assets :
26+ docker buildx build -f images/cozystack-assets/Dockerfile ../../.. \
27+ --tag $(REGISTRY ) /cozystack-assets:$(call settag,$(TAG ) ) \
28+ --cache-from type=registry,ref=$(REGISTRY ) /cozystack-assets:latest \
29+ --cache-to type=inline \
30+ --metadata-file images/cozystack-assets.json \
31+ $(BUILDX_ARGS )
32+ IMAGE=" $( REGISTRY) /cozystack-assets:$( call settag,$( TAG) ) @$$ (yq e '." containerimage.digest" ' images/cozystack-assets.json -o json -r)" \
33+ yq -i ' .assets.image = strenv(IMAGE)' values.yaml
34+ rm -f images/cozystack-assets.json
Original file line number Diff line number Diff line change 1+ FROM golang:1.24-alpine AS builder
2+
3+ ARG TARGETOS
4+ ARG TARGETARCH
5+
6+ RUN apk add --no-cache make git
7+ RUN apk add helm --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
8+
9+ COPY . /src/
10+ WORKDIR /src
11+
12+ RUN go mod download
13+
14+ RUN go build -o /cozystack-assets-server -ldflags '-extldflags "-static" -w -s' ./cmd/cozystack-assets-server
15+
16+ RUN make repos
17+
18+ FROM alpine:3.22
19+
20+ COPY --from=builder /src/_out/repos /cozystack/assets/repos
21+ COPY --from=builder /cozystack-assets-server /usr/bin/cozystack-assets-server
22+ COPY --from=builder /src/dashboards /cozystack/assets/dashboards
23+
24+ WORKDIR /cozystack
25+ ENTRYPOINT ["/usr/bin/cozystack-assets-server" ]
Original file line number Diff line number Diff line change 1+ apiVersion : apps/v1
2+ kind : StatefulSet
3+ metadata :
4+ name : cozystack-assets
5+ namespace : cozy-system
6+ labels :
7+ app : cozystack-assets
8+ spec :
9+ serviceName : cozystack-assets
10+ replicas : 1
11+ selector :
12+ matchLabels :
13+ app : cozystack-assets
14+ template :
15+ metadata :
16+ labels :
17+ app : cozystack-assets
18+ spec :
19+ hostNetwork : true
20+ containers :
21+ - name : assets-server
22+ image : " {{ .Values.assets.image }}"
23+ args :
24+ - " -dir=/cozystack/assets"
25+ - " -address=:8123"
26+ ports :
27+ - name : http
28+ containerPort : 8123
29+ hostPort : 8123
30+ tolerations :
31+ - operator : Exists
32+ ---
33+ apiVersion : rbac.authorization.k8s.io/v1
34+ kind : Role
35+ metadata :
36+ name : cozystack-assets-reader
37+ namespace : cozy-system
38+ rules :
39+ - apiGroups : [""]
40+ resources :
41+ - pods/proxy
42+ resourceNames :
43+ - cozystack-assets-0
44+ verbs :
45+ - get
46+ - create
47+ - update
48+ ---
49+ apiVersion : rbac.authorization.k8s.io/v1
50+ kind : RoleBinding
51+ metadata :
52+ name : cozystack-assets-reader
53+ namespace : cozy-system
54+ subjects :
55+ - kind : User
56+ name : cozystack-assets-reader
57+ apiGroup : rbac.authorization.k8s.io
58+ roleRef :
59+ kind : Role
60+ name : cozystack-assets-reader
61+ apiGroup : rbac.authorization.k8s.io
62+ ---
63+ apiVersion : v1
64+ kind : Service
65+ metadata :
66+ name : cozystack-assets
67+ namespace : cozy-system
68+ spec :
69+ ports :
70+ - name : http
71+ port : 80
72+ targetPort : 8123
73+ selector :
74+ app : cozystack-assets
75+ type : ClusterIP
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ metadata:
88 cozystack.io/repository : system
99spec :
1010 interval : 5m0s
11- url : http://cozystack.cozy-system.svc/repos/system
11+ url : http://cozystack-assets .cozy-system.svc/repos/system
1212---
1313apiVersion : source.toolkit.fluxcd.io/v1
1414kind : HelmRepository
@@ -20,7 +20,7 @@ metadata:
2020 cozystack.io/repository : apps
2121spec :
2222 interval : 5m0s
23- url : http://cozystack.cozy-system.svc/repos/apps
23+ url : http://cozystack-assets .cozy-system.svc/repos/apps
2424---
2525apiVersion : source.toolkit.fluxcd.io/v1
2626kind : HelmRepository
@@ -31,4 +31,4 @@ metadata:
3131 cozystack.io/repository : extra
3232spec :
3333 interval : 5m0s
34- url : http://cozystack.cozy-system.svc/repos/extra
34+ url : http://cozystack-assets .cozy-system.svc/repos/extra
Original file line number Diff line number Diff line change 1+ assets :
2+ image : ghcr.io/cozystack/cozystack/cozystack-assets:latest@sha256:19b166819d0205293c85d8351a3e038dc4c146b876a8e2ae21dce1d54f0b9e33
Original file line number Diff line number Diff line change 1111 instanceSelector :
1212 matchLabels :
1313 dashboards : grafana
14- url : http://cozystack.cozy-system.svc/dashboards/{{ . }}.json
14+ url : http://cozystack-assets .cozy-system.svc/dashboards/{{ . }}.json
1515{{- end }}
1616{{- end }}
You can’t perform that action at this time.
0 commit comments