Add admin panel API with CRUD for apps
- 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
This commit is contained in:
24
deploy.sh
24
deploy.sh
@@ -2,17 +2,31 @@
|
||||
set -e
|
||||
|
||||
REGISTRY="git.giaco.net"
|
||||
IMAGE_NAME="capitano/webapplinux"
|
||||
MAIN_IMAGE="capitano/webapplinux"
|
||||
ADMIN_IMAGE="capitano/webapplinux-admin"
|
||||
TAG="latest"
|
||||
|
||||
echo "Building image..."
|
||||
docker build -t $REGISTRY/$IMAGE_NAME:$TAG /home/capitano/kubernetes/infrastructure/webapplinux/
|
||||
echo "Building main image..."
|
||||
docker build -t $REGISTRY/$MAIN_IMAGE:$TAG /home/capitano/kubernetes/infrastructure/webapplinux/
|
||||
|
||||
echo "Pushing to registry..."
|
||||
docker push $REGISTRY/$IMAGE_NAME:$TAG
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user