#!/usr/bin/env bash
# 用途：停止 Postgres（不刪 PVC 與 Secret）

set -euo pipefail

echo "停止 Postgres 中..."

kubectl delete deployment postgres --ignore-not-found
kubectl wait --for=delete pod -l app=postgres --timeout=60s || true
kubectl delete service postgres --ignore-not-found

echo "Postgres 已停止（資料仍保留）"

