Last active
September 21, 2024 15:37
-
-
Save superseb/a4fa9640d801c54452132db8af51f2e4 to your computer and use it in GitHub Desktop.
Check kubelet nodefs/imagefs
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 characters
#!/bin/bash | |
# nodefs | |
# needs curl and jq | |
# RKE1 | |
curl -sLk --cacert /etc/kubernetes/ssl/kube-ca.pem --cert /etc/kubernetes/ssl/kube-service-account-token.pem --key /etc/kubernetes/ssl/kube-service-account-token-key.pem https://127.0.0.1:10250/stats/summary | jq .node.fs | |
# k3s | |
curl -sLk --cacert /var/lib/rancher/k3s/server/tls/client-ca.crt --cert /var/lib/rancher/k3s/server/tls/client-admin.crt --key /var/lib/rancher/k3s/server/tls/client-admin.key https://127.0.0.1:10250/stats/summary | jq .node.fs | |
df -B1 / | |
# imagefs | |
# needs curl and jq | |
# RKE1 | |
curl -sLk --cacert /etc/kubernetes/ssl/kube-ca.pem --cert /etc/kubernetes/ssl/kube-service-account-token.pem --key /etc/kubernetes/ssl/kube-service-account-token-key.pem https://127.0.0.1:10250/stats/summary | jq .node.runtime.imageFs | |
# k3s | |
curl -sLk --cacert /var/lib/rancher/k3s/server/tls/client-ca.crt --cert /var/lib/rancher/k3s/server/tls/client-admin.crt --key /var/lib/rancher/k3s/server/tls/client-admin.key https://127.0.0.1:10250/stats/summary | jq .node.runtime.imageFs | |
df -B1 $(docker info --format='{{.DockerRootDir}}') |
@leqduyvp I updated it, let me know if it works for you
got nothing
Tested on K3s master and it's working, thank you @superseb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I got the 403 code when running this script, can you please help?