-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Andrei Kvapil <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added configuration for Kubernetes builder environment - Introduced Talos imager configuration with version v1.8.4 - Implemented garbage collection policies for OCI worker storage management - **Chores** - Updated Makefile to streamline image building process - Added Kubernetes deployment templates for builder sandbox - **Infrastructure** - Created new configuration files for builder package - Enhanced build and deployment workflows <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Andrei Kvapil <[email protected]>
- Loading branch information
Showing
6 changed files
with
105 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
apiVersion: v2 | ||
name: builder | ||
version: 0.0.0 # Placeholder, the actual version will be automatically set during the build process |
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,35 @@ | ||
NAMESPACE=cozy-builder | ||
NAME := builder | ||
|
||
TALOS_VERSION=$(shell awk '/^version:/ {print $$2}' ../installer/images/talos/profiles/installer.yaml) | ||
|
||
include ../../../scripts/common-envs.mk | ||
|
||
help: ## Show this help. | ||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
|
||
show: | ||
helm template -n $(NAMESPACE) $(NAME) . | ||
|
||
apply: ## Create builder sandbox in existing Kubernetes cluster. | ||
helm template -n $(NAMESPACE) $(NAME) . | kubectl apply -f - | ||
docker buildx ls | grep -q '^buildkit-builder*' || docker buildx create \ | ||
--bootstrap \ | ||
--name=buildkit-$(NAME) \ | ||
--driver=kubernetes \ | ||
--driver-opt=namespace=$(NAMESPACE),replicas=1 \ | ||
--platform=linux/amd64 \ | ||
--platform=linux/arm64 \ | ||
--use \ | ||
--config config.toml | ||
|
||
diff: | ||
helm template -n $(NAMESPACE) $(NAME) . | kubectl diff -f - | ||
|
||
delete: ## Remove builder sandbox from existing Kubernetes cluster. | ||
kubectl delete deploy -n $(NAMESPACE) $(NAME)-talos-imager | ||
docker buildx rm buildkit-$(NAME) | ||
|
||
wait-for-builder: | ||
kubectl wait deploy --for=condition=Progressing -n $(NAMESPACE) $(NAME)-talos-imager | ||
kubectl wait pod --for=condition=Ready -n $(NAMESPACE) -l app=$(NAME)-talos-imager |
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,11 @@ | ||
[worker.oci] | ||
gc = true | ||
gckeepstorage = 50000 | ||
|
||
[[worker.oci.gcpolicy]] | ||
keepBytes = 10737418240 | ||
keepDuration = 604800 | ||
filters = [ "type==source.local", "type==exec.cachemount", "type==source.git.checkout"] | ||
[[worker.oci.gcpolicy]] | ||
all = true | ||
keepBytes = 53687091200 |
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,43 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: {{ .Release.Namespace }} | ||
labels: | ||
pod-security.kubernetes.io/enforce: privileged | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ .Release.Name }}-talos-imager | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: {{ .Release.Name }}-talos-imager | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ .Release.Name }}-talos-imager | ||
spec: | ||
automountServiceAccountToken: false | ||
terminationGracePeriodSeconds: 1 | ||
containers: | ||
- name: imagere | ||
image: "{{ .Values.talos.imager.image }}" | ||
securityContext: | ||
privileged: true | ||
command: | ||
- sleep | ||
- infinity | ||
volumeMounts: | ||
- mountPath: /dev | ||
name: dev | ||
volumes: | ||
- hostPath: | ||
path: /dev | ||
type: Directory | ||
name: dev |
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,3 @@ | ||
talos: | ||
imager: | ||
image: ghcr.io/siderolabs/imager:v1.8.4 |
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