Skip to content

Commit 9bb0e27

Browse files
authored
Add additional EC2 information to cluster debug output (#1570)
1 parent aa9b316 commit 9bb0e27

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

manager/debug.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,21 @@ kubectl get pods --all-namespaces -o json | jq '.items[] | . as $parent | $paren
4545
kubectl top pods --all-namespaces --containers=true > "/cortex-debug/k8s/top_pods" 2>&1
4646
kubectl top nodes > "/cortex-debug/k8s/top_nodes" 2>&1
4747

48-
mkdir -p /cortex-debug/aws
49-
aws --region=$CORTEX_REGION autoscaling describe-auto-scaling-groups > "/cortex-debug/aws/asgs" 2>&1
48+
mkdir -p /cortex-debug/aws/amis
49+
aws autoscaling describe-auto-scaling-groups --region=$CORTEX_REGION --output json > "/cortex-debug/aws/asgs" 2>&1
5050
echo -n "."
51-
aws --region=$CORTEX_REGION autoscaling describe-scaling-activities > "/cortex-debug/aws/asg-activities" 2>&1
51+
aws autoscaling describe-scaling-activities --region=$CORTEX_REGION --output json > "/cortex-debug/aws/asg-activities" 2>&1
52+
echo -n "."
53+
aws ec2 describe-instances --filters Name=tag:cortex.dev/cluster-name,Values=$CORTEX_CLUSTER_NAME --region=$CORTEX_REGION --output json > "/cortex-debug/aws/instances" 2>&1
54+
echo -n "."
55+
aws ec2 describe-instance-status --include-all-instances --region=$CORTEX_REGION --output json > "/cortex-debug/aws/instance-statuses" 2>&1
56+
echo -n "."
57+
aws ec2 describe-instances --filters Name=tag:cortex.dev/cluster-name,Values=$CORTEX_CLUSTER_NAME --region=$CORTEX_REGION --output json | jq "[.Reservations[].Instances[].ImageId] | unique | .[] | \"aws ec2 describe-images --image-ids \(.) --region=$CORTEX_REGION --output json > /cortex-debug/aws/amis/\(.) 2>&1\"" | xargs -n 1 bash -c
5258
echo -n "."
5359
python get_operator_load_balancer_state.py > "/cortex-debug/aws/operator_load_balancer_state" 2>&1
60+
echo -n "."
5461
python get_api_load_balancer_state.py > "/cortex-debug/aws/api_load_balancer_state" 2>&1
62+
echo -n "."
5563
python get_operator_target_group_status.py > "/cortex-debug/aws/operator_load_balancer_target_group_status" 2>&1
5664
echo -n "."
5765

0 commit comments

Comments
 (0)