alexellis / arkade

Open Source Marketplace For Developer Tools
https://blog.alexellis.io/kubernetes-marketplace-two-year-update/
MIT License
4.2k stars 287 forks source link

Helm install on Windows 10 fails #359

Open art-cg opened 3 years ago

art-cg commented 3 years ago

Expected Behaviour

Helm should be installed correctly. Or better detect if helm is allready installed and skip the installation.

Current Behaviour

Helm 3.5.3 is allreday installed before (not with arkade)

Git Bash: $ arkade install cert-manager Using Kubeconfig: C:\Users\georg/.kube/config Client: x86_64, MINGW64_NT-10.0-19042 2021/03/29 15:13:55 User dir established as: C:\Users\georg/.arkade/ https://get.helm.sh/helm-v3.5.2-windows-amd64.zip name helm-v3.5.2-windows-amd64.zip size: 12532505 C:\Users\georg\AppData\Local\Temp/windows-amd64 C:\Users\georg\AppData\Local\Temp/helm.exe C:\Users\georg\AppData\Local\Temp/LICENSE C:\Users\georg\AppData\Local\Temp/README.md 2021/03/29 15:14:00 error extracting zip into C:\Users\georg\AppData\Local\Temp after 3 files, 0 dirs, 2.3248357s: open C:\Users\georg\AppData\Local\Temp/README.md: is a directory Error: open C:\Users\georg\AppData\Local\Temp/README.md: is a directory

Possible Solution

Skip helm installation or success for installation

Steps to Reproduce (for bugs)

Git Bash: arkade install cert-manager

Your Environment

Windows 10, Git Bash 2.31

kubectl version 1.20

Windows 10

arkade version:  0.7.10
alexellis commented 3 years ago

Interesting to see this reported, because I am pretty sure I ran through this workflow and it worked for me.

@nunix can you take a look with Git Bash and advise?

alexellis commented 3 years ago

@art-cg are you willing to investigate or work on a fix?

Can you also try something else for us?

arkade get helm

arkade get faas-cli
art-cg commented 3 years ago

It depends if the Bash is startet as User or as Admin. It seems like it works as Admin. But than i have to install Helm, kubectl and others on Admin-Account, or link it.

I do not know if the First 3 Lines are normal for starting Git bash as user.

I can help investigate. But i can not help with a fix.

User-Account:

bash: autoload: command not found bash: emulate: command not found bash: setopt: command not found

georg@GEORG-T15 MINGW64 ~ $ arkade get helm Downloading helm https://get.helm.sh/helm-v3.5.2-windows-amd64.zip 11.95 MiB / 11.95 MiB [------------------------------------------------] 100.00% name helm-v3.5.2-windows-amd64.zip size: 12532505 C:\Users\georg\AppData\Local\Temp/windows-amd64 C:\Users\georg\AppData\Local\Temp/helm.exe C:\Users\georg\AppData\Local\Temp/LICENSE C:\Users\georg\AppData\Local\Temp/README.md 2021/03/31 10:51:03 error extracting zip into C:\Users\georg\AppData\Local\Temp after 3 files, 0 dirs, 2.5426425s: open C:\Users\georg\AppData\Local\Temp/README.md: is a directory Error: check with the vendor whether this tool is available for your system: open C:\Users\georg\AppData\Local\Temp/README.md: is a directory

georg@GEORG-T15 MINGW64 ~ $ arkade get faas-cli Downloading faas-cli https://github.com/openfaas/faas-cli/releases/download/0.13.9/faas-cli.exe 8.37 MiB / 8.37 MiB [---------------------------------------------------------------------------------------------------------------------------] 100.00% Tool written to: C:\Users\georg/.arkade/bin/faas-cli.exe

Add (faas-cli.exe) to your PATH variable

export PATH=$PATH:$HOME/.arkade/bin/

Test the binary:

C:\Users\georg/.arkade/bin/faas-cli.exe

Or install with:

sudo mv C:\Users\georg/.arkade/bin/faas-cli.exe /usr/local/bin/

Admin-Account:

Helm is not installed on Admin Account before. $ arkade get helm bash: arkade: command not found

itp-admin@GEORG-T15 MINGW64 ~ $ curl -sLS https://dl.get-arkade.dev | sh Downloading package https://github.com/alexellis/arkade/releases/download/0.7.10/arkade.exe as /c/Users/itp-admin/arkade.exe Download complete.

