-
Notifications
You must be signed in to change notification settings - Fork 410
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
operator: sync the cloud config in bootstrap and cluster mode #591
operator: sync the cloud config in bootstrap and cluster mode #591
Conversation
1f93cf4
to
5be647a
Compare
/hold is this fixing a bug and has clearance to go in? |
5be647a
to
3e6181f
Compare
This PR is required for Azure work to proceed. as kubelets for Azure need to use this cloudconfig. |
@runcom This can be merged as long as you are confident it won't affect existing functionality. |
3e6181f
to
3ca7166
Compare
pkg/operator/operator.go
Outdated
@@ -421,6 +430,18 @@ func (optr *Operator) getCAsFromConfigMap(namespace, name, key string) ([]byte, | |||
} | |||
} | |||
|
|||
func (optr *Operator) getCloudConfigFromConfigMap(namespace, name, key string) (string, error) { | |||
cm, err := optr.kubeClient.CoreV1().ConfigMaps(namespace).Get(name, metav1.GetOptions{}) |
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.
We have optr.clusterCmLister.ConfigMaps(namespace)
now.
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.
done
Only one minor nit, otherwise looks sane to me. |
@@ -25,7 +25,7 @@ contents: | | |||
--client-ca-file=/etc/kubernetes/ca.crt \ | |||
--cloud-provider=aws \ | |||
--volume-plugin-dir=/etc/kubernetes/kubelet-plugins/volume/exec \ | |||
\ | |||
\ |
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.
?
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.
because of change here
Haven't fully reviewed this but looks rightly wrapped to not affect other stuff in the MCO. @cgwalters @kikisdeliveryservice wdyt? |
3ca7166
to
2425b71
Compare
confirming that in CI seeing cloud.conf refs in form:
in that CI run failed for other reasons, awaiting completed test runs. |
/retest |
The cloud provider config is optionaly present on the bootstrap node based on the user choice or platform. When the `.spec.cloudConfig` [1] is set, that requires the cloud provider config file to be provided. In cluster operator uses the same field from `infrastructure.config.openshift.io/cluster` object to selectively fetch the cloud config configmap reference. [1]: openshift/api#245
When the `.CloudProviderConfig` is non empty, - the contents must be stored at `/etc/kubernetes/cloud.conf` - and the kubelet service must configure kubelet to include `--cloud-config=/etc/kubernetes/cloud.conf` flag [1] [1]: https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/#options
2425b71
to
8251247
Compare
rebased around #648 |
/approve |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, kikisdeliveryservice, runcom 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 |
/hold cancel |
e2e-aws: failed due to flake :(
/retest |
this looks fine to me, we will need to handle migration when external cloud controller managers are available when kubelets no longer need this conf file. that is a few releases away. |
…e path Catching up to MCO supporting reading the cloud conf file on bootstrap node only when the infrastructures.config.openshift.io has the cloud provider config location set [1] [1]: openshift/machine-config-operator#591
PR [1] introduced wrong decoding for the cloud conf configmap file. It was using the openshift/client-go 's config scheme to decode ConfigMap resource when it should have been using the k8s.io/client-go's kubernetes scheme [1]: openshift#591
- What I did
Use the cloud config defined in openshift/api#245 & openshift/installer#1479 to make sure mco can use it in both bootstrap and cluster.
Also updated the internal templates to write the cloudconfig to
/etc/kubernetes/cloud.conf
so that kubelets on nodes can use it.- How to verify it
- Description for the changelog
/cc @staebler @derekwaynecarr