Skip to content

Add a config.openshift.io/Infrastructure instance to the cluster #943

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

Merged
merged 2 commits into from
Jan 12, 2019

Conversation

ironcladlou
Copy link
Contributor

Add a config.openshift.io/Infrastructure instance to the cluster.

  • Update the openshift/api package to a version containing the new config type.
  • Generate the config.openshift.io/Infrastructure custom resource definition manifest.
  • Generate the CRD instance manifest populated with cloud provider name from the install config.

This enables consumers of cloud provider configuration to migrate away from install config.

/cc @openshift/sig-network-edge @rajatchopra @deads2k

@openshift-ci-robot openshift-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Dec 19, 2018
@ironcladlou
Copy link
Contributor Author

/retest


// Infrastructure generates the cluster-infrastructure-*.yml files.
type Infrastructure struct {
config *configv1.Infrastructure
Copy link
Contributor

Choose a reason for hiding this comment

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

Do not need to store the config. It is not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed


crdData, err := content.GetBootkubeTemplate(infraCrdFilename)
if err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

Wrap this error with a meaningful message.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed — also, I wasn't aware of github.com/pkg/errors, I like it and will propose using it in my team's operators. Thanks!

Gopkg.lock Outdated
@@ -364,14 +364,14 @@
version = "1.0.1"

[[projects]]
digest = "1:68214731af5ff5a3bfab4d28571578e5522bc4f667ad1232745d7b4189ccb442"
digest = "1:400ab065329172f4f4a88ad94401795780566749b1b3cb73029d0d3971659925"
Copy link
Contributor

Choose a reason for hiding this comment

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

Put the vendor changes in a separate commit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't this already the case?
0cd84d5

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, yes, sorry for the noise.


configData, err := yaml.Marshal(i.config)
if err != nil {
return errors.Wrapf(err, "failed to create %s manifests from InstallConfig", i.Name())
Copy link
Contributor

Choose a reason for hiding this comment

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

The message for this error does not match what the error is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

}

// Load loads the already-rendered files back from disk.
func (i *Infrastructure) Load(f asset.FileFetcher) (bool, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This asset should not be loadable. Its files will be loaded by the Common Manifests asset. For more context, see #877.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, we may need to update the recent DNS config implementation for this too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll refactor DNS once this PR merges

@ironcladlou ironcladlou force-pushed the cloudprovider branch 2 times, most recently from fd335ff to f4ed5ff Compare December 19, 2018 15:40
@abhinavdahiya
Copy link
Contributor

/hold

Cloud provider is the wrong abstraction in the config. All cloudproviders are going to be external pretty soon. So I rather see Platform been set here...

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 19, 2018
@ironcladlou
Copy link
Contributor Author

@abhinavdahiya

Cloud provider is the wrong abstraction in the config. All cloudproviders are going to be external pretty soon. So I rather see Platform been set here...

That seems like a discussion we should have had in openshift/api#145. Are you going to open a new API PR with some proposed change?

@staebler
Copy link
Contributor

@rajatchopra Is there a distinction between manifests that should be part of manifest-templates and those that should not? I am wondering whether this new Infrastructure Config asset should be output from the manifest-templates target. It is not clear to me why the Ingress Config and Network Config are not.

@abhinavdahiya
Copy link
Contributor

@abhinavdahiya

Cloud provider is the wrong abstraction in the config. All cloudproviders are going to be external pretty soon. So I rather see Platform been set here...

That seems like a discussion we should have had in openshift/api#145. Are you going to open a new API PR with some proposed change?

🙁 Yeah let me do that, sorry that PR slipped my radar.

@ironcladlou is this PR blocking you on something important?

@ironcladlou
Copy link
Contributor Author

Opened openshift/api#149 to discuss refactoring the config API

Copy link

@rajatchopra rajatchopra left a comment

Choose a reason for hiding this comment

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

non-blocking comments.
I notice that even the ingress asset uses a template directly and not through a template asset. Can fix both of these in follow-up PR.

return errors.Wrapf(err, "failed to marshal config: %#v", config)
}

crdData, err := content.GetBootkubeTemplate(infraCrdFilename)

Choose a reason for hiding this comment

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

There should be a template asset first which this asset can depend upon. If we do it directly, then the 'templates' target will not dump this file (which may be okay, but inconsistent).

@@ -0,0 +1,16 @@
apiVersion: apiextensions.k8s.io/v1beta1

Choose a reason for hiding this comment

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

Is this a bootkube file? Seems like an openshift file. I mean keep it in data/data/manifests/openshift/

@rajatchopra
Copy link

@rajatchopra Is there a distinction between manifests that should be part of manifest-templates and those that should not? I am wondering whether this new Infrastructure Config asset should be output from the manifest-templates target. It is not clear to me why the Ingress Config and Network Config are not.

@staebler I put my review comments and then saw your comment. I have the same feedback. There is no distinction as of now, I think we should put all templates/manifests as manifest-template assets first and depend upon them if needed. Unless there is a strong reason otherwise. I don't see the reason here.

@ironcladlou ironcladlou force-pushed the cloudprovider branch 2 times, most recently from 60c114f to fa5253f Compare January 8, 2019 22:10
@ironcladlou
Copy link
Contributor Author

@rajatchopra @staebler @abhinavdahiya refactored per feedback, PTAL. Tested manually with create manifests but can't yet get a new cluster going to see it all in action.

Are there any automated tests I should incorporate?

@ironcladlou
Copy link
Contributor Author

Should the Infrastructure instance itself also be a template like the CRD? I'm not entirely clear on what the decision making framework is for when an asset should be a Go template in vs. a manifest generated from Go code in pkg/asset/manifests.

@ironcladlou
Copy link
Contributor Author

/retest

@ironcladlou
Copy link
Contributor Author

$ oc get infrastructures/cluster -o yaml
apiVersion: config.openshift.io/v1
kind: Infrastructure
metadata:
  creationTimestamp: 2019-01-09T18:53:37Z
  generation: 1
  name: cluster
  resourceVersion: "227"
  selfLink: /apis/config.openshift.io/v1/infrastructures/cluster
  uid: df61ad74-143f-11e9-a097-02040a65c016
spec: {}
status:
  platform: AWS

@ironcladlou
Copy link
Contributor Author

/retest

1 similar comment
@Miciah
Copy link
Contributor

Miciah commented Jan 9, 2019

/retest

@ironcladlou
Copy link
Contributor Author

@abhinavdahiya @rajatchopra @staebler PTAL, tests are green.

* Update the `openshift/api` package to a version containing the new config type.
* Generate the `config.openshift.io/Infrastructure` custom resource definition manifest.
* Generate the CRD instance manifest populated with cloud provider name from the install config.

This enables consumers of cloud provider configuration to migrate away from install config.
@abhinavdahiya abhinavdahiya added this to the Freeze milestone Jan 10, 2019
@rajatchopra
Copy link

/lgtm

@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. and removed lgtm Indicates that a PR is ready to be merged. labels Jan 11, 2019
@ironcladlou
Copy link
Contributor Author

/hold cancel

@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 Jan 11, 2019
@ironcladlou
Copy link
Contributor Author

@rajatchopra re-tag? I accidentally removed it

@ironcladlou
Copy link
Contributor Author

/retest

@abhinavdahiya
Copy link
Contributor

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, ironcladlou, rajatchopra

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,rajatchopra]

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

