Files
k3s/apps/postgres/deploy.sh

21 lines
565 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
# 用途:部署或更新 PostgresSecret / PVC / Deployment / Service
set -euo pipefail
BASE_DIR="$(cd "$(dirname "$0")" && pwd)"
MANIFESTS="$BASE_DIR/manifests"
echo "部署 Postgres 中..."
kubectl apply -f "$MANIFESTS/postgres-secret.yaml"
kubectl apply -f "$MANIFESTS/postgres-pvc.yaml"
kubectl apply -f "$MANIFESTS/postgres-deployment.yaml"
kubectl apply -f "$MANIFESTS/postgres-service.yaml"
echo "完成,等待 Pod 就緒..."
kubectl wait --for=condition=ready pod -l app=postgres --timeout=120s
echo "Postgres 已啟動"