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

operator: sync the cloud config in bootstrap and cluster mode #591

Merged

Conversation

abhinavdahiya
Copy link
Contributor

- 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

Sync the cloud config to kubelet on nodes.

/cc @staebler @derekwaynecarr

@openshift-ci-robot openshift-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 28, 2019
@runcom
Copy link
Member

runcom commented Mar 28, 2019

/hold

is this fixing a bug and has clearance to go in?

@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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 28, 2019
@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 22, 2019
@abhinavdahiya
Copy link
Contributor Author

This PR is required for Azure work to proceed. as kubelets for Azure need to use this cloudconfig.

@crawford
Copy link
Contributor

@runcom This can be merged as long as you are confident it won't affect existing functionality.

@@ -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{})
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@cgwalters
Copy link
Member

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 \
\
\
Copy link
Member

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

because of change here

@runcom
Copy link
Member

runcom commented Apr 22, 2019

Haven't fully reviewed this but looks rightly wrapped to not affect other stuff in the MCO. @cgwalters @kikisdeliveryservice wdyt?

@kikisdeliveryservice
Copy link
Contributor

kikisdeliveryservice commented Apr 22, 2019

confirming that in CI seeing cloud.conf refs in form:

                       "files": [
                            {
                                "contents": {
                                    "source": "data:,",
                                    "verification": {}
                                },
                                "filesystem": "root",
                                "mode": 420,
                                "path": "/etc/kubernetes/cloud.conf"
                            },

in 01-master-kubelet and 01-worker-kubelet that end up in rendered-master & rendered-worker configs

that CI run failed for other reasons, awaiting completed test runs.

@awesomenix
Copy link

/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
@abhinavdahiya
Copy link
Contributor Author

rebased around #648

@kikisdeliveryservice
Copy link
Contributor

/approve

@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 24, 2019
@runcom
Copy link
Member

runcom commented Apr 24, 2019

/lgtm

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

[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:
  • OWNERS [kikisdeliveryservice,runcom]

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

@runcom
Copy link
Member

runcom commented Apr 24, 2019

/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 Apr 24, 2019
@abhinavdahiya
Copy link
Contributor Author

e2e-aws: failed due to flake :(

Failing tests:

[Feature:Builds][Conformance] oc new-app  should succeed with a --name of 58 characters [Suite:openshift/conformance/parallel/minimal]

/retest

@derekwaynecarr
Copy link
Member

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.

@openshift-merge-robot openshift-merge-robot merged commit 2bd29e5 into openshift:master Apr 24, 2019
abhinavdahiya added a commit to abhinavdahiya/installer that referenced this pull request Apr 25, 2019
…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
abhinavdahiya added a commit to abhinavdahiya/machine-config-operator that referenced this pull request Apr 25, 2019
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
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/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.

9 participants