Initial commit: k8s cluster manifests and scripts
This commit is contained in:
20
apps/postgres/deploy.sh
Executable file
20
apps/postgres/deploy.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
# 用途:部署或更新 Postgres(Secret / 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 已啟動"
|
||||
|
||||
Reference in New Issue
Block a user