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

Windows instructions for setting certificate are not working #147

Open
martinlosse opened this issue Nov 26, 2020 · 3 comments
Open

Windows instructions for setting certificate are not working #147

martinlosse opened this issue Nov 26, 2020 · 3 comments

Comments

@martinlosse
Copy link

martinlosse commented Nov 26, 2020

The windows instructions for Copy Kubernetes CA Certificate From PEM do not work in Powershell. In our deployment of dex (v1.2.0) the following command is proposed:

mkdir -p ${HOME}/.kube/certs/k8s.dev.example.com/ && cat << EOF > ${HOME}/.kube/certs/k8s.dev.example.com/k8s-ca.crt
-----BEGIN CERTIFICATE-----
<certificate her>
-----END CERTIFICATE-----

EOF

I think the problem is with a lack of support for <<

A Powershell friendlier version might look like this:

mkdir -p ${HOME}/.kube/certs/k8s.dev.example.com/ && `
"-----BEGIN CERTIFICATE-----
<certificate here>
-----END CERTIFICATE-----" > ${HOME}/.kube/certs/k8s.dev.example.com/k8s-ca.crt
@nabadger
Copy link
Contributor

@summon128 there's a related (but old) PR at #86

I don't have a Windows box readily available so always found testing a bit of a pain :)

Couple of question really.

  1. Does the introduction of WSL help here? i.e. is specific support for powershell still required these days?
  2. Do you also require the use of %USERPROFILE% in the related PR, or is $HOME sufficient?

@martinlosse
Copy link
Author

WSL can help, but obviously only if you have it installed, which it is not by default. And even then there's additional setup involved if you want to share the kubectl configuration between Windows and the Linux subsystem (namely linking config directories between the user homes which will be different for Windows and WSL).

Regarding %USERPROFILE% vs $HOME my observation is that the first one returns the user's home directory in the old command prompt but not in Powershell, while the latter does not yield a result in CMD but returns the user's home directory in Powershell.

@marians
Copy link

marians commented Jan 11, 2022

At Giant Swarm (on the customer side) we have actual users who would like to use the generated Windows commands either in cmd.exe or in PowerShell. If we can help to advance in the direction of #86 please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants