-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Add cluster asset to launch an openshift cluster #289
Add cluster asset to launch an openshift cluster #289
Conversation
pkg/asset/cluster/cluster.go
Outdated
return nil, err | ||
} | ||
|
||
data, err := ioutil.ReadFile(state) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/s/state/stateFile
?
As this PR adding an asset called |
ba13be1
to
ee2936b
Compare
b57faed
to
1734560
Compare
Previously, the installer binary generates the ignitions for master and worker nodes, and pass the filename to the terraform. However, in the new installer binary, we will instead pass the content of the ignition files to terraform.
If the "ignition_bootstrap" is non-empty in the terraform.tfvars, then use it as the content for the bootstrap ignition. This will enable the new installer binary to launch a cluster.
This assumes that we ship the installer binary with the same dir as the terraform templates.
The cluster asset invokes terraform binary with the terraform templates and generated tfvars, ignitions, etc to launch a cluster.
Some default values are set the the tfvars if they are missing.
Add default VPCCIDIR, network type, IfName, IPRange, imageURL. Also set different default node numbers for different platform. This is because on libvirt, there's a potential race for the network setup on libvirt platform Also ask users for the libvirt image URL.
ValidateAndLog() will help us to catch some early errors on config generation.
Copy the terraform.tfvars to the working dir for the terraform.
1734560
to
64557d1
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: crawford, yifan-gu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Yeah, I hit that too and opened #316. I worked around it for now by just commenting it out. |
Using Terraform to remove all resources created by the bootstrap modules. For this to work, all platforms must define a bootstrap module (and they all currently do). This command moves the previous destroy-cluster into a new 'destroy cluster' subcommand, because grouping different destroy flavors into sub-commands makes the base command easier to understand. We expect both destroy flavors to be long-running, because it's hard to write generic logic for "is the cluster sufficiently live for us to remove the bootstrap". We don't want to hang forever if the cluster dies before coming up, but there's no solid rules for how long to wait before deciding that it's never going to come up. When we start destroying the bootstrap resources automatically in the future, will pick reasonable timeouts, but will want to still provide callers with the ability to manually remove the bootstrap resources if we happen to fall out of that timeout on a cluster that does eventually come up. I've also created a LoadMetadata helper to share the "retrieve the metadata from the asset directory" logic between the destroy-cluster and destroy-bootstrap logic. The new helper lives in the cluster asset plackage close to the code that determines that file's location. I've pushed the Terraform module unpacking and 'terraform init' call down into a helper used by the Apply and Destroy functions to make life easier on the callers. I've also fixed a path.Join -> filepath.Join typo in Apply, which dates back to ff5a57b (pkg/terraform: Modify some helper functions for the new binary layout, 2018-09-19, openshift#289). These aren't network paths ;).
installer/pkg/workflow
topkg/terraform
cluster
asset that uses thetfvars
asset, terraform templates and terraform binary to launch a clusterclutser
target in the CLI so users can run the CLI to create a cluster.