Skip to content

[node-manager] mcm-use-node-manager-bootstrap-token #15

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

Closed
wants to merge 3 commits into from

Conversation

d2285
Copy link
Member

@d2285 d2285 commented Mar 21, 2025

What this PR does / why we need it:
this mr allow to use node-manager boostrap token instead mcm token.

Which issue(s) this PR fixes:
resolve this issue
Special notes for your reviewer:

Release note:


@d2285 d2285 force-pushed the bootstrap-token-node-manager branch 2 times, most recently from 3e9d9eb to b1e1d88 Compare March 21, 2025 07:13
@d2285 d2285 requested a review from name212 March 24, 2025 06:47
@d2285 d2285 self-assigned this Mar 24, 2025
}

secret = &secretListNodeManager.Items[0]
Copy link
Member

Choose a reason for hiding this comment

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

i think we need to sort by metadata.creationTimestamp by desc and get first (get last created token)

Copy link
Member

Choose a reason for hiding this comment

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

  1. Need to fallback to old logic if secrets not found

Copy link
Member Author

Choose a reason for hiding this comment

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

added sort and old logic(create token by mcm if node manager tokens not found)

secret, err = c.targetCoreClient.CoreV1().Secrets(metav1.NamespaceSystem).Get(secretName, metav1.GetOptions{})
labelSelector := "module=node-manager"
secretListNodeManager, err := c.targetCoreClient.CoreV1().Secrets(metav1.NamespaceSystem).List(metav1.ListOptions{
LabelSelector: labelSelector,
Copy link
Member

Choose a reason for hiding this comment

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

i think only label selector is not enough, because in the future we can add another secrets from node manager.

Need to filter by name prefix after getting by label

Copy link
Member

Choose a reason for hiding this comment

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

  1. in the token we have label node-manager.deckhouse.io/node-group=$GROUP_NAME probably we need to get by this label depend on fileds from machine deployment or machine resource. Please think about it

Copy link
Member Author

Choose a reason for hiding this comment

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

add filter by label from node group name from machine labels

node-manager.deckhouse.io/node-group=$NG_NAME

Copy link
Member

@name212 name212 left a comment

Choose a reason for hiding this comment

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

some nist and please fix CI

@d2285 d2285 force-pushed the bootstrap-token-node-manager branch from 7ecebfc to b637bc7 Compare March 26, 2025 11:33
@d2285 d2285 requested a review from name212 April 13, 2025 13:36
@d2285 d2285 force-pushed the bootstrap-token-node-manager branch 3 times, most recently from 85ad3b6 to 822ab1d Compare April 13, 2025 14:10
@d2285 d2285 closed this Apr 13, 2025
@d2285 d2285 deleted the bootstrap-token-node-manager branch April 13, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MCM] Use bootstrap token generated by Deckhouse
5 participants