Running with sufficient permissions to attempt to move arkade to /c/Users/itp-admin/bin New version of arkade installed to /c/Users/itp-admin/bin which: no ark in (/c/Users/itp-admin/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/itp-admin/bin:....) Creating alias 'ark' for 'arkade'. | | _ _| | / _| '__| |/ / _ |/ ` |/ \ | (| | | | < (| | (| | / \,|| ||__,|_,|___|

Get Kubernetes apps the easy way

Version: 0.7.10 Git Commit: 0931a3af1754c0e5fdd4013b666cdac2821a300d

itp-admin@GEORG-T15 MINGW64 ~ $ arkade get helm Downloading helm https://get.helm.sh/helm-v3.5.2-windows-amd64.zip 11.95 MiB / 11.95 MiB [------------------------------------------------] 100.00% name helm-v3.5.2-windows-amd64.zip size: 12532505 C:\Users\ITP-AD~1\AppData\Local\Temp/windows-amd64 C:\Users\ITP-AD~1\AppData\Local\Temp/helm.exe C:\Users\ITP-AD~1\AppData\Local\Temp/LICENSE C:\Users\ITP-AD~1\AppData\Local\Temp/README.md 2021/03/31 10:56:44 extracted zip into C:\Users\ITP-AD~1\AppData\Local\Temp: 4 files, 0 dirs (1.3961933s) Tool written to: C:\Users\itp-admin/.arkade/bin/helm.exe

Add (helm.exe) to your PATH variable

export PATH=$PATH:$HOME/.arkade/bin/

Test the binary:

C:\Users\itp-admin/.arkade/bin/helm.exe

Or install with:

sudo mv C:\Users\itp-admin/.arkade/bin/helm.exe /usr/local/bin/

nunix commented 3 years ago

Hi @art-cg @alexellis

I did an install from scratch with git bash of helm and then cert-manager. The only error, which is a normal one for me, was the connection to K8s (not running at the time of testing), however I think I understand the initial request but not sure if we're dealing here with a "should work as intended": image

Caption: on the left, as User session, on the right an Admin session

Workflow:

  1. [User] install Arkade
  2. [Admin] run ark

Test result: it worked fine, the install from the user is seen when launching another Git Bash session as an Admin

Point for @art-cg: I saw in your outputs that your run as Administrator is actually a second local account (itp-admin) where your normal account is georg > this explains why you didn't saw anything installed as you literally use two different accounts

image

Caption: Helm is installed as a User

Workflow:

  1. [User] ark get helm

Test result: it worked fine, helm is correctly installed and there is no error C:\Users\georg\AppData\Local\Temp/README.md: is a directory

Point for @art-cg: can you try, as your normal user, to do a dir C:\Users\georg\AppData\Local\Temp and see if you have the permissions? My current guess is that your normal user cannot write to "system" folders, such as AppData, and you do need indeed to use an admin session/permissions to do so. I would recommend that your account is updated (GPOs?) in order to run git bash as an administrator without the change of login.

image

Caption: Cert-Manager is installed and as you pointed out, @art-cg, it re-downloads Helm

Workflow: ark install cert-manager

Test result: the install worked fine, however as stated above, a K8s instance was not running, so it ended with an error but rightfully so.

Point for @alexellis: as @art-cg mentioned above, this seems to be the real issue and the request here is more if Arkade can have a check if Helm.exe already exists so it bypasses this "second" install.

Hope this helps and also that I understood your issue @art-cg

BR

art-cg commented 3 years ago

@nunix Thanks for the investigation and the infos. Yes this pc is under GOP. I can create Folder and Files in C:\Users\georg\AppData\Local\Temp\ with my normal user account.

I noticed that you do not have the 3 warnings that i have while starting Git Bash as user. Yes these are 2 different Accounts. A user account and an local admin. I could work with the local admin account and install all the tools in the admin-account. But that is not what i want.

Fix

I checked the /temp/ Folder and there was a write protected Folder "README.md". In this Folder was an empty Folder ".idea". After renaming this folder it works now.

I am not sure how this Folder was generated. If i can trust the Timestamp it was before i installed arcade. Maybe it is just a silly edge case or the Folder was created from arkade and the timestamp is wrong.

A possible solution is to use as subfolder in /temp/ with a random generated uuid as name. So there are no conflicts. I am not sure if is worth the effort if this was just a edge case for me.

P.S. Would be great if arcade can check if helm is allready installed. Maybe in another ticket, so this one can be closed.