It's a tool to visualize the internal state of cluster-autoscaler at a point in time to help debug autoscaling issues.
Require Cluster-autoscaler versions 1.24+
type DebuggingSnapshotImpl struct {
NodeList []*ClusterNode `json:"NodeList"`
UnscheduledPodsCanBeScheduled []*v1.Pod `json:"UnscheduledPodsCanBeScheduled"`
Error string `json:"Error,omitempty"`
StartTimestamp time.Time `json:"StartTimestamp"`
EndTimestamp time.Time `json:"EndTimestamp"`
TemplateNodes map[string]*ClusterNode `json:"TemplateNodes"`
}
Add the following flag to your cluster-autoscaler configuration to enable the snapshotter feature.
--debugging-snapshot-enabled=true
To access the sapshot from the command line, use the following command:
curl https://127.0.0.1:8085/snapshotz > FIlE_NAME.json
How to nevigate JSON file?
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