- Express.js backend with JWT authentication - CRUD endpoints for apps management - Health check endpoint - Dockerfile per admin API (Node 18 Alpine) - Kubernetes: admin-api deployment, service, ingress - Admin panel at http://admin.apps.local - Updated nginx.conf to route /api to admin API - Fixed ingress rules for separate web and admin services
33 lines
1.0 KiB
Bash
Executable File
33 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
REGISTRY="git.giaco.net"
|
|
MAIN_IMAGE="capitano/webapplinux"
|
|
ADMIN_IMAGE="capitano/webapplinux-admin"
|
|
TAG="latest"
|
|
|
|
echo "Building main image..."
|
|
docker build -t $REGISTRY/$MAIN_IMAGE:$TAG /home/capitano/kubernetes/infrastructure/webapplinux/
|
|
|
|
echo "Building admin API image..."
|
|
docker build -t $REGISTRY/$ADMIN_IMAGE:$TAG /home/capitano/kubernetes/infrastructure/webapplinux/backend/
|
|
|
|
echo "Pushing main image..."
|
|
docker push $REGISTRY/$MAIN_IMAGE:$TAG
|
|
|
|
echo "Pushing admin image..."
|
|
docker push $REGISTRY/$ADMIN_IMAGE:$TAG
|
|
|
|
echo "Creating admin secret..."
|
|
kubectl create secret generic admin-secret -n linuxwebapp \
|
|
--from-literal=admin-token="${ADMIN_TOKEN:-admin123}" \
|
|
--from-literal=jwt-secret="${JWT_SECRET:-supersecretjwtkey}" \
|
|
--dry-run=client -o yaml | kubectl apply -f -
|
|
|
|
echo "Deploying to Kubernetes..."
|
|
kubectl apply -f k8s/namespace.yaml 2>/dev/null || true
|
|
kubectl apply -f k8s/
|
|
|
|
echo "Check status with: kubectl get pods -n linuxwebapp"
|
|
echo "Admin panel at: http://admin.apps.local"
|