clear part2
This commit is contained in:
@@ -1,101 +0,0 @@
|
|||||||
# Gestion des Certificats TLS pour le cluster OPS
|
|
||||||
|
|
||||||
Ce chart gère les certificats TLS générés par cert-manager dans le cluster OPS.
|
|
||||||
|
|
||||||
## Stratégie de certificats
|
|
||||||
|
|
||||||
- **Sites publics** (`.fr`) → **Let's Encrypt** (`letsencrypt-prod`)
|
|
||||||
- Validation HTTP-01, nécessite accès Internet
|
|
||||||
- Certificats reconnus par tous les navigateurs
|
|
||||||
|
|
||||||
- **Sites internes** (`.local`) → **PKI Interne** (`ca-issuer`)
|
|
||||||
- Certificats signés par votre CA root interne
|
|
||||||
- Pas besoin d'accès Internet
|
|
||||||
- Voir [PKI Interne](../../../../docs/PKI-INTERNE.md) pour plus de détails
|
|
||||||
|
|
||||||
## Structure
|
|
||||||
|
|
||||||
- `Chart.yaml` : Définition du chart Helm
|
|
||||||
- `templates/` : Dossiers organisés par application (uniquement des fichiers YAML)
|
|
||||||
- `homarr/` : Certificats pour l'application Homarr
|
|
||||||
- `[autre-app]/` : Certificats pour d'autres applications
|
|
||||||
- `docs/` : Documentation par application
|
|
||||||
- `homarr/README.md` : Documentation pour les certificats Homarr
|
|
||||||
|
|
||||||
**⚠️ IMPORTANT** : Seuls les fichiers YAML doivent être dans `templates/`. Les fichiers de documentation doivent être dans `docs/`.
|
|
||||||
|
|
||||||
## Ajout d'un nouveau certificat
|
|
||||||
|
|
||||||
### Pour une application existante
|
|
||||||
|
|
||||||
Ajoutez un fichier dans le dossier de l'application (ex: `templates/homarr/`) :
|
|
||||||
|
|
||||||
#### Pour un site public (`.fr`) - Let's Encrypt
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: Certificate
|
|
||||||
metadata:
|
|
||||||
name: <app>-<env>-tls
|
|
||||||
namespace: certificates-ops
|
|
||||||
spec:
|
|
||||||
secretName: <app>-<env>-tls
|
|
||||||
issuerRef:
|
|
||||||
name: letsencrypt-prod
|
|
||||||
kind: ClusterIssuer
|
|
||||||
dnsNames:
|
|
||||||
- <domain>.fr
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Pour un site interne (`.local`) - PKI Interne
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: Certificate
|
|
||||||
metadata:
|
|
||||||
name: <app>-<env>-tls
|
|
||||||
namespace: certificates-ops
|
|
||||||
annotations:
|
|
||||||
# IMPORTANT: Les certificats utilisant ca-issuer doivent être créés
|
|
||||||
# après que la PKI soit initialisée (sync-wave "2")
|
|
||||||
argocd.argoproj.io/sync-wave: "2"
|
|
||||||
spec:
|
|
||||||
secretName: <app>-<env>-tls
|
|
||||||
issuerRef:
|
|
||||||
name: ca-issuer # PKI interne pour domaines .local
|
|
||||||
kind: ClusterIssuer
|
|
||||||
dnsNames:
|
|
||||||
- <domain>.local
|
|
||||||
```
|
|
||||||
|
|
||||||
**⚠️ Important pour les certificats internes** : Ajoutez toujours l'annotation `argocd.argoproj.io/sync-wave: "2"` pour garantir que la PKI est initialisée avant la création du certificat.
|
|
||||||
|
|
||||||
### Pour une nouvelle application
|
|
||||||
|
|
||||||
1. Créez un nouveau dossier dans `templates/` : `templates/<app>/`
|
|
||||||
2. Créez le fichier Certificate dans ce dossier (uniquement des fichiers YAML)
|
|
||||||
3. Optionnellement, créez un `README.md` dans `docs/<app>/` 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
|
|
||||||
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: Certificate
|
|
||||||
metadata:
|
|
||||||
name: ca-root-certificate
|
|
||||||
namespace: certificates-ops
|
|
||||||
annotations:
|
|
||||||
# Ce certificat doit être créé en premier pour générer le secret ca-root-secret
|
|
||||||
# utilisé par le ClusterIssuer ca-issuer
|
|
||||||
argocd.argoproj.io/sync-wave: "0"
|
|
||||||
spec:
|
|
||||||
# Ce certificat génère la CA root de votre PKI interne
|
|
||||||
secretName: ca-root-secret
|
|
||||||
issuerRef:
|
|
||||||
name: ca-root-issuer
|
|
||||||
kind: ClusterIssuer
|
|
||||||
commonName: "GK Domaine Internal CA Root"
|
|
||||||
dnsNames:
|
|
||||||
- "gkdomaine.local"
|
|
||||||
- "*.gkdomaine.local"
|
|
||||||
- "*.dev.gkdomaine.local"
|
|
||||||
- "*.rct.gkdomaine.local"
|
|
||||||
- "*.prd.gkdomaine.local"
|
|
||||||
isCA: true
|
|
||||||
duration: 87600h # 10 ans
|
|
||||||
usages:
|
|
||||||
- signing
|
|
||||||
- key encipherment
|
|
||||||
- cert sign
|
|
||||||
- crl sign
|
|
||||||
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: ClusterIssuer
|
|
||||||
metadata:
|
|
||||||
name: ca-root-issuer
|
|
||||||
annotations:
|
|
||||||
# Ce ClusterIssuer doit être créé en premier (avant le Certificate ca-root-certificate)
|
|
||||||
argocd.argoproj.io/sync-wave: "-1"
|
|
||||||
spec:
|
|
||||||
selfSigned: {}
|
|
||||||
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: ClusterIssuer
|
|
||||||
metadata:
|
|
||||||
name: ca-issuer
|
|
||||||
annotations:
|
|
||||||
# Ce ClusterIssuer dépend du secret ca-root-secret généré par ca-root-certificate
|
|
||||||
# ArgoCD créera d'abord le Certificate, puis ce ClusterIssuer
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
spec:
|
|
||||||
ca:
|
|
||||||
secretName: ca-root-secret
|
|
||||||
# Le secret ca-root-secret contient la clé privée et le certificat de la CA root
|
|
||||||
# Il est généré par le Certificate ca-root-certificate ci-dessus
|
|
||||||
# IMPORTANT: Ce ClusterIssuer sera en erreur jusqu'à ce que le secret soit créé
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: ClusterIssuer
|
|
||||||
metadata:
|
|
||||||
name: selfsigned-issuer
|
|
||||||
spec:
|
|
||||||
selfSigned: {}
|
|
||||||
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: ca-root-certificate
|
|
||||||
namespace: certificates-ops
|
|
||||||
labels:
|
|
||||||
app: pki-internal
|
|
||||||
component: ca-root-cert
|
|
||||||
data:
|
|
||||||
# Le certificat CA root sera injecté ici par un script ou manuellement
|
|
||||||
# Ce ConfigMap peut être synchronisé vers les autres clusters pour que les clients
|
|
||||||
# puissent faire confiance aux certificats signés par cette CA
|
|
||||||
ca.crt: |
|
|
||||||
# Le certificat CA sera ajouté ici après la génération
|
|
||||||
# Pour l'extraire : kubectl get secret ca-root-secret -n certificates-ops -o jsonpath='{.data.tls\.crt}' | base64 -d
|
|
||||||
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: Certificate
|
|
||||||
metadata:
|
|
||||||
name: harbor-ops-tls
|
|
||||||
namespace: certificates-ops
|
|
||||||
annotations:
|
|
||||||
# Ce certificat dépend de ca-issuer qui doit être prêt en premier
|
|
||||||
# ca-issuer a sync-wave "1", donc ce certificat doit être créé après
|
|
||||||
argocd.argoproj.io/sync-wave: "2"
|
|
||||||
spec:
|
|
||||||
secretName: harbor-ops-tls
|
|
||||||
issuerRef:
|
|
||||||
name: ca-issuer # PKI interne pour domaine .local
|
|
||||||
kind: ClusterIssuer
|
|
||||||
dnsNames:
|
|
||||||
- harbor.gkdomaine.local
|
|
||||||
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
apiVersion: cert-manager.io/v1
|
|
||||||
kind: Certificate
|
|
||||||
metadata:
|
|
||||||
name: headlamp-dev-tls
|
|
||||||
namespace: certificates-ops
|
|
||||||
annotations:
|
|
||||||
# Ce certificat dépend de ca-issuer qui doit être prêt en premier
|
|
||||||
# ca-issuer a sync-wave "1", donc ce certificat doit être créé après
|
|
||||||
argocd.argoproj.io/sync-wave: "2"
|
|
||||||
spec:
|
|
||||||
secretName: headlamp-dev-tls
|
|
||||||
issuerRef:
|
|
||||||
name: ca-issuer
|
|
||||||
kind: ClusterIssuer
|
|
||||||
dnsNames:
|
|
||||||
- headlamp.dev.gkdomaine.local
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: certificates-ops
|
|
||||||
labels:
|
|
||||||
name: certificates-ops
|
|
||||||
managed-by: argocd
|
|
||||||
purpose: tls-certificates
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user