buildx icon indicating copy to clipboard operation
buildx copied to clipboard

Allow specifying context for kubernetes driver

Open corevo opened this issue 2 years ago • 0 comments

Description

Currently the kubernetes driver searches for the builder deployments in the namespace in the current context.

Instead it should support looking for the deployments in a named context.

This would allow a use case where the current context is the application context, and a different context can be used strictly for builders.

For example we can do it by specifying the context name in the kuberenetes endpoint like so

kubernetes://context-name/kube?deployment=builder-amd64\u0026kubeconfig=

Or in the driver options

"DriverOpts":{"context":"context-name","namespace":"buildkit","nodeselector":"kubernetes.io/arch=arm64"}

EDIT: I know that I can specify a separate config file which will only contain the builder context, but I rather use the default config with all my contexts, currently that is the workaround that I use.

corevo avatar Oct 03 '23 08:10 corevo