add letsencrypt certificates

This commit is contained in:
2026-01-20 05:45:52 +01:00
parent cdc1b7c3cc
commit 8d543258cc
12 changed files with 158 additions and 89 deletions

View File

@@ -0,0 +1,5 @@
apiVersion: v2
name: certificates
description: Certificats Let's Encrypt générés dans OPS via cert-manager
type: application
version: 1.0.0

View File

@@ -0,0 +1,63 @@
# Certificats Let's Encrypt pour le cluster OPS
Ce chart gère les certificats Let's Encrypt générés par cert-manager dans le cluster OPS.
## Structure
- `Chart.yaml` : Définition du chart Helm
- `templates/` : Dossiers organisés par application
- `homarr/` : Certificats pour l'application Homarr
- `[autre-app]/` : Certificats pour d'autres applications
Chaque dossier d'application contient les certificats pour tous les environnements de cette application.
## Ajout d'un nouveau certificat
### Pour une application existante
Ajoutez un fichier dans le dossier de l'application (ex: `templates/homarr/`) :
```yaml
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: <app>-<env>-tls
namespace: <app>-<env> # Le namespace où sera utilisé le secret TLS
spec:
secretName: <app>-<env>-tls
issuerRef:
name: letsencrypt-prod # ou letsencrypt-staging pour les tests
kind: ClusterIssuer
dnsNames:
- <domain>
```
### Pour une nouvelle application
1. Créez un nouveau dossier dans `templates/` : `templates/<app>/`
2. Créez le fichier Certificate dans ce dossier
3. Optionnellement, créez un `README.md` dans le dossier pour documenter les certificats de cette application
## Déploiement
Les certificats sont déployés automatiquement via l'ApplicationSet `certificates-apps` dans ArgoCD.
## Vérification
```bash
# Vérifier les certificats
kubectl get certificates -A
# Vérifier un certificat spécifique
kubectl describe certificate homarr-dev-tls -n homarr-dev
# Vérifier le secret TLS créé
kubectl get secret homarr-dev-tls -n homarr-dev
```
## Notes importantes
- Les certificats sont créés dans le cluster OPS où cert-manager est installé
- Le namespace du Certificate doit correspondre au namespace où le secret TLS sera utilisé
- Pour utiliser le certificat dans d'autres clusters (DEV, RCT, PRD), le secret TLS doit être synchronisé depuis OPS

View File

@@ -0,0 +1,27 @@
# Certificats pour Homarr
Ce dossier contient les certificats Let's Encrypt pour l'application Homarr.
## Certificats disponibles
- `certificate-homarr-dev.yaml` : Certificat pour Homarr DEV (homarr.dev.gkdomaine.fr)
## Ajout d'un nouveau certificat Homarr
Pour ajouter un certificat pour un nouvel environnement (ex: RCT, PRD), créez un nouveau fichier :
```yaml
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: homarr-<env>-tls
namespace: homarr-<env>
spec:
secretName: homarr-<env>-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- homarr.<env>.gkdomaine.fr
```

View File

@@ -0,0 +1,12 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: homarr-dev-tls
namespace: homarr-dev
spec:
secretName: homarr-dev-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- homarr.dev.gkdomaine.fr