From 78c08f0b978a7fc9c1682aacd736522601f34c1c Mon Sep 17 00:00:00 2001 From: Staffan Olsson Date: Fri, 22 Nov 2024 11:08:25 +0100 Subject: [PATCH] Buildkit statefulset now requires Kubernetes 1.30+; fixes warning --- bin/y-build | 3 ++- buildkit/statefulset.yaml | 12 +++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bin/y-build b/bin/y-build index 7f7b8dde..73fd0ae9 100755 --- a/bin/y-build +++ b/bin/y-build @@ -80,8 +80,9 @@ DEFAULT_REGISTRY=builds-registry.ystack.svc.cluster.local [ -z "$BUILDS_REGISTRY" ] && BUILDS_REGISTRY=$DEFAULT_REGISTRY [ -z "$PUSH_REGISTRY" ] && PUSH_REGISTRY=$DEFAULT_REGISTRY [ -z "$BUILDKIT_HOST" ] && BUILDKIT_HOST=tcp://buildkitd.ystack.svc.cluster.local:8547 +[ -z "$REGISTRY_PROBE_CONNECT_TIMEOUT" ] && REGISTRY_PROBE_CONNECT_TIMEOUT=3 -if [ "$(curl -s --connect-timeout 3 http://$BUILDS_REGISTRY/v2/)" != "{}" ] +if [ "$(curl -s --connect-timeout "$REGISTRY_PROBE_CONNECT_TIMEOUT" http://$BUILDS_REGISTRY/v2/)" != "{}" ] then echo "ERROR Skaffold need local access to the builds registry for digest lookup" echo "Registry: $BUILDS_REGISTRY" diff --git a/buildkit/statefulset.yaml b/buildkit/statefulset.yaml index 5f549eee..a43dcc16 100644 --- a/buildkit/statefulset.yaml +++ b/buildkit/statefulset.yaml @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/yannh/kubernetes-json-schema/refs/heads/master/v1.31.3/statefulset.json # https://github.com/moby/buildkit/blob/master/examples/kube-consistent-hash/buildkitd-rootless-statefulset.yaml apiVersion: apps/v1 kind: StatefulSet @@ -15,14 +16,7 @@ spec: labels: app: buildkitd status: accepts-new-builds - annotations: - container.apparmor.security.beta.kubernetes.io/buildkitd: unconfined spec: - securityContext: - seccompProfile: - type: Unconfined - runAsUser: 1000 - runAsGroup: 1000 containers: - name: buildkitd image: moby/buildkit:rootless @@ -53,6 +47,10 @@ spec: securityContext: runAsUser: 1000 runAsGroup: 1000 + seccompProfile: + type: Unconfined + appArmorProfile: + type: Unconfined volumeMounts: - name: etc-buildkit mountPath: /home/user/.config/buildkit