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

Integrate baremetal-operator with machine-api-operator #302

Merged
merged 1 commit into from
Aug 7, 2019

Conversation

sadasu
Copy link
Contributor

@sadasu sadasu commented Apr 26, 2019

Changes required for the MAO to also perform the Baremetal deployment.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 26, 2019
@openshift-ci-robot
Copy link
Contributor

Hi @sadasu. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@openshift-ci-robot openshift-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 26, 2019
install/image-references Outdated Show resolved Hide resolved
pkg/operator/config.go Outdated Show resolved Hide resolved
owned-manifests/machine-api-controllers.yaml Outdated Show resolved Hide resolved
owned-manifests/machine-api-controllers.yaml Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 3, 2019
@sadasu sadasu force-pushed the 297-dev branch 2 times, most recently from 2d90d12 to 6244ed2 Compare May 7, 2019 17:46
Copy link
Member

@russellb russellb left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

install/image-references Outdated Show resolved Hide resolved
install/image-references Outdated Show resolved Hide resolved
owned-manifests/baremetal_operator.yaml Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 28, 2019
Copy link
Contributor

@dhellmann dhellmann left a comment

Choose a reason for hiding this comment

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

This looks like it will install and start the operator, but not define the CRD it uses. Should the operator do that for itself? Or is that supposed to happen some other way? (Or maybe I missed a detail here)

@sadasu
Copy link
Contributor Author

sadasu commented Jun 4, 2019

This looks like it will install and start the operator, but not define the CRD it uses. Should the operator do that for itself? Or is that supposed to happen some other way? (Or maybe I missed a detail here)

Yes, currently the changes proposed here does not define the CRD that the baremetal-operator uses. Code has changes quite a bit since these changes were proposed. Investigating to see if there is now a mechanism to provide baremetal-operator with the CRD at the time of deployment.

@dhellmann
Copy link
Contributor

This looks like it will install and start the operator, but not define the CRD it uses. Should the operator do that for itself? Or is that supposed to happen some other way? (Or maybe I missed a detail here)

Yes, currently the changes proposed here does not define the CRD that the baremetal-operator uses. Code has changes quite a bit since these changes were proposed. Investigating to see if there is now a mechanism to provide baremetal-operator with the CRD at the time of deployment.

OK, that was an honest question on my part. I have no idea how it's supposed to work, but if the operator needs to do it let me know and we can make that happen.

@russellb
Copy link
Member

russellb commented Jun 5, 2019

@sadasu @dhellmann Take a look at the contents of the machine-api-operator/install/ directory. The image-references file specifies which images the machine-api-operator depends on that need to get included in the release payload. The rest are a bunch of manifests. Those manifests will get included in the release payload as well. Note that the Machine and MachineSet CRDs are in there, for example.

It seems one option would be to drop the BareMetalHost CRD in there. That would work, but I don't see any way to make that baremetal platform specific. The CRD would be defined for all clusters, and that's not exactly ideal, but also harmless, and maybe an acceptable starting point?

A second option would be to define the CRD via the API in go code in this patch, and ensure that's done before the baremetal-operator gets launched.

A third would be to have the baremetal-operator define its own CRD at runtime if not already defined, I suppose.

Any other ideas?

Maybe some of the other members of the cloud team that maintains machine-api-operator would have input, too. @enxebre any thoughts? or recommendations for who might have an opinion?

@dhellmann
Copy link
Contributor

@sadasu @dhellmann Take a look at the contents of the machine-api-operator/install/ directory. The image-references file specifies which images the machine-api-operator depends on that need to get included in the release payload. The rest are a bunch of manifests. Those manifests will get included in the release payload as well. Note that the Machine and MachineSet CRDs are in there, for example.

It seems one option would be to drop the BareMetalHost CRD in there. That would work, but I don't see any way to make that baremetal platform specific. The CRD would be defined for all clusters, and that's not exactly ideal, but also harmless, and maybe an acceptable starting point?

I think that's a good starting point to unblock several other pieces of work to integrate the baremetal operator with the installer.

A second option would be to define the CRD via the API in go code in this patch, and ensure that's done before the baremetal-operator gets launched.

This seems like a better long term approach, once we are unblocked.

A third would be to have the baremetal-operator define its own CRD at runtime if not already defined, I suppose.

I expect we'll have issues giving the operator permissions to define CRDs, so while it makes sense from the perspective of only having the CRD when needed I don't think it's a viable approach.

