docs: archive entra materials and simplify deployment docs
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Phase 11: Frontend Applications Deployment
|
||||
# Deploy portal applications to Kubernetes
|
||||
# Deploy portal applications to the Sankofa Phoenix / Proxmox runtime.
|
||||
#
|
||||
|
||||
set -euo pipefail
|
||||
@@ -13,82 +13,29 @@ log_info "=========================================="
|
||||
log_info "Phase 11: Frontend Applications Deployment"
|
||||
log_info "=========================================="
|
||||
|
||||
OVERLAY_DIR="${K8S_DIR}/overlays/${ENVIRONMENT}"
|
||||
log_step "11.1 Deploying portal-public to the Order runtime CT..."
|
||||
bash "${SCRIPT_DIR}/sync-portal-public-to-sankofa-phoenix.sh" || error_exit "Failed to sync portal-public to Sankofa Phoenix"
|
||||
|
||||
# Verify Kubernetes access
|
||||
if ! kubectl cluster-info &> /dev/null; then
|
||||
az aks get-credentials --resource-group "${AKS_RESOURCE_GROUP}" \
|
||||
--name "${AKS_NAME}" \
|
||||
--overwrite-existing
|
||||
fi
|
||||
log_step "11.2 Refreshing the Order HAProxy edge..."
|
||||
env \
|
||||
ORDER_HAPROXY_BACKEND_HOST="${ORDER_HAPROXY_BACKEND_HOST}" \
|
||||
ORDER_HAPROXY_BACKEND_PORT="${ORDER_HAPROXY_BACKEND_PORT}" \
|
||||
PROXMOX_ORDER_HAPROXY_NODE="${ORDER_HAPROXY_HOST}" \
|
||||
bash "${PROJECT_ROOT}/../scripts/deployment/provision-order-haproxy-10210.sh" \
|
||||
|| error_exit "Failed to refresh order-haproxy"
|
||||
|
||||
# Ensure namespace exists
|
||||
kubectl create namespace "${NAMESPACE}" --dry-run=client -o yaml | kubectl apply -f -
|
||||
log_step "11.3 Verifying LAN and public health..."
|
||||
curl -fsS "http://${ORDER_PORTAL_PUBLIC_IP}:${ORDER_PORTAL_PUBLIC_PORT}/api/health" >/dev/null \
|
||||
&& log_success "Direct CT health check passed" \
|
||||
|| log_warning "Direct CT health check failed"
|
||||
|
||||
if [ -d "${OVERLAY_DIR}" ]; then
|
||||
log_step "11.0 Validating and applying ${ENVIRONMENT} overlay..."
|
||||
kubectl kustomize "${OVERLAY_DIR}" > /dev/null || error_exit "Failed to render overlay ${OVERLAY_DIR}"
|
||||
kubectl apply -k "${OVERLAY_DIR}" || error_exit "Failed to apply overlay ${OVERLAY_DIR}"
|
||||
else
|
||||
log_warning "Overlay not found for environment ${ENVIRONMENT}: ${OVERLAY_DIR}"
|
||||
log_info "Falling back to per-app base manifests"
|
||||
fi
|
||||
curl -fsS -H "Host: the-order.sankofa.nexus" "http://${ORDER_HAPROXY_IP}/api/health" >/dev/null \
|
||||
&& log_success "HAProxy health check passed" \
|
||||
|| log_warning "HAProxy health check failed"
|
||||
|
||||
# Deploy each app
|
||||
log_step "11.1 Deploying frontend applications..."
|
||||
|
||||
for app in "${APPS[@]}"; do
|
||||
log_info "Deploying ${app}..."
|
||||
|
||||
APP_DIR="${K8S_DIR}/base/${app}"
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
log_warning "Kubernetes manifests not found for ${app} at ${APP_DIR}"
|
||||
log_info "Skipping ${app} deployment"
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ ! -d "${OVERLAY_DIR}" ]; then
|
||||
kubectl apply -f "${APP_DIR}" -n "${NAMESPACE}" || error_exit "Failed to deploy ${app}"
|
||||
fi
|
||||
|
||||
IMAGE_NAME="${ACR_NAME}.azurecr.io/${app}:${IMAGE_TAG}"
|
||||
CONTAINER_NAME="${app}"
|
||||
|
||||
log_info "Updating ${app} image to ${IMAGE_NAME}..."
|
||||
kubectl set image deployment/"${app}" \
|
||||
"${CONTAINER_NAME}"="${IMAGE_NAME}" \
|
||||
-n "${NAMESPACE}" || error_exit "Failed to set image for ${app}"
|
||||
|
||||
# Wait for deployment
|
||||
log_info "Waiting for ${app} deployment..."
|
||||
kubectl rollout status \
|
||||
deployment/"${app}" \
|
||||
-n "${NAMESPACE}" \
|
||||
--timeout=300s || log_warning "${app} deployment not ready yet"
|
||||
|
||||
# Verify pods
|
||||
PODS=$(kubectl get pods -l app="${app}" -n "${NAMESPACE}" --no-headers 2>/dev/null | wc -l)
|
||||
if [ "${PODS}" -gt 0 ]; then
|
||||
log_success "${app} deployed (${PODS} pod(s))"
|
||||
kubectl get pods -l app="${app}" -n "${NAMESPACE}"
|
||||
else
|
||||
log_warning "${app} pods not found"
|
||||
fi
|
||||
|
||||
if kubectl get svc "${app}" -n "${NAMESPACE}" &> /dev/null; then
|
||||
PORT="${SERVICE_PORTS[$app]}"
|
||||
if [ -n "${PORT}" ]; then
|
||||
log_info "Testing ${app} health endpoint on port ${PORT}..."
|
||||
kubectl run test-${app}-health \
|
||||
--image=curlimages/curl \
|
||||
--rm -i --restart=Never \
|
||||
-n "${NAMESPACE}" -- \
|
||||
curl -fsS "http://${app}:${PORT}/api/health" >/dev/null && \
|
||||
log_success "${app} health check passed" || \
|
||||
log_warning "${app} health check failed or endpoint not ready"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
curl -fsS "${THE_ORDER_PUBLIC_URL}/api/health" >/dev/null \
|
||||
&& log_success "Public health check passed" \
|
||||
|| log_warning "Public health check failed"
|
||||
|
||||
# Save state
|
||||
save_state "phase11" "complete"
|
||||
|
||||
Reference in New Issue
Block a user