Skip to content

Commit

Permalink
Create openfaas-diagnostics.sh
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Ellis <[email protected]>
  • Loading branch information
alexellis authored Oct 25, 2023
1 parent bde5230 commit 85a9aa5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions openfaas-diagnostics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

mkdir -p ./openfaas

echo "Gathering diagnostics to: ./openfaas"

kubectl get -n openfaas deploy -o wide > openfaas/openfaas-core-deploy.txt
kubectl get -n openfaas configmap -o yaml > openfaas/openfaas-configmaps.yaml
kubectl get -n openfaas-fn function -o yaml > openfaas/openfaas-function-crd.yaml
kubectl get -n openfaas deploy -o yaml > openfaas/openfaas-deploy.yaml
kubectl get -n openfaas-fn deploy -o yaml > openfaas/openfaas-fn-deploy.yaml
kubectl logs -n openfaas deploy/gateway -c operator > openfaas/operator-logs.txt
kubectl logs -n openfaas deploy/gateway -c gateway > openfaas/gateway-logs.txt
kubectl get events -n openfaas --sort-by=.metadata.creationTimestamp > openfaas/openfaas-events.txt
kubectl get events -n openfaas-fn --sort-by=.metadata.creationTimestamp > openfaas/openfaas-fn-events.txt
kubectl get clusterrole > openfaas/clusterrole-list.txt
kubectl get clusterrole -o yaml > openfaas/clusterrole.yaml

echo ""

NAME=openfaas-$(date '+%Y-%m-%d_%H_%M_%S').tgz

echo Creating $NAME...

tar -czvf ./$NAME openfaas/

0 comments on commit 85a9aa5

Please sign in to comment.