diff --git a/helm/certificates/ops/docs/README.md b/helm/certificates/ops/docs/README.md deleted file mode 100644 index 8d1c7ef..0000000 --- a/helm/certificates/ops/docs/README.md +++ /dev/null @@ -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: --tls - namespace: certificates-ops -spec: - secretName: --tls - issuerRef: - name: letsencrypt-prod - kind: ClusterIssuer - dnsNames: - - .fr -``` - -#### Pour un site interne (`.local`) - PKI Interne - -```yaml -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: --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: --tls - issuerRef: - name: ca-issuer # PKI interne pour domaines .local - kind: ClusterIssuer - dnsNames: - - .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//` -2. Créez le fichier Certificate dans ce dossier (uniquement des fichiers YAML) -3. Optionnellement, créez un `README.md` dans `docs//` 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 - diff --git a/helm/certificates/ops/templates/certificate-ca-root.yaml b/helm/certificates/ops/templates/certificate-ca-root.yaml deleted file mode 100644 index 85f3a08..0000000 --- a/helm/certificates/ops/templates/certificate-ca-root.yaml +++ /dev/null @@ -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 - diff --git a/helm/certificates/ops/templates/cluster-issuer-ca-root.yaml b/helm/certificates/ops/templates/cluster-issuer-ca-root.yaml deleted file mode 100644 index 798dea4..0000000 --- a/helm/certificates/ops/templates/cluster-issuer-ca-root.yaml +++ /dev/null @@ -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: {} - diff --git a/helm/certificates/ops/templates/cluster-issuer-ca.yaml b/helm/certificates/ops/templates/cluster-issuer-ca.yaml deleted file mode 100644 index b98f687..0000000 --- a/helm/certificates/ops/templates/cluster-issuer-ca.yaml +++ /dev/null @@ -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éé - diff --git a/helm/certificates/ops/templates/cluster-issuer-selfsigned.yaml b/helm/certificates/ops/templates/cluster-issuer-selfsigned.yaml deleted file mode 100644 index 81660bd..0000000 --- a/helm/certificates/ops/templates/cluster-issuer-selfsigned.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: ClusterIssuer -metadata: - name: selfsigned-issuer -spec: - selfSigned: {} - diff --git a/helm/certificates/ops/templates/configmap-ca-cert.yaml b/helm/certificates/ops/templates/configmap-ca-cert.yaml deleted file mode 100644 index bb7df36..0000000 --- a/helm/certificates/ops/templates/configmap-ca-cert.yaml +++ /dev/null @@ -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 - diff --git a/helm/certificates/ops/templates/harbor/certificate-dev.yaml b/helm/certificates/ops/templates/harbor/certificate-dev.yaml deleted file mode 100644 index dba71fd..0000000 --- a/helm/certificates/ops/templates/harbor/certificate-dev.yaml +++ /dev/null @@ -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 - diff --git a/helm/certificates/ops/templates/headlamp/certificate-dev.yaml b/helm/certificates/ops/templates/headlamp/certificate-dev.yaml deleted file mode 100644 index 9c558bd..0000000 --- a/helm/certificates/ops/templates/headlamp/certificate-dev.yaml +++ /dev/null @@ -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 diff --git a/helm/certificates/ops/templates/namespace-certificates.yaml b/helm/certificates/ops/templates/namespace-certificates.yaml deleted file mode 100644 index 9173a5c..0000000 --- a/helm/certificates/ops/templates/namespace-certificates.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: certificates-ops - labels: - name: certificates-ops - managed-by: argocd - purpose: tls-certificates -