Major Changes: - Migrate UI to Shadcn components with Tailwind CSS v3 - Implement dark theme as default with improved color scheme - Optimize homepage layout to fit single screen without scrolling - Fix chart visibility with explicit colors for dark mode Deployment Infrastructure: - Add Docker multi-stage build with Nginx + Node.js - Create Kubernetes manifests (deployment, service, ingress, PVC) - Configure Gitea CI/CD workflow with registry integration - Add deployment scripts with registry support CI/CD Configuration: - Registry: gitea.vidoks.fr/sortifal/pfee - Automatic build and push on commits - Kubernetes deployment with image pull secrets - Three-stage pipeline: build, deploy, notify Documentation: - Add DEPLOYMENT.md with comprehensive deployment guide - Add SETUP-REGISTRY.md with step-by-step registry setup - Add workflow README with troubleshooting guide - Include configuration examples and best practices 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5.1 KiB
5.1 KiB
Registry and CI/CD Setup Guide
This guide walks you through setting up the container registry and CI/CD pipeline for the SQDC Dashboard.
Registry Information
- Registry URL:
gitea.vidoks.fr - Repository:
sortifal/pfee - Full Image Path:
gitea.vidoks.fr/sortifal/pfee:latest
Prerequisites
- Gitea account with access to
sortifal/pfeerepository - Kubernetes cluster (k3s) with kubectl configured
- Registry credentials (username and password/token)
Step 1: Configure Gitea Secrets
Go to your Gitea repository: Settings → Secrets → Actions
Add the following secrets:
Required Secrets
| Secret Name | Description | Example Value |
|---|---|---|
KUBE_CONFIG |
Plain text kubeconfig for k3s | Contents of ~/.kube/config |
REGISTRY_URL |
Container registry URL | gitea.vidoks.fr |
REGISTRY_USER |
Registry username | Your Gitea username |
REGISTRY_PASSWORD |
Registry password or token | Your Gitea password/token |
How to get KUBE_CONFIG
# Display your kubeconfig
cat ~/.kube/config
# Copy the entire output and paste it as the KUBE_CONFIG secret
How to create a Gitea Token
- Go to your Gitea profile → Settings → Applications
- Create a new token with
write:packagepermission - Use this token as
REGISTRY_PASSWORD
Step 2: Verify Workflow Configuration
The workflow file at .gitea/workflows/build-deploy.yml is already configured with:
- Image path:
gitea.vidoks.fr/sortifal/pfee - Triggers: Push to
mainordashboardbranches - Build, deploy, and notify jobs
Step 3: Test Local Build (Optional)
Before pushing, you can test the Docker build locally:
# Build the image
docker build -t gitea.vidoks.fr/sortifal/pfee:test .
# Test run locally
docker run -p 8080:80 -p 3001:3001 gitea.vidoks.fr/sortifal/pfee:test
Step 4: Manual Registry Push (Optional)
If you want to manually push to the registry:
# Login to registry
docker login gitea.vidoks.fr -u <username>
# Build and tag
docker build -t gitea.vidoks.fr/sortifal/pfee:latest .
# Push to registry
docker push gitea.vidoks.fr/sortifal/pfee:latest
Step 5: Deploy to Kubernetes
Option A: Using the Deployment Script
./scripts/deploy.sh gitea.vidoks.fr <username> <password> sortifal/pfee
Option B: Manual Deployment
# Create namespace
kubectl apply -f k8s/namespace.yaml
# Create registry credentials secret
kubectl create secret docker-registry registry-credentials \
--docker-server=gitea.vidoks.fr \
--docker-username=<your-username> \
--docker-password=<your-password> \
-n sqdc-dashboard
# Apply manifests
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
kubectl apply -f k8s/ingress.yaml
# Wait for rollout
kubectl rollout status deployment/sqdc-dashboard -n sqdc-dashboard
Step 6: Trigger CI/CD Pipeline
Once secrets are configured, simply push to trigger the pipeline:
git add .
git commit -m "feat: Configure CI/CD with registry"
git push origin dashboard
The workflow will:
- Install dependencies and run tests
- Build the React application
- Build Docker image and push to
gitea.vidoks.fr/sortifal/pfee - Deploy to Kubernetes cluster
- Update deployment with the new image
- Verify deployment status
Monitoring Deployment
View Workflow Logs
- Go to your Gitea repository
- Click on "Actions" tab
- Select the workflow run
- View logs for each job (build, deploy, notify)
Check Kubernetes Status
# Check pods
kubectl get pods -n sqdc-dashboard
# Check deployment
kubectl get deployment -n sqdc-dashboard
# Check service
kubectl get svc -n sqdc-dashboard
# Check ingress
kubectl get ingress -n sqdc-dashboard
# View logs
kubectl logs -f deployment/sqdc-dashboard -n sqdc-dashboard
Troubleshooting
Image Pull Errors
If pods show ImagePullBackOff:
# Check if secret exists
kubectl get secret registry-credentials -n sqdc-dashboard
# Describe the secret
kubectl describe secret registry-credentials -n sqdc-dashboard
# Recreate the secret
kubectl delete secret registry-credentials -n sqdc-dashboard
kubectl create secret docker-registry registry-credentials \
--docker-server=gitea.vidoks.fr \
--docker-username=<username> \
--docker-password=<password> \
-n sqdc-dashboard
Workflow Authentication Errors
If the workflow fails during image push:
- Verify
REGISTRY_USERandREGISTRY_PASSWORDsecrets are correct - Ensure the token has
write:packagepermission - Check registry URL matches exactly:
gitea.vidoks.fr
Kubectl Connection Errors
If deployment step fails:
- Verify
KUBE_CONFIGsecret contains valid kubeconfig - Ensure the config is in plain text (not base64 encoded)
- Check cluster is accessible from Gitea Actions runner
Next Steps
Once deployment is successful:
- Access the application via the ingress URL
- Set up monitoring and alerts
- Configure backup procedures for the database
- Review and adjust resource limits based on usage
For detailed documentation, see DEPLOYMENT.md