@ironcladlou
Copy link
Contributor Author

C'mon, bot.
/retest

@Miciah
Copy link
Contributor

Miciah commented Jan 11, 2019

could not copy stable imagestreamtag: Timeout: request did not complete within allowed duration

/retest

@Miciah
Copy link
Contributor

Miciah commented Jan 11, 2019

/retest

@Miciah
Copy link
Contributor

Miciah commented Jan 11, 2019

level=error msg="\t* module.vpc.aws_route_table_association.worker_routing[0]: 1 error occurred:"
level=error msg="\t* aws_route_table_association.worker_routing.0: timeout while waiting for state to become 'success' (timeout: 5m0s)"
level=error
level=error
level=error msg="\t* module.vpc.aws_route_table_association.route_net[4]: 1 error occurred:"
level=error msg="\t* aws_route_table_association.route_net.4: timeout while waiting for state to become 'success' (timeout: 5m0s)"

/retest

@Miciah
Copy link
Contributor

Miciah commented Jan 11, 2019

/retest

1 similar comment
@ironcladlou
Copy link
Contributor Author

/retest

@Miciah
Copy link
Contributor

Miciah commented Jan 11, 2019

could not resolve base image: the server was unable to return a response in the time allotted, but may still be processing the request (get imagestreamtags.image.openshift.io pipeline:installer)

/retest

@ironcladlou
Copy link
Contributor Author

/retest

2 similar comments
@ironcladlou
Copy link
Contributor Author

/retest

@Miciah
Copy link
Contributor

Miciah commented Jan 11, 2019

/retest

@ironcladlou
Copy link
Contributor Author

/refresh

@ironcladlou
Copy link
Contributor Author

/retest

2 similar comments
@ironcladlou
Copy link
Contributor Author

/retest

@ironcladlou
Copy link
Contributor Author

/retest

@openshift-merge-robot openshift-merge-robot merged commit c53de55 into openshift:master Jan 12, 2019
squeed added a commit to squeed/openshift-installer that referenced this pull request Jan 31, 2019
* Add the Network.config.openshift.io CRD
* Generate the network config from the install config
* Remove networkoperator types from install config (but use the same
    schema)
* Move network CRDs to templates to match openshift#943

This doesn't change the json/yaml serialization of the install config, but it
changes it internally.
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