diff --git a/docs/PKI-INTERNE.md b/docs/PKI-INTERNE.md index b77b18d..02a5d86 100644 --- a/docs/PKI-INTERNE.md +++ b/docs/PKI-INTERNE.md @@ -67,6 +67,10 @@ kind: Certificate metadata: name: harbor-tls namespace: certificates-ops + annotations: + # IMPORTANT: Ce certificat doit être créé après que ca-issuer soit prêt + # ca-issuer a sync-wave "1", donc ce certificat doit avoir sync-wave "2" ou plus + argocd.argoproj.io/sync-wave: "2" spec: secretName: harbor-tls issuerRef: @@ -77,6 +81,8 @@ spec: - harbor.dev.gkdomaine.local ``` +**⚠️ Important** : N'oubliez pas l'annotation `argocd.argoproj.io/sync-wave: "2"` pour que le certificat soit créé après l'initialisation de la PKI. + ### Pour un site public (`.fr`) Utilisez `letsencrypt-prod` comme avant : diff --git a/helm/certificates/ops/docs/README.md b/helm/certificates/ops/docs/README.md index 1c0b573..8d1c7ef 100644 --- a/helm/certificates/ops/docs/README.md +++ b/helm/certificates/ops/docs/README.md @@ -30,23 +30,46 @@ Ce chart gère les certificats TLS générés par cert-manager dans le cluster O 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: - # Le namespace où sera utilisé le secret TLS + namespace: certificates-ops spec: secretName: --tls issuerRef: - name: letsencrypt-prod # Pour sites publics (.fr) - # OU - # name: ca-issuer # Pour sites internes (.local) + 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//` diff --git a/helm/certificates/ops/templates/harbor/certificate-dev.yaml b/helm/certificates/ops/templates/harbor/certificate-dev.yaml index 890a222..dba71fd 100644 --- a/helm/certificates/ops/templates/harbor/certificate-dev.yaml +++ b/helm/certificates/ops/templates/harbor/certificate-dev.yaml @@ -3,6 +3,10 @@ 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: diff --git a/helm/certificates/ops/templates/headlamp/certificate-dev.yaml b/helm/certificates/ops/templates/headlamp/certificate-dev.yaml index ea98eb5..9c558bd 100644 --- a/helm/certificates/ops/templates/headlamp/certificate-dev.yaml +++ b/helm/certificates/ops/templates/headlamp/certificate-dev.yaml @@ -3,6 +3,10 @@ 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: