Last active
October 22, 2024 16:13
Revisions
-
lizrice revised this gist
Aug 24, 2018 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,13 @@ curl -sk https://localhost:10250/pods/ * If `--anonymous-auth` is `true` and `--authorization-mode` is `Webhook` you'll see `403 Forbidden` response with message `Forbidden (user=system:anonymous, verb=get, resource=nodes, subresource=proxy)` * If `--anonymous-auth` is `true` and `--authorization-mode` is `AlwaysAllow` you'll see a list of pods. ## Execing into a pod ```bash curl -skv -X POST -H "X-Stream-Protocol-Version: v2.channel.k8s.io" -H "X-Stream-Protocol-Version: channel.k8s.io" "https://localhost:10250/exec/<namespace>/<pod name>/<container name>/?command=touch&command=hello_world&input=1&output=1&tty=1" ``` This gives a `302 Found` response on v1.9 but execing into the pod directly shows no evidence of the file being created. On v1.11 there was an `Upgrade request required` response - maybe TLS issue? ## Changing kubelet settings Edit `/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` -
lizrice revised this gist
Aug 24, 2018 . 1 changed file with 16 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,4 +2,19 @@ ```bash curl -sk https://localhost:10250/pods/ ``` * If `--anonymous-auth` is turned off, you will see a `401 Unauthorized` response. * If `--anonymous-auth` is `true` and `--authorization-mode` is `Webhook` you'll see `403 Forbidden` response with message `Forbidden (user=system:anonymous, verb=get, resource=nodes, subresource=proxy)` * If `--anonymous-auth` is `true` and `--authorization-mode` is `AlwaysAllow` you'll see a list of pods. ## Changing kubelet settings Edit `/etc/systemd/system/kubelet.service.d/10-kubeadm.conf` ```bash sudo systemctl daemon-reload sudo systemctl restart kubelet.service ``` Or, if the settings are in /var/lib/kubelet/config.yaml, edit the config file and then `sudo systemctl restart kubelet.service`. -
lizrice created this gist
Aug 24, 2018 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ # Accessing Kubelet API ```bash curl -sk https://localhost:10250/pods/ ```