What do you mean by k8s-native? I don’t see anything in buildkit/buildx that does not support running in k8s. I have managed to get a build and push working using the the guide I linked to in my original question.
I currently have a separate k8s cluster where I have one jenkins per project running in its own namespace.
Since buildkit its designed to run as a daemon/service my plan is to deploy one instance per jenkins/namespace and then figure out how much diskspace, mem/cpu it needs to perform ok.
But still looking for recommendations on best practices for using buildkit/buildx and multiple jenkins instances running in k8s.
Knew this is an old thread. But still posting for fellow enthusiasts
You can simply deploy docker buildkit per namespace. Install docker buildx plugin in your jenkins agents. then for every build that builds and pushes images, you can create a docker buildx remote context. then build & push altogether.
Install buildx plugin within your docker agent container
apt install docker-buildx-plugin
Within your declarative/scripted pipeline
stage('Build') {
steps {
sh """
docker login -u ${DOCKER_UNAME} -p ${DOCKER_PWD}
# Buildkit deployed as a statefulset in kubernetes in namespace ci
docker buildx create --use --name builder --driver remote tcp://buildkitd-0.buildkitd.ci.svc:1234
docker buildx build --push -f ${dockerFile} -t ${repo}:${imageTag} .
"""
}
}