Files
k3s/apps/template/stop.sh

16 lines
449 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 用途:停止 {{APP_NAME}}(保留資料)
set -euo pipefail
APP_NAME="{{APP_NAME}}"
echo "🛑 停止 $APP_NAME(保留 PVC 資料)..."
# 只刪除 Deployment 和 ServicePVC 會保留
kubectl delete deployment/$APP_NAME --ignore-not-found
kubectl delete service/$APP_NAME-service --ignore-not-found
kubectl delete ingress/$APP_NAME-ingress --ignore-not-found
echo "$APP_NAME 已停止,資料安全保留"