Any other ideas?

Maybe some of the other members of the cloud team that maintains machine-api-operator would have input, too. @enxebre any thoughts? or recommendations for who might have an opinion?

pkg/operator/operator.go Outdated Show resolved Hide resolved
pkg/operator/config.go Outdated Show resolved Hide resolved
pkg/operator/operator.go Outdated Show resolved Hide resolved
},
BaremetalOperatorConfig: BaremetalConfig{
Copy link
Contributor

Choose a reason for hiding this comment

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

We should set this whole config to nil if baremetal is not enabled. Build BaremetalConfig object above if necesary and refer to it here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right before we define the BaremetalConfig object appears to be the only place we should check baremetalEnabled. All the other checks above are redundant. Make that determination here, if it's true, get the images and create BaremetalConfig; else BaremetalConfig := nil

pkg/operator/sync.go Outdated Show resolved Hide resolved
pkg/operator/operator.go Outdated Show resolved Hide resolved
pkg/operator/sync.go Outdated Show resolved Hide resolved
hardys pushed a commit to hardys/dev-scripts that referenced this pull request Jul 9, 2019
This means we can keep the OCP specific pieces out of the upstream
repo, and prototype the integration which will ultimately be handled
via openshift/machine-api-operator#302

Also set the RHCOS image URL n the configmap based on the variable from
common.sh
hardys pushed a commit to hardys/dev-scripts that referenced this pull request Jul 9, 2019
This means we can keep the OCP specific pieces out of the upstream
repo, and prototype the integration which will ultimately be handled
via openshift/machine-api-operator#302

Also set the RHCOS image URL n the configmap based on the variable from
common.sh

Co-Authored-By: Ian Main <[email protected]>
@openshift-ci-robot openshift-ci-robot removed the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 9, 2019
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: baremetalhosts.metal3.io
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to figure out if we want to ship in this namespace. @enxebre @derekwaynecarr @eparis

Copy link
Member

Choose a reason for hiding this comment

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

the resource is alpha, i would like to use the community project name for these resources in the interim. before graduating to GA in openshift, i want to understand how these API resources are evolved in community context.

Copy link
Contributor

@michaelgugino michaelgugino left a comment

Choose a reason for hiding this comment

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

Just a few things, otherwise looks good to me.

pkg/operator/config.go Outdated Show resolved Hide resolved
pkg/operator/config.go Outdated Show resolved Hide resolved
pkg/operator/operator.go Outdated Show resolved Hide resolved
pkg/operator/operator.go Outdated Show resolved Hide resolved
- bmh
- bmhost
scope: Namespaced
version: v1alpha1
Copy link
Member

Choose a reason for hiding this comment

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

are we good shipping with alpha commitment?

Copy link
Contributor

Choose a reason for hiding this comment

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

For this high touch beta, yes. We'll raise the version level in an upcoming release.

Copy link
Member

Choose a reason for hiding this comment

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

alpha is fine.


// In addition, if the Provider is BareMetal, then bring up
// the baremetal-operator pod
if config.BaremetalControllers.BaremetalOperator != "" {
Copy link
Member

@enxebre enxebre Aug 6, 2019

Choose a reason for hiding this comment

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

does the baremetal actuator depends on this components to run successfully? if so you'd need to ensure this gets deployed before syncClusterAPIController

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The baremetal actuator does not depend on the metal3 pod to run successfully (but needs it to be running to be useful.) It is OK for the baremetal actuator if the metal3 pod is available later. Also, if the metal3 pod deployment wasn't successful we would still want to go ahead with the machine-api-controller pod deployment. For these reasons, would like to keep the ordering as is.

These changes allow the MAO to bring up the metal3 pod that
contains the baremetal-operator and Ironic containers.
@sadasu sadasu changed the title WIP: Integrate baremetal-operator with machine-api-operator Integrate baremetal-operator with machine-api-operator Aug 6, 2019
@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 Aug 6, 2019
Copy link
Contributor

@michaelgugino michaelgugino left a comment

Choose a reason for hiding this comment

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

This looks good to me, nice work!

@sadasu
Copy link
Contributor Author

sadasu commented Aug 6, 2019

/retest

@enxebre
Copy link
Member

enxebre commented Aug 7, 2019

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: enxebre

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 7, 2019
@michaelgugino
Copy link
Contributor

/lgtm

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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.