local-kubernetes provider kubectl issues
# 🌱|help-and-getting-started
f
i'm not able to figure out: - how to get
garden tools kubectl
to select the local-kubernetes provider (vs
Copy code
garden tools local-kubernetes.kubectl')
- not able to get a garden exec action to use the right context without passing
--context=docker-desktop` to kubectl (if that's what's needed, how to reference it from the provider config?)(also, doesn't necessarily work for a kubectl plugin)
c
Hi @future-businessperson-39015, you can specify a context for the local kubernetes provider in the providers configuration of your project Garden yaml. See: https://docs.garden.io/bonsai-0.13/k8s-plugins/local-k8s/configure-provider. If you are shelling out directly to kubectl, you might need to specify it manually. But I am not 100% sure about what you are trying to achieve. Would it be possible for you to copy and paste your actions and project configuration files?
f
you can reference a provider output like namespace: ${providers.kubernetes.outputs.context} but how do you reference the current provider? (will come back to the clarifying question later today)
c
You can access the resolved configuration for a provider with template strings: https://docs.garden.io/bonsai-0.13/reference/template-strings/providers#usd-providers.less-than-provider-name-greater-than.config. So for example, let's say you want to check the build mode for the local-kubernetes provider, you could access it like this:
Copy code
echo ${providers.local-kubernetes.config.buildMode}
Does this help?
f
i assumed i was gonna need to interpolate it in but now that i've specified a context in the provider, i need to test that. will get back to you.
got a little sidetracked while trying to fix something so now that that's fixed i'm onto final sprint story and i can come back to the garden stuff