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

Document workaround for Windows git bash shortcoming running agnhost inside Pod #49555

Open
DanielWTQ opened this issue Jan 26, 2025 · 14 comments
Labels
language/en Issues or PRs related to English language needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@DanielWTQ
Copy link

This is a Bug Report

Problem:

The instructions on https://kubernetes.io/docs/tutorials/hello-minikube/ in Create a Deployment for step 1 say

# Run a test container image that includes a webserver
kubectl create deployment hello-node --image=registry.k8s.io/e2e-test-images/agnhost:2.39 -- /agnhost netexec --http-port=8080

However, for users on windows using git bash, this command does not work. I found #46219 and the related kubernetes/kubectl#1599, and the suggestion there to use powershell or command prompt (cmd) both seemed to resolve the issue.

Proposed Solution: Document this known issue and the solution so that people don't need to go searching for those tasks

Page to Update:
https://kubernetes.io/docs/tutorials/hello-minikube/

@DanielWTQ DanielWTQ added the kind/bug Categorizes issue or PR as related to a bug. label Jan 26, 2025
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 26, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG Docs takes a lead on issue triage for this website, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@utkarsh-singh1
Copy link
Contributor

The issue still seems to be unresolved in the previous issues, #46219 and #1599, solution would be to inform Windows users to use PowerShell or cmd instead of git bash.

@utkarsh-singh1
Copy link
Contributor

Image

Mention "(Use cmd or powershell in case if you are running this command in windows.") here in end of step 1 (https://kubernetes.io/docs/tutorials/hello-minikube/#create-a-deployment)

@sftim
Copy link
Contributor

sftim commented Jan 26, 2025

This seems very specific. What's the issue with using bash inside Git bash on a Windows client?

/remove-kind bug

@k8s-ci-robot k8s-ci-robot added needs-kind Indicates a PR lacks a `kind/foo` label and requires one. and removed kind/bug Categorizes issue or PR as related to a bug. labels Jan 26, 2025
@sftim
Copy link
Contributor

sftim commented Jan 26, 2025

/language en

/retitle Document workaround for Windows git bash shortcoming running agnhost inside Pod

@k8s-ci-robot k8s-ci-robot changed the title tutorials/hello-minikube: please document /agnhost Windows workaround Document workaround for Windows git bash shortcoming running agnhost inside Pod Jan 26, 2025
@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Jan 26, 2025
@utkarsh-singh1
Copy link
Contributor

utkarsh-singh1 commented Jan 26, 2025

The issue seems to be an issue with Git-bash in windows, it does not run container when it is deployed -

Image

@utkarsh-singh1
Copy link
Contributor

But it runs on Windows inbuilt cmd -

Image

@utkarsh-singh1
Copy link
Contributor

This seems very specific. What's the issue with using bash inside Git bash on a Windows client?

Issue still present on bash inside windows terminal.

@DanielWTQ
Copy link
Author

This seems very specific. What's the issue with using bash inside Git bash on a Windows client?

Its what @utkarsh-singh1 explained - if you look at the screenshot from #49555 (comment), the command that gets executed in the container when it is started from git bash is not /agnhost but rather C:/Program Files/Git/agnhost which does not work

@sftim
Copy link
Contributor

sftim commented Jan 27, 2025

We could list a prerequisite and mention that Git bash isn't compatible due to special behavior. Does that sound:

  • correct
  • appropriate

?

@DanielWTQ
Copy link
Author

We could list a prerequisite and mention that Git bash isn't compatible due to special behavior. Does that sound:

  • correct
  • appropriate

?

I think it is just this one command that doesn't work with git bash, and for those of us (like myself) who prefer to use it, I think it would be preferable to just document that the single command requires using a different terminal.

I've actually run into a similar situation for work in the context of docker, and you can see how we documented the limitation of git bash at https://wikiteq.com/post/setting-up-a-local-wiki

For setting up MediaWiki, employ the command below. (Note for Windows users: This command is incompatible with Git for Windows; instead, utilize Windows PowerShell exclusively for this command.)

though in hindsight I guess we should have also said that cmd works, the point is that just a short notice before the command seemed to be enough to document this

@utkarsh-singh1
Copy link
Contributor

utkarsh-singh1 commented Jan 29, 2025

Is this property of git bash in windows, as

  • Git Bash runs /agnhost command in

/agnhost netexec --http-port=8080

as C:/Program Files/Git/agnhost

Which obviously it's not going to find, as it is not the image directory.

@utkarsh-singh1
Copy link
Contributor

But cmd runs the /agnhost command in

/agnhost netexec --http-port=8080 as /agnhost against the image.

@utkarsh-singh1
Copy link
Contributor

Output from the image.
Image
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/en Issues or PRs related to English language needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants