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

Sync cloudprovider configmap #206

Merged

Conversation

gnufied
Copy link
Member

@gnufied gnufied commented Apr 3, 2019

This PR still depends on openshift/installer#1516 for actual Infrastructure object to be populated.

cc @deads2k

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 3, 2019
@gnufied
Copy link
Member Author

gnufied commented Apr 3, 2019

cc @staebler @openshift/sig-storage

const (
targetNamespaceName = "openshift-kube-controller-manager"
cloudProviderConfFilePath = "/etc/kubernetes/static-pod-resources/configmaps/cloud-config/config"
configNamespace = "openshift-config"
Copy link
Contributor

Choose a reason for hiding this comment

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

@derekwaynecarr I think we want this to be openshift-config-managed to be consistent for all clouds and allow future filtering, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, if this has to change https://github.com/openshift/installer/pull/1516/files#diff-8db489d59cedb0a4f04c7546779f58a2R68 should be updated to reflect new location right?

Copy link
Contributor

Choose a reason for hiding this comment

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


sourceCloudConfigMap := infrastructure.Spec.CloudConfig.Name
sourceCloudConfigNamespace := configNamespace
if len(sourceCloudConfigMap) == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, I think we need to sync an empty location to clear the destination. Can you have a look at the godoc on syncconfigmap?

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

recorder.Warningf("ObserverCloudProviderNames", "Failed setting cloud-config : %v", err)
errs = append(errs, err)
}
return observedConfig, errs
Copy link
Contributor

Choose a reason for hiding this comment

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

just before returning, can you look for a diff between the prevconfig and the newconfig and emit an event. @mfojtik probably has an example.

Copy link
Member Author

Choose a reason for hiding this comment

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

^ does this work or did you mean deep comparsion of actual cloudprovider configuration?

@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 Apr 3, 2019
previouslyObservedConfig := map[string]interface{}{}

existinCloudConfig, _, err := unstructured.NestedStringSlice(existingConfig, cloudProviderConfPath...)
Copy link
Contributor

Choose a reason for hiding this comment

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

s/existinCloudConfig/existingCloudConfig/

case "":
recorder.Warningf("ObserveCloudProvidersFailed", "Required status.platform field is not set in infrastructures.%s/cluster", configv1.GroupName)
return previouslyObservedConfig, errs
case configv1.AWSPlatform:
cloudProvider = "aws"
case configv1.VSpherePlatform:

Choose a reason for hiding this comment

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

Can you please add support for Azure platform as well

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't add support for Azure in this PR. Because it was decided that applying a opaque configmap as a cloudprovider config will only be supported for vsphere for the time being. For other cloudproviders, plan is to validate and support only options we know work.

@gnufied gnufied force-pushed the sync-cloudprovider-config branch from 429720e to 0d4cd23 Compare April 4, 2019 19:10
@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 4, 2019
@gnufied gnufied force-pushed the sync-cloudprovider-config branch from 0d4cd23 to 0ec8bd6 Compare April 4, 2019 19:49
@openshift-ci-robot openshift-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 4, 2019
@gnufied
Copy link
Member Author

gnufied commented Apr 9, 2019

I have verified and validated that vsphere cloudprovider configuration for controller-manager in 4.1 works after this PR. I was able to provision and attach/detach PVCs successfully in a working cluster.

@derekwaynecarr @deads2k PTAL.

@deads2k
Copy link
Contributor

deads2k commented Apr 9, 2019

/lgtm
/retest

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, gnufied

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 Apr 9, 2019
@openshift-merge-robot openshift-merge-robot merged commit f34ab45 into openshift:master Apr 9, 2019
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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants