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

How can I curl exec Pod? #55

Closed
minerba opened this issue Mar 26, 2021 · 3 comments
Closed

How can I curl exec Pod? #55

minerba opened this issue Mar 26, 2021 · 3 comments

Comments

@minerba
Copy link

minerba commented Mar 26, 2021

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
Copy link
Member

ityuhui commented Mar 27, 2021

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

@brendandburns
Copy link
Contributor

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

@minerba
Copy link
Author

minerba commented Mar 29, 2021

@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 ))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants