new driver: kubernetes by AkihiroSuda · Pull Request #167 · docker/buildx (original) (raw)
Tested with kind and GKE
TODOs:
- Fix
No Auth Provider found for name "gcp"
error on GKE - Support consistent hashing
- Use watch API instead of polling (maybe follow-up PR)
- Use exec API instead of executing
kubectl
binary - Support rootless
- Support specifying kubeconfig via the current
docker context
- Change driver name from
kube
tokubernetes
fordocker
CLI consistency
Note: "nodes" shown in docker buildx ls
are unrelated to Kubernetes "nodes".
Probably buildx should come up with an alternative term.
Usage:
$ kind create cluster $ export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
$ docker buildx create --driver kubernetes --driver-opt replicas=3 --use $ docker buildx build -t foo --load .
--load
loads the image into the local Docker.
Driver options
image=IMAGE
- Sets the container image to be used for running buildkit.namespace=NS
- Sets the Kubernetes namespace. Defaults to the current namespace.replicas=N
- Sets the number ofPod
replicas. Defaults to 1.rootless=(true|false)
- Run the container as a non-root user withoutsecurityContext.privileged
. Using Ubuntu host kernel is recommended. Defaults to false.loadbalance=(sticky|random)
- Load-balancing strategy. If set to "sticky", the pod is chosen using the hash of the context path. Defaults to "sticky"
Signed-off-by: Akihiro Suda akihiro.suda.cz@hco.ntt.co.jp
Close #22