From 2086c27afa67d92aa4fff6493e6c86ad8dc11a1d Mon Sep 17 00:00:00 2001 From: David Eliahu Date: Wed, 18 Nov 2020 15:47:42 -0800 Subject: [PATCH] Add additional EC2 information to cluster debug output --- manager/debug.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/manager/debug.sh b/manager/debug.sh index 99da4e6bb7..b4ff2f66a6 100755 --- a/manager/debug.sh +++ b/manager/debug.sh @@ -44,13 +44,21 @@ kubectl get pods --all-namespaces -o json | jq '.items[] | "kubectl logs -n \(.m kubectl top pods --all-namespaces --containers=true > "/cortex-debug/k8s/top_pods" 2>&1 kubectl top nodes > "/cortex-debug/k8s/top_nodes" 2>&1 -mkdir -p /cortex-debug/aws -aws --region=$CORTEX_REGION autoscaling describe-auto-scaling-groups > "/cortex-debug/aws/asgs" 2>&1 +mkdir -p /cortex-debug/aws/amis +aws autoscaling describe-auto-scaling-groups --region=$CORTEX_REGION --output json > "/cortex-debug/aws/asgs" 2>&1 echo -n "." -aws --region=$CORTEX_REGION autoscaling describe-scaling-activities > "/cortex-debug/aws/asg-activities" 2>&1 +aws autoscaling describe-scaling-activities --region=$CORTEX_REGION --output json > "/cortex-debug/aws/asg-activities" 2>&1 +echo -n "." +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 +echo -n "." +aws ec2 describe-instance-status --include-all-instances --region=$CORTEX_REGION --output json > "/cortex-debug/aws/instance-statuses" 2>&1 +echo -n "." +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 echo -n "." python get_operator_load_balancer_state.py > "/cortex-debug/aws/operator_load_balancer_state" 2>&1 +echo -n "." python get_api_load_balancer_state.py > "/cortex-debug/aws/api_load_balancer_state" 2>&1 +echo -n "." python get_operator_target_group_status.py > "/cortex-debug/aws/operator_load_balancer_target_group_status" 2>&1 echo -n "."