Hello there, I am trying to render yaml without a ...
# kubernetes
m
Hello there, I am trying to render yaml without a cluster present. So far, I am unable to do that as the Kubernetes Provider always tries to connect to the cluster described by my current context. Removing the
.kube/config
file doesn't seem to help either. I've also tried setting
KUBECONFIG
to empty string to no avail. Any pointers are appreciated 🙂
s
I would just run a "noop" cluster locally using kind: https://kind.sigs.k8s.io
m
That's a good option, however I was hoping to not run anything additional since I am running this in CI, which adds to the build time. I will try to use Kind in CI and measure the resulting build times. Thanks for the response! 🙂
I've tried that and it seems to be working, however it does add a minute to my build time. Not huge but it would be nice to be able to have no cluster at all since it's only generating yaml. I am aware this is in developer preview, but it's very useful if you want to be able to distribute your Pulumi stack with yaml
s
m
nope 😐 but that's fine, kind adds a minute to our build process which is not a huge deal and will do for now, I'll keep an eye out for any updates to the provider that would allow such a thing. It's better than being connected to an actual cluster. Thank you 🙂
a
I know we had this issue and resolved it - I've just had a dig through the code to try to work out what we did, we're using the automation API in Golang, using Kubernetes provider 4.18.3, and it's working here when we set
KUBECONFIG
to a nonsense string (we use the word 'unset', fwiw). I'm not sure if it's working here because our setup is different to yours (looks like you're using pulumi CLI with nodejs), but I thought I'd send this on the off chance it's as simple as giving
KUBECONFIG
a nonsense value, rather than an empty string.
m
I'll give that a try, that would be wonderful! TMI we're using Pulumi in Kotlin! via the Java library
Oh yes, I do remember what the problem was. I cannot specify
kubeconfig
with
renderYamlToDirectory
option set:
error: pulumi:providers:kubernetes resource 'yaml-renderer': property kubeconfig value {unset} has a problem: "kubeconfig" arg is not compatible with "renderYamlToDirectory" arg
. Setting
KUBECONFIG
env var to
unset
gives me
invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
. I tried setting
KUBERNETES_MASTER
but that doesn't seem to do anything, I suspect that's what terraform uses to find the kubeconfig?
s
This appears to be a known issue, but I do not know why those two values would be mutually exclusive: https://github.com/pulumi/pulumi-kubernetes/issues/3498