today=$(date +"%Y-%m-%d-%H-%M-%S") # dominoplatform="domino-platform" dominoplatform=$( kubectl get namespaces -l domino-platform=true |grep Active |tail -1 |awk '{print $1}' ) # dominocompute="domino-compute" dominocompute=$( kubectl get namespaces -l domino-compute=true |grep Active |tail -1 |awk '{print $1}' ) # Rabbit logs, inside the pod for pod in $( kubectl get po -n $dominoplatform -l app.kubernetes.io/name=rabbitmq-ha -o json | jq '.items[] | .metadata.name' | sed 's/"//g') ; do echo $pod kubectl -n $dominoplatform exec -it $pod -c rabbitmq-ha -- cat /var/log/rabbitmq/rabbit@$pod.rabbitmq-ha-discovery.$dominoplatform.svc.cluster.local.log > $pod-$today.log kubectl -n $dominoplatform exec -it $pod -c rabbitmq-ha -- rabbitmqctl report > $pod-$today-rabbitreport.log kubectl -n $dominoplatform logs --timestamps $pod -c istio-proxy > $pod-$today-istio.log kubectl -n $dominoplatform logs --timestamps $pod -c istio-proxy -p --ignore-errors=true > $pod-$today-istio-previous.log kubectl -n $dominoplatform describe po $pod > $pod-$today-describe.log done # Nucleus dispatcher for pod in $( kubectl get po -n $dominoplatform -l app.kubernetes.io/instance=nucleus,app.kubernetes.io/component=dispatcher -o json | jq '.items[] | .metadata.name' | sed 's/"//g') ; do echo $pod kubectl logs -n $dominoplatform --timestamps $pod -c nucleus-dispatcher > $pod-$today.log kubectl logs -n $dominoplatform --timestamps $pod -c nucleus-dispatcher -p --ignore-errors=true > $pod-$today-previous.log kubectl logs -n $dominoplatform --timestamps $pod -c istio-proxy > $pod-$today-istio.log kubectl logs -n $dominoplatform --timestamps $pod -c istio-proxy -p --ignore-errors=true > $pod-$today-istio-previous.log kubectl exec -it -n $dominoplatform $pod -c nucleus-dispatcher -- jstack -l 1 > $pod-$today-jstack-1.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-dispatcher -- jstack -l 1 > $pod-$today-jstack-2.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-dispatcher -- jstack -l 1 > $pod-$today-jstack-3.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-dispatcher -- jstack -l 1 > $pod-$today-jstack-4.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-dispatcher -- jstack -l 1 > $pod-$today-jstack-5.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-dispatcher -- jstack -l 1 > $pod-$today-jstack-6.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-dispatcher -- jstack -l 1 > $pod-$today-jstack-7.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-dispatcher -- jstack -l 1 > $pod-$today-jstack-8.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-dispatcher -- jstack -l 1 > $pod-$today-jstack-9.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-dispatcher -- jstack -l 1 > $pod-$today-jstack-10.log kubectl describe po -n $dominoplatform $pod > $pod-$today-describe.log done # Nucleus Frontend for pod in $( kubectl get po -n $dominoplatform -l app.kubernetes.io/instance=nucleus,app.kubernetes.io/component=frontend -o json | jq '.items[] | .metadata.name' | sed 's/"//g') ; do echo $pod kubectl logs -n $dominoplatform --timestamps $pod -c nucleus-frontend > $pod-$today.log kubectl logs -n $dominoplatform --timestamps $pod -c nucleus-frontend -p --ignore-errors=true > $pod-$today-previous.log kubectl logs -n $dominoplatform --timestamps $pod -c istio-proxy > $pod-$today-istio.log kubectl logs -n $dominoplatform --timestamps $pod -c istio-proxy -p --ignore-errors=true > $pod-$today-istio-previous.log kubectl exec -it -n $dominoplatform $pod -c nucleus-frontend -- jstack -l 1 > $pod-$today-jstack-1.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-frontend -- jstack -l 1 > $pod-$today-jstack-2.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-frontend -- jstack -l 1 > $pod-$today-jstack-3.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-frontend -- jstack -l 1 > $pod-$today-jstack-4.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-frontend -- jstack -l 1 > $pod-$today-jstack-5.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-frontend -- jstack -l 1 > $pod-$today-jstack-6.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-frontend -- jstack -l 1 > $pod-$today-jstack-7.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-frontend -- jstack -l 1 > $pod-$today-jstack-8.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-frontend -- jstack -l 1 > $pod-$today-jstack-9.log sleep 1 kubectl exec -it -n $dominoplatform $pod -c nucleus-frontend -- jstack -l 1 > $pod-$today-jstack-10.log kubectl describe po -n $dominoplatform $pod > $pod-$today-describe.log done # Data Plane agent for pod in $( kubectl get po -n $dominocompute -l app.kubernetes.io/instance=data-plane -o json | jq '.items[] | .metadata.name' | sed 's/"//g') ; do echo $pod kubectl describe po -n $dominocompute $pod > $pod-$today-describe.log kubectl logs -n $dominocompute --timestamps $pod -c istio-proxy > $pod-$today-istio.log kubectl logs -n $dominocompute --timestamps $pod -c istio-proxy -p --ignore-errors=true > $pod-$today-istio-previous.log kubectl logs -n $dominocompute --timestamps $pod -c agent > $pod-$today-agent.log kubectl logs -n $dominocompute --timestamps $pod -c agent -p --ignore-errors=true > $pod-$today-agent-previous.log kubectl exec -it -n $dominocompute $pod -c agent -- jstack -l 1 > $pod-$today-jstack-1.log sleep 1 kubectl exec -it -n $dominocompute $pod -c agent -- jstack -l 1 > $pod-$today-jstack-2.log sleep 1 kubectl exec -it -n $dominocompute $pod -c agent -- jstack -l 1 > $pod-$today-jstack-3.log sleep 1 kubectl exec -it -n $dominocompute $pod -c agent -- jstack -l 1 > $pod-$today-jstack-4.log sleep 1 kubectl exec -it -n $dominocompute $pod -c agent -- jstack -l 1 > $pod-$today-jstack-5.log sleep 1 kubectl exec -it -n $dominocompute $pod -c agent -- jstack -l 1 > $pod-$today-jstack-6.log sleep 1 kubectl exec -it -n $dominocompute $pod -c agent -- jstack -l 1 > $pod-$today-jstack-7.log sleep 1 kubectl exec -it -n $dominocompute $pod -c agent -- jstack -l 1 > $pod-$today-jstack-8.log sleep 1 kubectl exec -it -n $dominocompute $pod -c agent -- jstack -l 1 > $pod-$today-jstack-9.log sleep 1 kubectl exec -it -n $dominocompute $pod -c agent -- jstack -l 1 > $pod-$today-jstack-10.log done tar -cvzf $today-logs.tar.gz *.log rm *.log bash nucleus-heap-dump.sh