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

feat: Ability to set SANs to the API server certificate #3756

Closed
wants to merge 1 commit into from

Conversation

maksym-iv
Copy link

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

Fixes #3755

Copy link

linux-foundation-easycla bot commented Oct 8, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: maksym-iv
Once this PR has been reviewed and has the lgtm label, please assign bentheelder 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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Oct 8, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @maksym-iv!

It looks like this is your first PR to kubernetes-sigs/kind 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kind has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @maksym-iv. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 8, 2024
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Oct 8, 2024
@BenTheElder
Copy link
Member

Hi, our process is to discuss the approach to features first and agree to the feature and an approach before reviewing code that we will have to maintain.

This is covered in our contributor guide: https://kind.sigs.k8s.io/docs/contributing/getting-started/

@maksym-iv
Copy link
Author

Hi, our process is to discuss the approach to features first and agree to the feature and an approach before reviewing code that we will have to maintain.

This is covered in our contributor guide: https://kind.sigs.k8s.io/docs/contributing/getting-started/

Sure, my bad. I've created the issue before PR and opened a PR just to demonstrate the potential approach, can close the PR.
And yep, my bad, I somehow missed the

Please file an enhancement / feature request issue to discuss features before filing a PR

@aojea
Copy link
Contributor

aojea commented Oct 9, 2024

So, you can already do this with kubeadm patches https://kind.sigs.k8s.io/docs/user/configuration/#kubeadm-config-patches

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
kubeadmConfigPatchesJSON6902:
- group: kubeadm.k8s.io
  version: v1beta2
  kind: ClusterConfiguration
  patch: |
    - op: add
      path: /apiServer/certSANs/-
      value: 172.16.0.2
networking:
  apiServerAddress: "0.0.0.0"
  apiServerPort: 6443

this is just exposing this through the kind API, but for the end user is just 1 line of yaml vs 8 lines of yaml, and will conflict with existing solution of using patches

@maksym-iv
Copy link
Author

this is just exposing this through the kind API, but for the end user is just 1 line of yaml vs 8 lines of yaml, and will conflict with existing solution of using patches

Sure, makes sense, closing than. Thanks for clarification

@maksym-iv maksym-iv closed this Oct 9, 2024
@BenTheElder
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. 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.

Ability to set extra SANs to the API server certificate
4 participants