-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provider does not connect to kubernetes cluster #43
Comments
I haven't debugged this yet and haven't tried 0.13 either. But I've seen this error before when the namespace did not exist. Also, unlike Let me know if any of this fixed it for you, if so, next step would probably be to see if the error message can be improved. If not, we're back to square one and I need to do some debugging. |
Thanks for the reply @pst! But to answer my own question, I suffer from hashicorp/terraform#3536. The git clone https://github.com/kbst/terraform-provider-kustomize.git
cd terraform-provider-kustomize
export CGO_ENABLED=1
make release-binaries
extract and copy the plugin to ~/.terraform.d/plugins/local/setup/kustomization/0.0.1/darwin_amd64/terraform-provider-kustomization I'm not very familiar with Go and don't know the implications of setting the |
I'm on linux and have no access to a Mac. If I export this, the
I'm no Go expert either, but it seems to be related to cross-compiling. |
One idea could be to build using Github Actions, which if I am not mistaken does support Linux, Mac and Windows nodes. |
Correct! I'm currently looking into https://hub.docker.com/r/dockercore/golang-cross and https://github.com/elastic/golang-crossbuild to use a special docker container for cross compilation with CGO enabled. That might be a little bit easier as it removes the need for a macos / windows machine :). I'll let you know if that approach works! |
I've had success with the following git clone https://github.com/kbst/terraform-provider-kustomize.git
go get github.com/crazy-max/xgo
xgo --targets=darwin/amd64 terraform-provider-kustomize It produces a binary with CGO included fixing macos dns issues 🎉. The |
I'll look into changing the pipeline to use this or the image. |
A related fix, do not retry for minutes if the root cause is a connection error. #49 |
Regarding the CGO thing, I have been approved to publish this provider on the Terraform registry. Working towards this, Hashicorp suggests to use Goreleaser with the following config which explicitly disables CGO and states it doesn't work with Goreleaser or Terraform Cloud. Not knowing enough about Go and CGO I'll stick with the Hashicorp defaults for this, which unfortunately means I can't provide releases that work for your use-case. How do you use other providers, e.g. the AWS provider? |
Re-compiling all the providers with CGO_ENABLED=1 😓, which is not great. So I stumbled on this tool https://github.com/greenboxal/dns-heaven which fixes the problem of DNS resolution on macos for golang programs for me 🎉. Really nice as I can now finally use providers from the Terraform registry! |
The
kustomization
provider does not seem to connect to my kubernetes cluster. After doing apply it always fails after 21 retries. I've tried updating theKUBE_CONFIG
andKUBECONFIG
environment variables to correct and incorrect configurations, but the output is always the same. Same for thekubeconfig_path
,kubeconfig_raw
andcontext
variables, setting them to either correct or incorrect settings yields the same not-working result.The setup is pretty basic:
terraform apply output
Terraform version: v0.13.0
terraform-provider-kustomize version: 0.2.0-beta
kubectl version: 1.17.0
kubernetes version: 1.18.8
OS: macos 10.15.6 (Catalina)
The text was updated successfully, but these errors were encountered: