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

Apply mc-name-suffix annotation to kubeletconfig #3353

Conversation

SrinivasAtmakuri
Copy link
Collaborator

Which issue this PR addresses:

JIRA: https://issues.redhat.com/browse/ARO-5028

We want to proactively add MCO's mc-name-suffix annotation set to empty string "" to the kubeletconfig dynamic-node. This will make the resulting rendered machineconfig 99-worker-generated-kubelet have no suffix, resulting in the lowest priority of kubeletconfigs.

Fixes

What this PR does / why we need it:

Test plan for issue:

Is there any documentation that needs to be updated for this PR?

@SrinivasAtmakuri SrinivasAtmakuri added the skippy pull requests raised by member of Team Skippy label Jan 15, 2024
@bennerv
Copy link
Collaborator

bennerv commented Jan 16, 2024

/azp run E2E - PullRequest

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Azure Azure deleted a comment from azure-pipelines bot Jan 16, 2024
@Azure Azure deleted a comment from azure-pipelines bot Jan 16, 2024
SudoBrendan
SudoBrendan previously approved these changes Jan 16, 2024

// machineconfiguration annotation added on the kubelet CRD - dynamic-node
mcAnnotationName = "machineconfiguration.openshift.io/mc-name-suffix"
mcAnnotationValue = ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would comment why we use "" here just so we remember in a while, it's unintuitive.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would comment why we use "" here just so we remember in a while, it's unintuitive.

Or we can make the name descriptive (e.g. lowPriority)?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's because the value "" is viewed by MCO as zero. Hm.

if config.Annotations == nil {
config.Annotations = defaultConfig.Annotations
}
if val, ok := config.Annotations[mcAnnotationName]; !ok || val != mcAnnotationValue {
Copy link
Member

Choose a reason for hiding this comment

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

If this is already set, we shouldn't be changing it regardless of value, as it will disconnect the kubeletconfig from the already rendered machineconfig

Copy link
Contributor

Choose a reason for hiding this comment

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

This is true, we understand MCO behaviour in this condition.

config.Annotations = defaultConfig.Annotations
}
if val, ok := config.Annotations[mcAnnotationName]; !ok || val != mcAnnotationValue {
config.Annotations[mcAnnotationName] = mcAnnotationValue
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if a different kubeletconfig (maybe one provided by the customer) already his this annotation and value?

Copy link
Contributor

Choose a reason for hiding this comment

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

Srini did some testing on this and found that if two kubeletconfig have the same value for this annotation it breaks MCO. This is potentially a breaking issue. I think we should rethink this approach because of this

@jaitaiwan jaitaiwan added hold Hold and removed ready-for-review labels Feb 1, 2024
@SrinivasAtmakuri
Copy link
Collaborator Author

The solution is creating stale finalizers in kubeletconfig, after discussions this approach is dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hold Hold skippy pull requests raised by member of Team Skippy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants