Skip to content

Conversation

rfranzke
Copy link
Member

How to categorize this PR?

/area ipcei
/kind enhancement

What this PR does / why we need it:
This PR implements gardenadm join for worker nodes. This works by adding a worker pool to the Shoot manifest, creating or generating a new bootstrap token on the control plane node, and then running

gardenadm join --bootstrap-token <token> --ca-certificate <ca-cert> --gardener-node-agent-secret-name <secret-name> <control-plane-address>

on the worker node that should be joined.

In the future, we could generate a separate discovery token to use it for reading the CA bundle from the kube-public/cluster-info ConfigMap (similar approach as with kubeadm).

Also, we could think about how to simplify finding the correct name of the gardener-node-agent Secret in case there are multiple worker pools defined in the Shoot (currently, you have to look it up using kubectl -n kube-system get secret -l gardener.cloud/role=operating-system-config,worker.gardener.cloud/pool=<worker-pool-name> if you are not using the --print-join-command flag when running gardenadm token {create,generate}, see #11934). Perhaps we could also implement a dedicated command for it if needed.

Which issue(s) this PR fixes:
Part of #2906

Special notes for your reviewer:

Note

The e2e test fails because #11934 must be merged first (pending).

Release note:

NONE

@gardener-prow gardener-prow bot added area/ipcei IPCEI (Important Project of Common European Interest) kind/enhancement Enhancement, improvement, extension cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels Apr 25, 2025
@gardener-prow gardener-prow bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Apr 25, 2025
@timuthy
Copy link
Member

timuthy commented Apr 25, 2025

/assign

@ScheererJ
Copy link
Member

/assign

Copy link
Member

@ScheererJ ScheererJ left a comment

Choose a reason for hiding this comment

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

Now, we can expand autonomous clusters beyond one node. Thanks a lot for that.

@ScheererJ
Copy link
Member

/lgtm

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2025
@timebertt
Copy link
Member

/assign

Copy link
Member

@timebertt timebertt left a comment

Choose a reason for hiding this comment

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

Very nice PR!

@gardener-prow gardener-prow bot removed the lgtm Indicates that a PR is ready to be merged. label May 6, 2025
@gardener-prow gardener-prow bot requested review from ScheererJ, timebertt and timuthy May 6, 2025 15:16
@timebertt
Copy link
Member

I tested the token create + join flow, and it worked great on the first try. Love it!

@rfranzke rfranzke requested a review from timebertt May 8, 2025 07:25
Copy link
Member

@timebertt timebertt left a comment

Choose a reason for hiding this comment

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

Thanks a lot! Looks great :)

@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label May 8, 2025
Copy link
Contributor

gardener-prow bot commented May 8, 2025

LGTM label has been added.

Git tree hash: 1596408e7c16ba88a6a7695f59f8627a8520f5d7

@gardener-prow gardener-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2025
rfranzke added 11 commits May 8, 2025 14:38
After gardener@4970ff1,
we have a static DNS name for the control plane, so let's use it when
computing the kubeconfig.

This will be helpful later when we generate a `gardenadm join` command.
This will make `gardenadm init` automatically create and prepare an
`Secret` containing an `OperatingSystemConfig` for the worker pool.
This `Secret` is later downloaded by `gardener-node-agent` when running
`gardenadm join` on the to-be-joined machine.
Similar to gardener@a1bac58

This allows use to drop the `nodeagentosc` webhook in `provider-local`
(as anticipated in above mentioned commit).
We don't have `Shoot`, `CloudProfile`, etc. resources when running
`gardenadm join`. Yet, we would like to use functionality of the
`AutonomousBotanist`.
In the next commit, we will use this to check if the GNA unit has been
created already (with the ultimate goal to make `gardenadm join`
idempotent).
See e.g.
https://prow.gardener.cloud/view/gs/gardener-prow/pr-logs/pull/gardener_gardener/11942/pull-gardener-e2e-kind-gardenadm/1920423004655849472:
- it might take > 1m for the images to be pulled, the containers to
  be started, and the controller to remove the taint
@gardener-prow gardener-prow bot removed the lgtm Indicates that a PR is ready to be merged. label May 8, 2025
@gardener-prow gardener-prow bot requested a review from timebertt May 8, 2025 12:38
@gardener-prow gardener-prow bot added the lgtm Indicates that a PR is ready to be merged. label May 8, 2025
Copy link
Contributor

gardener-prow bot commented May 8, 2025

LGTM label has been added.

Git tree hash: 77a7675d56842958186e1e1c213e13aa0fdd52f5

Copy link
Contributor

gardener-prow bot commented May 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: timebertt

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

@gardener-prow gardener-prow bot merged commit 1a53fc3 into gardener:master May 8, 2025
19 checks passed
@rfranzke rfranzke deleted the gep28/join branch May 9, 2025 06:43
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. area/ipcei IPCEI (Important Project of Common European Interest) cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension 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.

4 participants