Skip to content

Conversation

@staebler
Copy link
Contributor

@staebler staebler commented Sep 5, 2018

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.

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 5, 2018
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 5, 2018
@wking
Copy link
Member

wking commented Sep 6, 2018

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 steps/assets. Something like:

  1. Update installer/installer/pkg/workflow/install.go to create assets with the pkg/asset tooling (in a generateAssetsStep?.
  2. Update modules/bootkube/assets.tf and similar to slurp the generated files into the existing Terraform workflow.

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.

@staebler
Copy link
Contributor Author

staebler commented Sep 7, 2018

@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 pkg/assets for everything, though.

@wking
Copy link
Member

wking commented Sep 7, 2018

I wonder how close we are to completing the switch to use pkg/assets for everything, though.

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.

@yifan-gu
Copy link
Contributor

@staebler Could you split the PR into separate commits for easier reviewing?

@staebler staebler changed the title WIP: Add assets for generating the ignition config files Add assets for generating the ignition config files Sep 11, 2018
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 11, 2018
Copy link
Contributor

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...)

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No longer present.

Copy link
Contributor

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.

Copy link
Contributor

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.

@openshift-bot openshift-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 11, 2018
Copy link
Contributor

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?

@abhinavdahiya
Copy link
Contributor

abhinavdahiya commented Sep 11, 2018

@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:
https://github.com/openshift/installer/blob/master/installer/pkg/config-generator/ignition.go

@staebler
Copy link
Contributor Author

@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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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

Copy link
Contributor

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..."

Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been removed.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been removed.

Copy link
Member

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.

Copy link
Member

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.

@crawford crawford changed the title Add assets for generating the ignition config files pkg/assetlignition: add initial implementation Sep 14, 2018
@crawford crawford dismissed their stale review September 14, 2018 19:52

I made my changes directly.

Copy link
Contributor

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 ?

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same thing; installconfig package

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaultIgnitionConfig / baseIgnitionConfig ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about pointerIgnitionConfig?

@abhinavdahiya
Copy link
Contributor

/lint

Copy link
Contributor

@openshift-ci-robot openshift-ci-robot left a 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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

@crawford
Copy link
Contributor

crawford commented Sep 14, 2018

Why don't we run lint by default?

EDIT: We do, we just run it with different settings than /lint.

@abhinavdahiya abhinavdahiya changed the title pkg/assetlignition: add initial implementation pkg/asset/ignition: add initial implementation Sep 14, 2018
Copy link
Contributor

@abhinavdahiya abhinavdahiya left a 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.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2018
@openshift-ci-robot
Copy link
Contributor

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [abhinavdahiya,staebler]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants