Skip to content

Commit

Permalink
Buildkit statefulset now requires Kubernetes 1.30+; fixes warning
Browse files Browse the repository at this point in the history
  • Loading branch information
solsson committed Nov 22, 2024
1 parent f061b6f commit 78c08f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion bin/y-build
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 5 additions & 7 deletions buildkit/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 78c08f0

Please sign in to comment.