23 lines
1.2 KiB
Bash
23 lines
1.2 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
NS="icebay"
|
|
echo "=== Ice Bay — Start ==="
|
|
kubectl apply -f "${SCRIPT_DIR}/namespace.yaml"
|
|
kubectl apply -f "${SCRIPT_DIR}/secret.yaml"
|
|
kubectl apply -f "${SCRIPT_DIR}/configmap.yaml"
|
|
kubectl delete pv icebay-postgres-pv --ignore-not-found=true
|
|
kubectl apply -f "${SCRIPT_DIR}/statefulset.yaml"
|
|
kubectl apply -f "${SCRIPT_DIR}/service.yaml"
|
|
echo "Waiting for PostgreSQL..."; kubectl rollout status statefulset/postgres -n "${NS}" --timeout=120s
|
|
kubectl apply -f "${SCRIPT_DIR}/deployment.yaml"
|
|
echo "Waiting for Redis..."; kubectl rollout status deployment/redis -n "${NS}" --timeout=60s
|
|
echo "Waiting for web app..."; kubectl rollout status deployment/icebay-web -n "${NS}" --timeout=120s
|
|
echo ""; kubectl get pods -n "${NS}"; echo ""; kubectl get services -n "${NS}"
|
|
if command -v minikube &>/dev/null && minikube status 2>/dev/null | grep -q "Running"; then
|
|
echo "App URL: http://$(minikube ip):30080"
|
|
else
|
|
NODE_IP=$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}' 2>/dev/null || echo "<node-ip>")
|
|
echo "App URL: http://${NODE_IP}:30080"
|
|
fi
|