I\'m trying to execute command in a contianer (in a Kubernetes POD on GKE with kubernetes 1.1.2).
Reading documentation I understood that I can use GET or POST quer
Use websocket client it's work.
In my local kuberenetes cluster, the connection metadata like this:
ApiServer = "172.21.1.11:8080"
Namespace = "default"
PodName = "my-nginx-3855515330-l1uqk"
ContainerName = "my-nginx"
Commands = "/bin/bash"
the connect url:
"ws://172.21.1.11:8080/api/v1/namespaces/default/pods/my-nginx-3855515330-l1uqk/exec?container=my-nginx&stdin=1&stdout=1&stderr=1&tty=1&command=%2Fbin%2Fbash"
On maxos, a wsclient CLI tool: wscat, you can use it as a test tool:
You can access the websocket example: "https://github.com/lth2015/container-terminal"