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

Ability to set extra SANs to the API server certificate #3755

Closed
maksym-iv opened this issue Oct 8, 2024 · 2 comments
Closed

Ability to set extra SANs to the API server certificate #3755

maksym-iv opened this issue Oct 8, 2024 · 2 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@maksym-iv
Copy link

maksym-iv commented Oct 8, 2024

What would you like to be added:
Ability to set extra SANs for the API server certificate

Why is this needed:
In some cases, if apiServerAddress is modified (which is highly not recommended for sure, and should be done if implications are clear) it may be needed to se custom SANs. Example use-case:

  • Temporary AWS instance with the ephemeral pub IP
  • Kind cluster set up in that AWS instance
  • apiServerAddress is set to the internal EC2 IP
  • External CI system communicates with the temporary Kind cluster
  • Error Unable to connect to the server: tls: failed to verify certificate: x509: certificate is valid for 10.96.0.1, 172.18.0.2, 0.0.0.0, not 18.118.189.168

Setting apiServerAddress to the external IP will fail because it is not the EC2 IP and failed to listen on the ${EXTERNAL_IP} will be risen, so adding extra SANs capabilities would help in such cases.

@maksym-iv maksym-iv added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 8, 2024
@maksym-iv maksym-iv changed the title Ability to set SANs to the API server certificate Ability to set extra SANs to the API server certificate Oct 8, 2024
@maksym-iv
Copy link
Author

maksym-iv commented Oct 9, 2024

UPD, no need for any additional feature feature, possible to achieve with the Kubeadm Config Patches

kind: Cluster
name: local
apiVersion: kind.x-k8s.io/v1alpha4
networking:
  apiServerAddress: "0.0.0.0"
  apiServerPort: 6443
nodes:
  - role: control-plane
kubeadmConfigPatchesJSON6902:
- group: kubeadm.k8s.io
  version: v1beta3
  kind: ClusterConfiguration
  patch: |
    - op: add
      path: /apiServer/certSANs/-
      value: YOUR_SAN_GOES_HERE
    - op: add
      path: /apiServer/certSANs/-
      value: YOUR_ANOTHER_SAN_GOES_HERE

Additional thanks to @aojea for the suggestion

@BenTheElder
Copy link
Member

thanks @aojea @maksym-iv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants