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

send env before shell in k9s #2244

Open
mertyakan opened this issue Oct 10, 2023 · 0 comments · May be fixed by #2345
Open

send env before shell in k9s #2244

mertyakan opened this issue Oct 10, 2023 · 0 comments · May be fixed by #2345
Labels
enhancement New feature or request

Comments

@mertyakan
Copy link




I want to send an env before the shell on K9s. I'm researching the K9s configuration, podShell might work, but I wasn't successful.

When I send the Kubectl command manually, I get successful results;

kubectl -n default exec -it target -- env "NEW USER=$USER" bash
root@target:/# env |grep NEW
NEWUSER=mert

I want to add "NEWUSER=$USER" env before entering the shell.
I tried add to podShell but not work.

      shellPod:
        image: busybox:1.31
        command:
        - env
        args:
        - NEWUSER=$USER
        - bash

I tried many solutions. I saw the pod shell command in the K9s logs;

/usr/local/bin/kubectl --context kubernetes-admin@kubernetes exec -it -n default hede -c hede -- sh -c command -v bash >/dev/null && exec bash || exec sh

Maybe it will work, but I couldn't change the code sent.

Is it possible to add this env before shell?

@derailed derailed added the enhancement New feature or request label Nov 21, 2023
@wonko wonko linked a pull request Dec 14, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants