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

machines: add the authorized keys for a pool using a machine config #1150

Merged
merged 5 commits into from
Mar 27, 2019

Conversation

abhinavdahiya
Copy link
Contributor

@abhinavdahiya abhinavdahiya commented Jan 30, 2019

cluster-config-v1 is being deprecated in favor of global configs (#680) and Machine Config Operator needs to drop using the SSHKey in install-config to setup the SSHAuthorizedKeys for core user.

This pushes a machineconfig with the SSHAuthorizedKeys sourced from here for each machinepool, so that Machine Config Operator can drop generating the machineconfig using the cluster-config-v1 config map in the cluster.

/cc @crawford

@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Jan 30, 2019
@cgwalters
Copy link
Member

Can you elaborate in the commit message why we're making this change, what problem it's solving?

This is basically the inverse of the existing MCO ssh key support - the installer uses its own config to inject MC objects, rather than the MCO scraping the install config and generating MC fragments. Are we going forward with both of these approaches?

@wking
Copy link
Member

wking commented Jan 30, 2019

Can you elaborate in the commit message why we're making this change, what problem it's solving?

It would be good to mention #680 and cluster-config-v1 deprecation.

@abhinavdahiya
Copy link
Contributor Author

Can you elaborate in the commit message why we're making this change, what problem it's solving?

with 5c4dac6 -> 87f5c3d

i have tried to add the why.

Also created openshift/machine-config-operator#356 that drops creating machineconfig with ssh key

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 1, 2019
@runcom
Copy link
Member

runcom commented Mar 25, 2019

@abhinavdahiya can you rebase this so we can get it in along with openshift/machine-config-operator#356

@sdodson
Copy link
Member

sdodson commented Mar 25, 2019

Lets make sure we summarize the why in the PR description before this merges. Even if that's just a copy of the non vendor commit.

@wking
Copy link
Member

wking commented Mar 25, 2019

I've updated the PR topic post.

@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 25, 2019
@abhinavdahiya
Copy link
Contributor Author

abhinavdahiya commented Mar 25, 2019

5412e88 ... 3ad4777 is extracted from #1392 modified-local-branch to reuse the plumbing that we need to push machineconfig for hyperthreading...

/cc @staebler

abhinavdahiya added a commit to abhinavdahiya/machine-config-operator that referenced this pull request Mar 26, 2019
Users can push manifests during bootstrap that of the form:

```yaml
---
```

Especially for the installer: setting authorizes_keys [1] and setting hyperthreading [2] will push a manifest that includes multiple machineconfig objects for
control-plane (master) and compute (worker) roles.

Single file with multiple k8s objects separated by `---` is also a supported structure for `oc create|apply` ie. there is a high chance that users trying to push machineconfigs at
install time might create such files.

This commit allows bootstrap controller to read all k8s objects, even ones described above to find all the `machineconfiguration.openshift.io` Objects.

[1]: openshift/installer#1150
[2]: openshift/installer#1392
@abhinavdahiya
Copy link
Contributor Author

@abhinavdahiya can you rebase this so we can get it in along with openshift/machine-config-operator#356

@runcom PTAL

@cgwalters
Copy link
Member

This LGTM. (I debated some bikeshedding on the 99-%s-ssh naming but eh, not worth it)

This PR should land first - in that case we'll have two things injecting SSH (the installer's MCs and the MCO), and then we land openshift/machine-config-operator#356 to bring us back down to 1.

/approve

@@ -135,6 +133,7 @@ func (o *Openshift) Generate(dependencies asset.Parents) error {
Data: data,
})
}
o.FileList = append(o.FileList, worker.Files()...)
Copy link
Member

Choose a reason for hiding this comment

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

This makes me jumpy about reloading/regenerating these when they're loaded from disk during a multi-stage install. Can we move Worker out from under Openshift into it's own writeable asset (like we did for masters in 7a396d9, #1211)? CC @staebler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This makes me jumpy about reloading/regenerating these when they're loaded from disk during a multi-stage install. Can we move Worker out from under Openshift into it's own writeable asset (like we did for masters in 7a396d9, #1211)? CC @staebler

master's we use as input to cluster asset and that's why it makes sense to split that out in #1211 that worker machinesets are opaque to creating infra resources for now and I don't think we would need to do something like #1211 for the time being.

Copy link
Member

@wking wking Mar 27, 2019

Choose a reason for hiding this comment

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

... worker machinesets are opaque to creating infra resources for now...

So should we stop writing them at all? Drop them from Openshift without making them writable assets? This is getting into #1119.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So should we stop writing them at all?

why, people can edit the manifest as a file. doesn't mean we don't write them 😕

Copy link
Member

Choose a reason for hiding this comment

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

why, people can edit the manifest as a file. doesn't mean we don't write them confused

Because then we won't have structured info about chosen worker availability zones and such. I'll work up some test-cases tonight.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

whatever we decide on that ^^ , I don't think it should be part of this PR.

pkg/asset/machines/master.go Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Mar 27, 2019
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 27, 2019
@abhinavdahiya
Copy link
Contributor Author

Ok, I've left a few more comments inline. I'm ok landing this as it stands if you don't share my concerns or are ok carrying them as technical debt, so I'll set this up for you to admit when you feel comfortable:

replied to the comments. PTAL @wking
#1150 (comment) frankly does not belong in this PR.

@wking
Copy link
Member

wking commented Mar 27, 2019

e2e-aws:

Flaky tests:

[Feature:DeploymentConfig] deploymentconfigs when run iteratively [Conformance] should only deploy the last deployment [Suite:openshift/conformance/parallel/minimal]

Failing tests:

[sig-storage] In-tree Volumes [Driver: nfs] [Testpattern: Dynamic PV (default fs)] subPath should be able to unmount after the subpath directory is deleted [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] In-tree Volumes [Driver: nfs] [Testpattern: Inline-volume (default fs)] subPath should be able to unmount after the subpath directory is deleted [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] In-tree Volumes [Driver: nfs] [Testpattern: Pre-provisioned PV (default fs)] subPath should be able to unmount after the subpath directory is deleted [Suite:openshift/conformance/parallel] [Suite:k8s]

/lgtm
/retest

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 27, 2019
@wking
Copy link
Member

wking commented Mar 27, 2019

Failing tests are openshift/origin#22412, and may be happening every time.

@wking
Copy link
Member

wking commented Mar 27, 2019

/hold cancel

Needs a rebase, though

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Mar 27, 2019
staebler and others added 5 commits March 27, 2019 12:01
Vendor openshift/machine-config-operator to have access to the MachineConfig type.
The MachineConfig type is used to send supplement the ignition config for machine
pools that have hyperthreading enabled.

This also adds some more packages from coreos/ignition.
Provide the means by which a machines asset can add MachineConfig manifests.
This is needed so that the ignition configs can be supplemented for machine pools for example have hyperthreading disabled, include
authorized_keys for user.
…machinepool

This sets up the master machine asset to allow adding MachineConfigs. A list of machine configs can be added to master machines
that will be created alongside the user-data and machine objects.
…epools

This sets up the worker machine asset to allow adding MachineConfigs. A list of machine configs can be added to compute machinepools
that will be created alongside the user-data and machineset objects.
`cluster-config-v1` is being deprecated in favor of global configs [1] and Machine Config Operator needs to
drop using the `SSHKey` in install-config [2] to setup the `SSHAuthorizedKeys` for `core` user.

This pushes a machineconfig with the `SSHAuthorizedKeys` sourced from [2] for each machinepool, so that Machine Config Operator can drop
generating the machineconfig using the `cluster-config-v1` config map in the cluster.

[1]: openshift#680
[2]: https://godoc.org/github.com/openshift/installer/pkg/types#InstallConfig
@abhinavdahiya
Copy link
Contributor Author

/hold cancel

Needs a rebase, though

done.

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Mar 27, 2019
@wking
Copy link
Member

wking commented Mar 27, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 27, 2019
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, cgwalters, wking

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:
  • OWNERS [abhinavdahiya,wking]

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

@abhinavdahiya
Copy link
Contributor Author

Failing tests:

[sig-apps] StatefulSet [k8s.io] Basic StatefulSet functionality [StatefulSetBasic] should not deadlock when a pod's predecessor fails [Suite:openshift/conformance/parallel] [Suite:k8s]
[sig-storage] Dynamic Provisioning DynamicProvisioner should provision storage with different parameters [Suite:openshift/conformance/parallel] [Suite:k8s]

/retest

wking added a commit to wking/openshift-installer that referenced this pull request Mar 27, 2019
Since f2eacf3 (asset/machines/master: allow adding MachineConfigs
for control-plane machinepool, 2019-03-25, openshift#1150), we no longer need
to filet a File slice to get a Master object's Machine files.  Moving
the method to a stand-alone function sets the stage for structured
worker Machine objects.  f2eacf3 also removed the only
(*Master).Machines() consumer, so remove that method completely.
@wking
Copy link
Member

wking commented Mar 27, 2019

e2e-aws:

level=error msg="\t* aws_internet_gateway.igw: error attaching EC2 Internet Gateway (igw-07d40ca7af759b41a): timeout while waiting for state to become 'success' (timeout: 2m0s)"

/retest

@openshift-merge-robot openshift-merge-robot merged commit 6a50329 into openshift:master Mar 27, 2019
wking added a commit to wking/openshift-installer that referenced this pull request Mar 28, 2019
…hines

Since f2eacf3 (asset/machines/master: allow adding MachineConfigs
for control-plane machinepool, 2019-03-25, openshift#1150), we no longer need
to filter a File slice to get a Master object's Machine files.  Drop
the obsoleted Machines() implemenation and rename the previous
StructuredMachines implmentation to take its place.
wking added a commit to wking/openshift-installer that referenced this pull request Mar 28, 2019
…hines

Since f2eacf3 (asset/machines/master: allow adding MachineConfigs
for control-plane machinepool, 2019-03-25, openshift#1150), we no longer need
to filter a File slice to get a Master object's Machine files.  Drop
the obsoleted Machines() implemenation and rename the previous
StructuredMachines implmentation to take its place.
vrutkovs pushed a commit to vrutkovs/installer that referenced this pull request Apr 1, 2019
…hines

Since f2eacf3 (asset/machines/master: allow adding MachineConfigs
for control-plane machinepool, 2019-03-25, openshift#1150), we no longer need
to filter a File slice to get a Master object's Machine files.  Drop
the obsoleted Machines() implemenation and rename the previous
StructuredMachines implmentation to take its place.
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