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

OCPBUGS-30282: Multiple MachineConfigs in one CM #3695

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

michael-topchiev
Copy link
Member

This PR enables Hypershift NodePool controller to recognize and process multiple MachineConfig yaml documents inside config-maps referenced by NodePool in its spec.config list.

This is required to reduce number of objects in etcd when Hypershift manages many hosted clusters to save space and improve performance.

Fixes # OCPBUGS-30282

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Mar 6, 2024
@openshift-ci-robot
Copy link

@michael-topchiev: This pull request references Jira Issue OCPBUGS-30282, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.16.0) matches configured target version for branch (4.16.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

No GitHub users were found matching the public email listed for the QA contact in Jira (jiezhao@redhat.com), skipping review request.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This PR enables Hypershift NodePool controller to recognize and process multiple MachineConfig yaml documents inside config-maps referenced by NodePool in its spec.config list.

This is required to reduce number of objects in etcd when Hypershift manages many hosted clusters to save space and improve performance.

Fixes # OCPBUGS-30282

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot requested review from csrwng and hasueki March 6, 2024 14:06
@openshift-ci openshift-ci bot added area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels Mar 6, 2024
Copy link
Contributor

@hasueki hasueki left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 5, 2024
Copy link
Contributor

openshift-ci bot commented Apr 5, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hasueki, michael-topchiev
Once this PR has been reviewed and has the lgtm label, please assign jparrill for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@@ -603,11 +654,11 @@ spec:
Namespace: namespace,
},
Data: map[string]string{
TokenSecretConfigKey: machineConfig2,
TokenSecretConfigKey: "---" + machineConfig2 + "\n---\n \n \n---\n" + machineConfig3,
Copy link
Member

Choose a reason for hiding this comment

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

nit can we use the yamlDocDelimiter var here?

// ignition config-map payload may have multiple yaml documents
manifestList := strings.Split(cmPayload, yamlDocDelimiter)
for _, manifestRaw := range manifestList {
if strings.TrimSpace(manifestRaw) == "" {
Copy link
Member

Choose a reason for hiding this comment

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

could this trim(or something else) result in a slightly different manifestRaw, and so a different allConfigPlainText for existing Configs? hence resulting in a different configHash, hence triggering a rolling upgrade for existing clusters with conflicting yaml in the MC secret?

Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if the (de)serializers can be configured to consume multiple documents in one file? Would want to cross-reference e.g. kubectl create -f to see how it's handled

@michael-topchiev michael-topchiev force-pushed the multi-part-ignition-cm-payload-main branch from e1abfb4 to 6ea2183 Compare May 30, 2024 19:34
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label May 30, 2024
Copy link
Contributor

openshift-ci bot commented May 30, 2024

New changes are detected. LGTM label has been removed.

@michael-topchiev michael-topchiev force-pushed the multi-part-ignition-cm-payload-main branch from 6ea2183 to 1049294 Compare May 30, 2024 19:42
@michael-topchiev
Copy link
Member Author

@enxebre @stevekuznetsov The ignition payload splitting implementation changed to utilize YAMLReader. The reader is used by other k8s components (ex. kubectl) to read multi-part yaml documents.

The code change should not have impact on the existing clusters. If the ignition config map contains only one manifest, the getConfig(...) function returns the same result as the old code - the unit tests confirm that. The for _, config := range configs ... block should produce deterministic output for multi-part ignition payloads as well.

If any existing clusters for some reason (maybe by mistake) already have multi-part ignition config-maps, then they currently use only the 1st manifest from the ignition CMs payload, and this PR of course will have (hopefully positive) impact.

@michael-topchiev
Copy link
Member Author

/retest-required

3 similar comments
@michael-topchiev
Copy link
Member Author

/retest-required

@michael-topchiev
Copy link
Member Author

/retest-required

@michael-topchiev
Copy link
Member Author

/retest-required

Copy link
Contributor

openshift-ci bot commented Jun 4, 2024

@michael-topchiev: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-kubevirt-azure-ovn 1049294 link false /test e2e-kubevirt-azure-ovn
ci/prow/e2e-azure 1049294 link false /test e2e-azure
ci/prow/e2e-aws 1049294 link true /test e2e-aws

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@michael-topchiev
Copy link
Member Author

@enxebre this PR's e2e tests sporadically fail even though the code change has been tested in real clusters on our side. Are there any problems with the e2e testing environment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants