GithubHelp home page GithubHelp logo

Send complex command about kubectl-plugins HOT 3 OPEN

evlahos avatar evlahos commented on July 20, 2024
Send complex command

from kubectl-plugins.

Comments (3)

luksa avatar luksa commented on July 20, 2024

You probably need to add a -- in front of the command, just like with kubectl exec and others. Not sure which plugin you're invoking, but the command should be:

kubectl someplugin -- some-command --with-options

from kubectl-plugins.

evlahos avatar evlahos commented on July 20, 2024

Hi Luksa
I'm trying the ssh plugin and I want to send "ls -l"
When I send only "ls": e.g. ...ssh node nodeName ls, it works as expected.
but for "ls -l" I have the above error: e.g. ...ssh node nodeName ls -l
I have also tried:
1.
.....ssh node worker-pool1-99xlmfat-n200-vpod1-dsc8989-ipv4 --ls
Warning: would violate PodSecurity "restricted:latest": host namespaces (hostNetwork=true, hostPID=true, hostIPC=true), privileged (container "ssh-node" must not set securityContext.privileged=true), allowPrivilegeEscalation != false (container "ssh-node" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "ssh-node" must set securityContext.capabilities.drop=["ALL"]), restricted volume types (volume "host" uses restricted volume type "hostPath"), runAsNonRoot != true (pod or container "ssh-node" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "ssh-node" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
Created pod/ssh-node-7cxf8
Waiting for container to start...
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "a712e90eb12b64a3d8f1e6bcbde0a3dfa57347c26230212dc147060b2978c934": OCI runtime exec failed: exec failed: unable to start container process: exec: "--ls": executable file not found in $PATH: unknown
pod "ssh-node-7cxf8" deleted

....ssh node worker-pool1-99xlmfat-n200-vpod1-dsc8989-ipv4 -- ls
Error: must specify one of -f and -k

error: unknown command "ls -f -"
See 'kubectl create -h' for help and examples

BR
Vaggelis

from kubectl-plugins.

yalginayyaltirik avatar yalginayyaltirik commented on July 20, 2024

Did the bug fixed? I want to execute the following but it does not work

kubectl ssh node gke-cluster-1-default-pool-5a105e18-9wlf && sudo iptables -t nat -I PREROUTING 1 -s 10.68.1.22 -d 10.3.5.227 -j DNAT --to-destination 10.124.1.25 && sudo iptables -t nat -I POSTROUTING 1 -s 10.68.1.22 -d 10.68.1.24 -j MASQUERADE

Desired update is not performed, but if I execute it into the machine it works.

from kubectl-plugins.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.