-
Notifications
You must be signed in to change notification settings - Fork 1.5k
pkg/asset/ignition: add initial implementation #206
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
pkg/asset/ignition: add initial implementation #206
Conversation
|
I dunno how much work this would be, so feel free to tell me it's too much, but it would be nice if we used these generators in the old installer as gradual replacements for
That way we keep the asset templating DRY and ensure the Go-generated assets are covered by CI while we work up the next-gen installer. |
|
@wking I think there is a lot of value in what you are proposing. I wonder how close we are to completing the switch to use |
It doesn't have to be all-or-nothing, does it? I think we can replace the old-style asset generation per-asset as we get new-style replacements. |
|
@staebler Could you split the PR into separate commits for easier reviewing? |
pkg/ignition/config.go
Outdated
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.
This can all be collapsed into the following line:
i.Storage.Files = append(i.Storage.Files, files...)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.
Of course. That was pretty boneheaded of me.
pkg/ignition/config.go
Outdated
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.
Same as above.
pkg/ignition/file.go
Outdated
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.
Why not just import all of the Ignition types?
pkg/ignition/config.go
Outdated
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.
Please import the Ignition config package and use the MaxVersion from there.
pkg/asset/ignition/commonsystemd.go
Outdated
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.
These files are no longer in the installer repo.
pkg/asset/ignition/node.go
Outdated
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.
No longer present.
pkg/asset/ignition/node.go
Outdated
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.
This is potentially going away with #187.
pkg/asset/ignition/master.go
Outdated
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.
This should be read from the install config.
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.
@staebler Why are these etcd templates part of the ignition assets?
|
@staebler The ignition files are owned by MachineConfigOperator for masters and workers. The installer only creates ignition configs that point to cluster ignition server... the installer currently creates ignition configs using this code for masters and worker: |
|
@abhinavdahiya OK. Good to know. I had it in my head that the installer was going to pass to the MCO the final ignition configs for the masters and workers. |
pkg/asset/ignition/bootstrap.go
Outdated
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.
You can use the util package to do this.
pkg/asset/ignition/bootstrap.go
Outdated
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.
I thought this was dropped as well.
cmd/openshift-install/main.go
Outdated
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.
I prefer to use the following to indicate that the variable hasn't been assigned:
var targetAssets []asset.Asset
pkg/asset/ignition/bootstrap.go
Outdated
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.
"tlsCertDirectory is the directory on the bootstrap node..."
pkg/asset/ignition/bootstrap.go
Outdated
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.
The username must be core.
pkg/asset/ignition/bootstrap.go
Outdated
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.
Why does this default to one?
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.
That is what the documentation here says the default is.
pkg/asset/ignition/node.go
Outdated
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.
This has been removed.
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.
We aren't running shellcheck on these templates, so these comments can be removed.
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.
This has been removed.
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.
This has been removed.
pkg/asset/ignition/bootstrap.go
Outdated
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.
"certs" -> "assets", since we also store keys in this directory.
pkg/asset/ignition/bootstrap.go
Outdated
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.
Do we want to address these in this PR? If not, I'd recommend dropping addBootstrapConfigFilesToIgnitionConfig completely and coming back around to these in follow-up work if/when we decide we need them.
pkg/asset/ignition/bootstrap.go
Outdated
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.
Why don't we just use the HyperkubeImage instead of KubeletImageURL and KubeletImageTag ?
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.
Actually KubeletImage* are not being used.
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.
It's actually not used anywhere... I thought Go warned about unused stuff.
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.
pkg/asset/ignition/bootstrap.go
Outdated
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.
all these functions should be under installconfig's package?
pkg/asset/ignition/node.go
Outdated
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.
same thing; installconfig package
pkg/asset/ignition/node.go
Outdated
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.
defaultIgnitionConfig / baseIgnitionConfig ?
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.
How about pointerIgnitionConfig?
|
/lint |
openshift-ci-robot
left a comment
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.
@abhinavdahiya: 9 warnings.
Details
In response to this:
/lint
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
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.
Golint comments: should have a package comment, unless it's in another file for this package. More info.
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.
Golint comments: should have a package comment, unless it's in another file for this package. More info.
pkg/asset/ignition/worker.go
Outdated
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.
Golint comments: should have a package comment, unless it's in another file for this package. More info.
pkg/asset/ignition/node.go
Outdated
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.
Golint comments: should have a package comment, unless it's in another file for this package. More info.
pkg/asset/ignition/bootstrap.go
Outdated
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.
Golint comments: should have a package comment, unless it's in another file for this package. More info.
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.
Golint comments: exported function ClusterDNSIP should have comment or be unexported. More info.
pkg/asset/ignition/stock.go
Outdated
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.
Golint comments: should have a package comment, unless it's in another file for this package. More info.
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.
Golint comments: should have a package comment, unless it's in another file for this package. More info.
pkg/asset/ignition/master.go
Outdated
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.
Golint comments: should have a package comment, unless it's in another file for this package. More info.
|
Why don't we run lint by default? EDIT: We do, we just run it with different settings than |
abhinavdahiya
left a comment
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.
/lgtm
This looks super neat, tests are pretty nice.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, staebler The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
https://jira.coreos.com/browse/CORS-765
This generates the worker and master ignition config files that are generated by the tectonic node controller and the bootstrap ignition config file generated by the assets step.
The bootstrap ignition config file is missing manifest files that will come from dependent assets that have not yet been implemented.