Skip to content

Instantly share code, notes, and snippets.

@superseb
Last active September 21, 2024 15:37
Show Gist options
  • Save superseb/a4fa9640d801c54452132db8af51f2e4 to your computer and use it in GitHub Desktop.
Save superseb/a4fa9640d801c54452132db8af51f2e4 to your computer and use it in GitHub Desktop.
Check kubelet nodefs/imagefs
#!/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
Copy link

I got the 403 code when running this script, can you please help?

@superseb
Copy link
Author

@leqduyvp I updated it, let me know if it works for you

@aceqbaceq
Copy link

got nothing

@leqduyvp
Copy link

leqduyvp commented Sep 21, 2024

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