kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
144 stars 46 forks source link

How can I curl exec Pod? #55

Closed minerba closed 3 years ago

minerba commented 3 years ago

I m trying to this command

================================================================= curl -k -H "Authorization: Bearer $TOKEN" -H 'Accept: application/json' https://10.96.0.1:80/api/v1/namespaces/default/pods/My-Pod/exec

=================================================================

But I receive below Json Message { "kind": "Status", "apiVersion": "v1", "metadata": {

}, "status": "Failure", "message": "Upgrade request required", "reason": "BadRequest", "code": 400 }

I think ... Curl can't use TCP websocket.

How can I use Exec API???

// connect GET requests to portforward of Pod CoreV1API_connectGetNamespacedPodPortforward(apiClient_t apiClient, char name , char * _namespace , int ports );

If I am using API wrong, please give me comment

ityuhui commented 3 years ago

So far, the C client does not support websocket releated features e.g. exec, attach, and port-forward.

brendandburns commented 3 years ago

Also, you're using the curl command, not this client library. If you are using the command line, you should just use kubectl

minerba commented 3 years ago

@ityuhui Do you have any plans to provide exec Pod api in the future?

(CoreV1API_connectGetNamespacedPodPortforward(apiClient_t apiClient, char name , char * _namespace , int ports ))