Add Linux App Store Web Portal with Kubernetes deployment
- React-style static web portal with Tailwind CSS - OS detection (Debian/Ubuntu, Fedora, Arch, Generic) - Dynamic install commands (apt://, appstream://, flatpak) - 9 pre-configured applications - Kubernetes: 2 replicas, LoadBalancer service, Nginx ingress - GitLab Container Registry (git.giaco.net/capitano/webapplinux) - Namespace: linuxwebapp - Added Dockerfile, nginx.conf, deploy.sh, docker-compose.yml - Updated README.md with deployment instructions
This commit is contained in:
62
README.md
62
README.md
@@ -4,58 +4,74 @@
|
||||
|
||||
### Prerequisiti
|
||||
|
||||
- Cluster Kubernetes attivo
|
||||
- Cluster Kubernetes attivo (es. `10.66.200.x/24`)
|
||||
- kubectl configurato
|
||||
- Container registry accessibile (Docker Hub o privato)
|
||||
- Container registry privato (GitLab: `git.giaco.net`)
|
||||
- Personal Access Token per il registry
|
||||
|
||||
### Build e Deploy
|
||||
|
||||
```bash
|
||||
# Build l'immagine
|
||||
docker build -t linux-app-store:latest .
|
||||
# Login al registry GitLab
|
||||
echo "<GITLAB_TOKEN>" | docker login git.giaco.net -u capitano --password-stdin
|
||||
|
||||
# Tagga per il push
|
||||
docker tag linux-app-store:latest <username>/linux-app-store:latest
|
||||
# Build l'immagine
|
||||
docker build -t git.giaco.net/capitano/webapplinux:latest .
|
||||
|
||||
# Push su registry
|
||||
docker push <username>/linux-app-store:latest
|
||||
docker push git.giaco.net/capitano/webapplinux:latest
|
||||
|
||||
# Deploy su Kubernetes
|
||||
kubectl apply -f k8s/namespace.yaml
|
||||
kubectl apply -f k8s/deployment.yaml
|
||||
kubectl apply -f k8s/service.yaml
|
||||
kubectl apply -f k8s/ingress.yaml
|
||||
|
||||
# Verifica
|
||||
kubectl get pods
|
||||
kubectl get svc
|
||||
kubectl get ingress
|
||||
kubectl get pods -n linuxwebapp
|
||||
kubectl get svc -n linuxwebapp
|
||||
kubectl get ingress -n linuxwebapp
|
||||
|
||||
# Log
|
||||
kubectl logs -l app=linux-app-store -f
|
||||
kubectl logs -l app=linux-app-store -n linuxwebapp -f
|
||||
```
|
||||
|
||||
### Accesso al portale
|
||||
|
||||
Il portale è accessibile tramite ingress nginx all'indirizzo:
|
||||
- **URL**: `http://apps.local/`
|
||||
|
||||
Per raggiungerlo localmente, aggiungi una entry nel file `/etc/hosts`:
|
||||
```
|
||||
10.66.200.211 apps.local
|
||||
```
|
||||
(sostituisci `10.66.200.211` con l'IP del tuo Ingress controller)
|
||||
|
||||
### File struttura
|
||||
|
||||
```
|
||||
infrastructure/
|
||||
├── Dockerfile # Dockerfile multi-stage (Nginx)
|
||||
├── Dockerfile.simple # Dockerfile semplificato
|
||||
webapplinux/
|
||||
├── Dockerfile # Dockerfile Nginx
|
||||
├── docker-compose.yml # Compose per sviluppo locale
|
||||
├── nginx.conf # Configurazione Nginx
|
||||
├── README.md # Questo file
|
||||
├── frontend/
|
||||
│ ├── index.html # Pagina principale
|
||||
│ ├── script.js # Logica dell'app
|
||||
│ ├── script.js # Logica OS detection & install
|
||||
│ └── apps.json # Database applicazioni
|
||||
└── k8s/
|
||||
├── deployment.yaml # Kubernetes Deployment (2.repliche)
|
||||
├── namespace.yaml # Namespace linuxwebapp
|
||||
├── deployment.yaml # Deployment (2 repliche, git registry)
|
||||
├── service.yaml # Service (ClusterIP)
|
||||
└── ingress.yaml # Ingress (dominio apps.local)
|
||||
```
|
||||
|
||||
### Customizzazione
|
||||
|
||||
1. Modificare `frontend/apps.json` per aggiungere rimuovere applicazioni
|
||||
2. Aggiornare `nginx.conf` per personalizzare le regole di routing
|
||||
3. Modificare `k8s/deployment.yaml` per aggiornare le risorse o le immagini
|
||||
1. **Applicazioni**: Modifica `frontend/apps.json` per aggiungere/rimuovere app
|
||||
2. **Nginx**: Aggiorna `nginx.conf` per routing personalizzato
|
||||
3. **Risorse**: Modifica `k8s/deployment.yaml` per cpu/memory
|
||||
4. **Immagine**: Cambia `image` nel deployment per usare un altro registry
|
||||
|
||||
### Rimozione
|
||||
|
||||
@@ -63,4 +79,12 @@ infrastructure/
|
||||
kubectl delete -f k8s/ingress.yaml
|
||||
kubectl delete -f k8s/service.yaml
|
||||
kubectl delete -f k8s/deployment.yaml
|
||||
kubectl delete -f k8s/namespace.yaml
|
||||
```
|
||||
|
||||
### CI/CD
|
||||
|
||||
Usa il file `.gitlab-ci.yml` (da creare) per automatizzare:
|
||||
1. Build dell'immagine
|
||||
2. Push su GitLab registry
|
||||
3. Deploy automatico in Kubernetes
|
||||
|
||||
Reference in New Issue
Block a user