Skip to content
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

Output variables are available before nodes are up #212

Closed
kevensen opened this issue Jul 22, 2019 · 14 comments
Closed

Output variables are available before nodes are up #212

kevensen opened this issue Jul 22, 2019 · 14 comments
Labels
enhancement New feature or request

Comments

@kevensen
Copy link
Contributor

In most (if not all) cases, the output variables are available before the nodes of the cluster are up. For example, the endpoint variable is populated as soon as it is known to Terraform (makes sense).

It would be helpful to not populate these variables until the nodes are up in a node pool. Or add an output variable that is along the lines of pods_schedualable to provide a check whether or not other resources can be deployed in the cluster.

@morgante
Copy link
Contributor

I don't know if this is possible from the API endpoint.

@aaron-lane aaron-lane added the enhancement New feature or request label Jul 22, 2019
@kevensen
Copy link
Contributor Author

Would love feedback on this thought. The GKE REST API provides a status in the response object. Would it be reasonable to set a variable (e.g. module.gke.ready) if the state is RUNNING?

@kevensen
Copy link
Contributor Author

Or have the output variable be module.gke.state?

@morgante
Copy link
Contributor

One of the issues is that I think the cluster actually slips between RUNNING and RECONCILING as it spins up node pools so we can't simply wait for it to become 'RUNNING' the first time.

@kevensen
Copy link
Contributor Author

boo

@morgante
Copy link
Contributor

That being said, I think added depends_on to the outputs similar to the internal dependencies should help make this a bit better: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/masq.tf#L43

@kevensen
Copy link
Contributor Author

How would that work?

output variable --> [triggered in] --> null resource --> [depends on] --> all that

@kevensen
Copy link
Contributor Author

@morgante
Copy link
Contributor

Yeah, do you think you could open a PR?

@kevensen
Copy link
Contributor Author

I am working on it as we speak

@kevensen
Copy link
Contributor Author

I am thinking of making the endpoint output variable "depend on" these resources. Do you think we ought make another variable?

@morgante
Copy link
Contributor

Probably all the variables should, but you can start with whichever ones are important for your use case.

@kevensen
Copy link
Contributor Author

understood.

@kevensen
Copy link
Contributor Author

merged and closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants