Skip to content

Commit

Permalink
Documentation for Debugging Snapshotter
Browse files Browse the repository at this point in the history
  • Loading branch information
Dharma-09 authored Jul 9, 2024
1 parent 084242e commit a81eb41
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions cluster-autoscaler/debuggingsnapshot/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# Debugging Snapshotter
It's a tool to visualize the internal state of cluster-autoscaler at a point in time to help debug autoscaling issues.

---
### Requirements
Require Cluster-autoscaler versions 1.24+
Require Cluster-autoscaler versions **1.24+**

---
#### What data snapshotter can capture?
https://github.com/kubernetes/autoscaler/blob/8cf630a3e33ed3656cb4e669461bec197b77f2bb/cluster-autoscaler/debuggingsnapshot/debugging_snapshot.go#L60C1-L71C1
```go
Expand All @@ -24,12 +22,15 @@ Add the following flag to your cluster-autoscaler configuration to enable the sn
```
--debugging-snapshot-enabled=true
```

#### How to nevigate JSON file?
To access the sapshot from the command line, use the following command:
```
curl http://127.0.0.1:8085/snapshotz > FIlE_NAME.json
```
How to nevigate JSON file?

```sh
cat tmp.json | jq 'keys'
cat tmp.json | jq '.NodeList | keys' //to see how many nodes are running
cat tmp.json | jq '.TempletsNodes | keys' //to see templated nodes
cat tmp.json | jq '.UnscheduledPodsCanBeScheduled | keys' //to see unscheduled pods that can be scheduled
```
cat FIlE_NAME.json | jq 'keys'
cat FIlE_NAME.json | jq '.NodeList | keys' //to see how many nodes are running
cat FIlE_NAME.json | jq '.TempletsNodes | keys' //to see templated nodes
cat FIlE_NAME.json | jq '.UnscheduledPodsCanBeScheduled | keys' //to see unscheduled pods that can be scheduled
```

0 comments on commit a81eb41

Please sign in to comment.