Skip to content

Conversation

rfranzke
Copy link
Member

@rfranzke rfranzke commented Mar 6, 2025

How to categorize this PR?

/area usability
/kind enhancement

What this PR does / why we need it:
This PR write the seed-specific Shoot endpoint served with the control plane wildcard certificate into .status.advertisedAddresses. This only works when such a control plane wildcard certificate is configure by the Gardener operator, i.e., when there is a Secret in the garden namespace of the seed cluster labeled with gardener.cloud/role=controlplane-cert.

Before:

  status:
    advertisedAddresses:
    - name: external
      url: https://api.local.local.external.local.gardener.cloud
    - name: internal
      url: https://api.local.local.internal.local.gardener.cloud
    - name: service-account-issuer
      url: https://discovery.local.gardener.cloud/projects/local/shoots/59f7d506-f3c9-44ef-8b09-8e6fc6dd692f/issuer

Now:

  status:
    advertisedAddresses:
    - name: external
      url: https://api.local.local.external.local.gardener.cloud
    - name: wildcard-tls-seed-bound
      url: https://api-local--local.ingress.local.seed.local.gardener.cloud
    - name: internal
      url: https://api.local.local.internal.local.gardener.cloud
    - name: service-account-issuer
      url: https://discovery.local.gardener.cloud/projects/local/shoots/59f7d506-f3c9-44ef-8b09-8e6fc6dd692f/issuer

Generated kubeconfigs also get this endpoint via a new Cluster entry:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: base64(cluster-ca-cert)
    server: https://api.local.local.external.local.gardener.cloud
  name: garden-local--local-external
- cluster:
    server: https://api-local--local.ingress.local.seed.local.gardener.cloud
  name: garden-local--local-wildcard-tls-seed-bound
- cluster:
    certificate-authority-data: base64(cluster-ca-cert)
    server: https://api.local.local.internal.local.gardener.cloud
  name: garden-local--local-internal
contexts:
- context:
    cluster: garden-local--local-external
    user: garden-local--local-external
  name: garden-local--local-external
- context:
    cluster: garden-local--local-wildcard-tls-seed-bound
    user: garden-local--local-external
  name: garden-local--local-wildcard-tls-seed-bound
- context:
    cluster: garden-local--local-internal
    user: garden-local--local-external
  name: garden-local--local-internal
current-context: garden-local--local-external
kind: Config
preferences: {}
users:
- name: garden-local--local-external
  user:
    client-certificate-data: base64(client-cert)
    client-key-data: base64(client-key)

Release note:

If the Gardener operator has defined a control plane wildcard certificate, the `.status.advertisedAddresses` of the `Shoot` contain an entry with an endpoint secured by this certificate. Note that this endpoint is specific to the seed cluster the `Shoot` is scheduled to. Read all about it in [this document](https://github.com/gardener/gardener/blob/master/docs/usage/shoot/shoot_access.md).

@gardener-prow gardener-prow bot added area/usability Usability related kind/enhancement Enhancement, improvement, extension labels Mar 6, 2025
@gardener-prow gardener-prow bot requested review from ScheererJ and timebertt March 6, 2025 13:29
@gardener-prow gardener-prow bot added cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 6, 2025
@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.

Thanks a lot for this usability improvement. It will certainly make some users quite happy.

Overall, it looks good already. I only have a minor suggestion with regards to the documentation.

rfranzke added 5 commits March 6, 2025 16:06
This code only works under the assumption that the signing CA of the
certificate is the same as the one for the server.

This was introduced 3y ago with
gardener@039631f
when this was the case for Shoots.

Since a longer time, however, we have introduced a dedicated client CA
for shoots, i.e., this defaulting never works in our case.
Let's remove it and rely on the CA data being properly provided via the
`KubeConfigRequest` struct.
@rfranzke rfranzke force-pushed the advertised-address-controlplane-cert branch from 4cff3e6 to d37c02b Compare March 6, 2025 15:06
@rfranzke rfranzke requested a review from ScheererJ March 6, 2025 15:06
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.

/lgtm
/approve

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

gardener-prow bot commented Mar 10, 2025

LGTM label has been added.

Git tree hash: 64cc51f557880b118ac491e416ec429e155fc1f4

Copy link
Contributor

gardener-prow bot commented Mar 10, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ScheererJ

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 10, 2025
@gardener-prow gardener-prow bot merged commit b819488 into gardener:master Mar 10, 2025
19 checks passed
@rfranzke rfranzke deleted the advertised-address-controlplane-cert branch March 10, 2025 11:38
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/usability Usability related 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants