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

Issue certificate to host.docker.internal #2878

Closed
skhaz opened this issue Aug 13, 2022 · 6 comments
Closed

Issue certificate to host.docker.internal #2878

skhaz opened this issue Aug 13, 2022 · 6 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@skhaz
Copy link

skhaz commented Aug 13, 2022

What would you like to be added:
I want the certificate issued on kind-control-plane to be issued to host.docker.internal too; with this, I can use it with docker-compose

Why is this needed:
In my docker-compose file, I have this line

extra_hosts:
  - "host.docker.internal:host-gateway"

With this, I can connect to kind. However, the certificate is issued to localhost; with this change, other people will be able to use docker-compose along with Kind.

The error

app-1       | panic: Get "https://host.docker.internal:33345/apis/apps/v1/namespaces/argo/deployments": x509: certificate is valid for kind-control-plane, kubernetes, kubernetes.default, kubernetes.default.svc, kubernetes.default.svc.cluster.local, localhost, not host.docker.internal
@skhaz skhaz added the kind/feature Categorizes issue or PR as related to a new feature. label Aug 13, 2022
@BenTheElder
Copy link
Member

There’s past discussion of this in the tracker, will circle back to this later. in the meantime you can add additional host names yourself (sample config in past discussions)

@skhaz
Copy link
Author

skhaz commented Aug 15, 2022

I could not find it. Could you please give an example @BenTheElder?

@BenTheElder
Copy link
Member

#566 (comment) (though drop the version field from the sample patch there, it's not necessary as the certSAN field is stable in kubeadm and v1beta1 is not used in current Kubernetes realases)

@skhaz
Copy link
Author

skhaz commented Aug 15, 2022

Thank you

@skhaz
Copy link
Author

skhaz commented Aug 15, 2022

For reference

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
kubeadmConfigPatchesJSON6902:
- group: kubeadm.k8s.io
  version: v1beta3
  kind: ClusterConfiguration
  patch: |
    - op: add
      path: /apiServer/certSANs/-
      value: host.docker.internal

@skhaz skhaz closed this as completed Aug 15, 2022
@BenTheElder
Copy link
Member

(though drop the version field from the sample patch there, it's not necessary as the certSAN field is stable in kubeadm and v1beta1 is not used in current Kubernetes realases)

ugh, forgot, #1332

this should be v1beta3 for current kubernetes. To target all recent versions you could also include a patch for v1beta2 and v1beta3 and the matching patch will be used.

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

No branches or pull requests

2 participants