feat: add .gitignore and apps/template for new apps
This commit is contained in:
31
apps/template/status.sh
Executable file
31
apps/template/status.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bash
|
||||
# 用途:檢查 {{APP_NAME}} 狀態
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
APP_NAME="{{APP_NAME}}"
|
||||
|
||||
echo "=== [ $APP_NAME 資源狀態 ] ==="
|
||||
echo ""
|
||||
|
||||
# 1. Pods
|
||||
echo "--- Pods ---"
|
||||
kubectl get pods -l "app=$APP_NAME" -o wide
|
||||
|
||||
echo ""
|
||||
|
||||
# 2. Services
|
||||
echo "--- Services ---"
|
||||
kubectl get svc -l "app=$APP_NAME"
|
||||
|
||||
echo ""
|
||||
|
||||
# 3. PVC
|
||||
echo "--- Storage (PVC) ---"
|
||||
kubectl get pvc | grep "$APP_NAME" || echo "無 PVC"
|
||||
|
||||
echo ""
|
||||
|
||||
# 4. Ingress
|
||||
echo "--- Access (Ingress) ---"
|
||||
kubectl get ingress -l "app=$APP_NAME" -o custom-columns=NAME:.metadata.name,HOSTS:.spec.rules[*].host,ADDRESS:.status.loadBalancer.ingress[*].ip
|
||||
Reference in New Issue
Block a user