You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In rules_gitops we assume that host kubectl is available and has appropriate configuration to access the cluster. It is the same assumption made by Bazel rules_k8s.
Is docker run k3s kubectl a literally the command you want to run instead of host kubectl or it is just a way of saying "run some other command"?
Does the Bazel downloaded kubectl binary is an acceptable solution?
The added advantage over a downloaded kubectl binary is that kubectl is always compatible with the k3s node.
That said, it is of course incompatible with deploying on a remote node.
Finally, we used to extract of the kubeconfig.yaml from the container, but the only way was to inject the container id as stamp, so that the genrule would get re-run when the container restarts.
This should be fixed in 1.0.0. You can define your own kubectl_toolchain definition and register it prior to rules_gitops registering default toolchains or by passing to Bazel using --extra_toolchains
Activity
kzadorozhny commentedon Aug 20, 2020
In
rules_gitopswe assume that hostkubectlis available and has appropriate configuration to access the cluster. It is the same assumption made by Bazelrules_k8s.Is
docker run k3s kubectla literally the command you want to run instead of hostkubectlor it is just a way of saying "run some other command"?Does the Bazel downloaded
kubectlbinary is an acceptable solution?steeve commentedon Aug 20, 2020
In rules_k8s, it is possible to override the
kubectlbinary https://github.com/bazelbuild/rules_k8s/tree/master/toolchains/kubectl#download-a-custom-kubectl-binary:This has the advantage for easy swapping of the
kubectlbinary, either by downloading or wrapping (as we do).Actually, I was wrong, it's not
runbutexec: we runkubectlin the same container as thek3snode.Here is our wrapper:
The added advantage over a downloaded
kubectlbinary is thatkubectlis always compatible with thek3snode.That said, it is of course incompatible with deploying on a remote node.
Finally, we used to extract of the
kubeconfig.yamlfrom the container, but the only way was to inject the container id as stamp, so that thegenrulewould get re-run when the container restarts.log context cancellation reasons (adobe#33)
nickschaap commentedon Mar 24, 2026
This should be fixed in 1.0.0. You can define your own
kubectl_toolchaindefinition and register it prior to rules_gitops registering default toolchains or by passing to Bazel using--extra_toolchains