-
Notifications
You must be signed in to change notification settings - Fork 988
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
Kube Persistent Volumes - Create successful, refresh state fails #168
Comments
The refresh logs show it tried to reach the master at localhost:
Did you try to create the GKE cluster and the kubernetes resources in the same run (i.e. without specifying If so, the kubernetes provider couldn't be initialized in the first pass. Also, I'd recommend to define Edit: does not seem to be the issue here given the |
In one terraform apply from nothing in the gcloud project it seems to correctly
If I'm understanding you correctly, a single |
In a single run, the kubernetes provider cannot be properly initialized as the GKE cluster does not exist yet. The current workarounds are:
|
Also related: hashicorp/terraform#12869 |
It is possible to provision both the GKE and Kubernetes resources within this cluster in a single Terraform run. See this example https://www.terraform.io/docs/providers/google/d/datasource_client_config.html#example-usage-configure-kubernetes-provider-with-oauth2-access-token on how to configure the Kubernetes provider with an IAM access token. |
Re-read the apply logs, it does seem to create the kubernetes PV properly (not sure in which cluster though). In #144 (comment):
No longer sure what's going on now. |
@dominik-lekse this example is referencing the GKE cluster from a datasource. |
What is working
What isn't working
I'm currently running this in a docker container, so unless kube is coming up with a default (such as 127.0.0.1), it's definetly not picking up an existing .kube/config. |
Anyone know of an example with terraform + kube + gcloud + persistent volumes working? Maybe I can work backward. |
Well, seems to be working today. Removed and re-created cluster entirely (again). Afaik nothing changed in terms of versions etc though. Not sure what changed that caused it to be fixed. |
Terraform Version
Terraform v0.11.7
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
The initial creation of the persistent volume is successful. (this log doesn't contain an error)
https://gist.github.com/jimmiebtlr/63daa0e4aba22189834d22468b95ad4d
The error occurs during apply after the resource has been created (I believe during the "refresh" step). (This log contains the error)
https://gist.github.com/jimmiebtlr/638610476884d98adb48b247c0088b38
Panic Output
No panic
Expected Behavior
Re-apply finds everything is created and looks good. No op.
Actual Behavior
Re-apply has trouble finding the resource and returns an error.
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply
terraform apply
Important Factoids
Nothing unusual.
References
None that I've found.
The text was updated successfully, but these errors were encountered: