Initial commit: k8s cluster manifests and scripts

This commit is contained in:
2026-04-01 15:34:02 +08:00
commit 2f04fa4473
49 changed files with 4109 additions and 0 deletions

26
apps/postgres/status.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# 用途:查看 Postgres 狀態與連線資訊
set -euo pipefail
echo
echo "=== Pod ==="
kubectl get pod -l app=postgres -o wide
echo
echo "=== Service ==="
kubectl get svc postgres
echo
echo "=== PVC ==="
kubectl get pvc postgres-pvc
echo
echo "=== NodePort 連線 ==="
NODE_IPS=$(kubectl get nodes -o jsonpath='{range .items[*]}{.status.addresses[?(@.type=="InternalIP")].address}{" "}{end}')
PORT=$(kubectl get svc postgres -o jsonpath='{.spec.ports[0].nodePort}')
for ip in $NODE_IPS; do
echo "- $ip:$PORT"
done