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

Differentiate CloudProviderName and KubeletCloudProviderName in templates #1162

Merged
merged 2 commits into from Jan 13, 2022

Conversation

xmudrii
Copy link
Member

@xmudrii xmudrii commented Jan 13, 2022

What this PR does / why we need it:

We currently use the CloudProviderName field in templates for:

  • the --cloud-provider flag in the Kubelet service
  • running commands only for some provider(s)

However, CloudProviderName contains the value returned by GetCloudConfig function. This function returns the cloud provider name used by Kubelet, and only if the provider has an in-tree cloud provider implementation (in-tree CCM). In other words, CloudProviderName will be empty on providers such as Nutanix, DigitalOcean, Hetzner, etc...

We encountered the issue when we tried to install some packages only on Nutanix machines in #1161. Because Nutanix doesn't have in-tree CCM, .CloudProviderName is empty, and the Nutanix-specific logic is not executed. Therefore, this PR is a prerequisite for #1161.

This issue is fixed by differentiating CloudProviderName and KubeletCloudProviderName:

  • CloudProviderName is providerConfig.CloudProvider. It's used in templates when we want to run cloud-provider-specific logic (e.g. install some packages only for one provider)
  • KubeletCloudProviderName is from GetCloudConfig). It's passed to Kubelet via --cloud-provider` flag

Optional Release Note:

Differentiate CloudProviderName and KubeletCloudProviderName in templates

/assign @embik @moadqassem @ahmedwaleedmalik

Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
@kubermatic-bot kubermatic-bot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jan 13, 2022
@kubermatic-bot kubermatic-bot added dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. sig/osm Denotes a PR or issue as being assigned to SIG OSM. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 13, 2022
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 13, 2022
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 4029c74b3db9314824d1a7afc90249585af5a613

@ahmedwaleedmalik
Copy link
Member

/approve

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahmedwaleedmalik, xmudrii

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

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 13, 2022
@kubermatic-bot kubermatic-bot merged commit b85947d into kubermatic:master Jan 13, 2022
@xmudrii xmudrii deleted the fix-cloudprovidername branch January 13, 2022 14:04
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. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cluster-management Denotes a PR or issue as being assigned to SIG Cluster Management. sig/osm Denotes a PR or issue as being assigned to SIG OSM. 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.

None yet

5 participants