-
Notifications
You must be signed in to change notification settings - Fork 127
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
Sync cloudprovider configmap #206
Conversation
cc @staebler @openshift/sig-storage |
const ( | ||
targetNamespaceName = "openshift-kube-controller-manager" | ||
cloudProviderConfFilePath = "/etc/kubernetes/static-pod-resources/configmaps/cloud-config/config" | ||
configNamespace = "openshift-config" |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation of Infrastructure should change, too, then.
https://github.com/openshift/api/blob/d2f01e7b77a6fc78b328db20285423838419fef7/config/v1/types_infrastructure.go#L28
|
||
sourceCloudConfigMap := infrastructure.Spec.CloudConfig.Name | ||
sourceCloudConfigNamespace := configNamespace | ||
if len(sourceCloudConfigMap) == 0 { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
previouslyObservedConfig := map[string]interface{}{} | ||
|
||
existinCloudConfig, _, err := unstructured.NestedStringSlice(existingConfig, cloudProviderConfPath...) |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
429720e
to
0d4cd23
Compare
Also delete configmap if it is removed in source
0d4cd23
to
0ec8bd6
Compare
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. |
/lgtm |
[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 |
This PR still depends on openshift/installer#1516 for actual
Infrastructure
object to be populated.cc @deads2k