Did you know if you run kubectl with -v=10 it prints the equivalent curl command for the command you just ran? Try "kubectl exec -v=10 $PODNAME -- ls"
On Saturday, July 29, 2017 at 4:50:14 AM UTC-7, Matthias Rampke wrote: > > I haven't tried this, but IIRC the required upgrade is to HTTP/2. Try > `curl --http2`? > > /MR > > On Sat, Jul 29, 2017, 05:31 Rodrigo Campos <[email protected] > <javascript:>> wrote: > >> If it wasn't resolved as it's not in the documentation wiki (sorry, away >> from laptop now) you can probably check how kubectl exec does it. It might >> not be the simpler code, but it may shed some light >> >> On Friday, July 28, 2017, Madhukar Nayakbomman <[email protected] >> <javascript:>> wrote: >> >>> Hi Robinly, >>> >>> How did you work through this issue? Is there any API which we can use >>> for executing a command in a container? >>> >>> Thanks, >>> Madhukar >>> >>> On Tuesday, February 28, 2017 at 1:30:09 AM UTC-8, Robinly wrote: >>>> >>>> I want to execute command in a container using k8s API, don't use any >>>> libraries or tools. >>>> >>>> Example: >>>> curl -XPOST " >>>> http://172.25.255.22:8080/api/v1/namespaces/default/pods/redis-master-1qpyf/exec?commond=ls&container=master&container=master&stderr=true&stdout=true >>>> " >>>> { >>>> "kind": "Status", >>>> "apiVersion": "v1", >>>> "metadata": {}, >>>> "status": "Failure", >>>> "message": "Upgrade request required", >>>> "reason": "BadRequest", >>>> "code": 400 >>>> } >>>> >>>> there is a error. >>>> >>>> The /api/v1/proxy should I use? what should I do? >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Kubernetes user discussion and Q&A" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To post to this group, send email to [email protected]. >>> Visit this group at https://groups.google.com/group/kubernetes-users. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Kubernetes user discussion and Q&A" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/kubernetes-users. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/kubernetes-users. For more options, visit https://groups.google.com/d/optout.
