From 74de187ee77bc42f0e59aedbb887059ed2733955 Mon Sep 17 00:00:00 2001 From: Melvin GABALI Date: Thu, 22 Jan 2026 20:53:53 +0100 Subject: [PATCH] enable --- .../rbac-cert-manager.yaml | 0 .../templates => 00-OLD}/rbac-webhook.yaml | 0 ...licationset-cert-manager-webhook-ovh.yaml} | 0 helm/cert-manager-webhook-ovh/ops/README.md | 168 ++++++++++++++++++ .../templates/clustersecretstore-vault.yaml | 40 +++++ .../externalsecret-ovh-credentials.yaml | 64 +++++++ .../ops/templates/service-account.yaml | 6 + helm/cert-manager-webhook-ovh/ops/values.yaml | 41 +++++ 8 files changed, 319 insertions(+) rename {helm/cert-manager-webhook-ovh/ops/templates => 00-OLD}/rbac-cert-manager.yaml (100%) rename {helm/cert-manager-webhook-ovh/ops/templates => 00-OLD}/rbac-webhook.yaml (100%) rename apps/{applicationset-cert-manager-webhook-ovh.yaml.disable => applicationset-cert-manager-webhook-ovh.yaml} (100%) create mode 100644 helm/cert-manager-webhook-ovh/ops/README.md create mode 100644 helm/cert-manager-webhook-ovh/ops/templates/clustersecretstore-vault.yaml create mode 100644 helm/cert-manager-webhook-ovh/ops/templates/externalsecret-ovh-credentials.yaml create mode 100644 helm/cert-manager-webhook-ovh/ops/templates/service-account.yaml diff --git a/helm/cert-manager-webhook-ovh/ops/templates/rbac-cert-manager.yaml b/00-OLD/rbac-cert-manager.yaml similarity index 100% rename from helm/cert-manager-webhook-ovh/ops/templates/rbac-cert-manager.yaml rename to 00-OLD/rbac-cert-manager.yaml diff --git a/helm/cert-manager-webhook-ovh/ops/templates/rbac-webhook.yaml b/00-OLD/rbac-webhook.yaml similarity index 100% rename from helm/cert-manager-webhook-ovh/ops/templates/rbac-webhook.yaml rename to 00-OLD/rbac-webhook.yaml diff --git a/apps/applicationset-cert-manager-webhook-ovh.yaml.disable b/apps/applicationset-cert-manager-webhook-ovh.yaml similarity index 100% rename from apps/applicationset-cert-manager-webhook-ovh.yaml.disable rename to apps/applicationset-cert-manager-webhook-ovh.yaml diff --git a/helm/cert-manager-webhook-ovh/ops/README.md b/helm/cert-manager-webhook-ovh/ops/README.md new file mode 100644 index 0000000..6d72e29 --- /dev/null +++ b/helm/cert-manager-webhook-ovh/ops/README.md @@ -0,0 +1,168 @@ +# cert-manager-webhook-ovh + +Ce chart déploie le webhook OVH pour cert-manager, permettant l'utilisation du challenge DNS-01 avec OVH pour obtenir des certificats wildcard Let's Encrypt. + +## Configuration des credentials OVH + +Les credentials OVH peuvent être gérés de deux façons : + +### Option 1 : Secret Kubernetes classique (par défaut) + +Créez manuellement le Secret `cert-manager-webhook-ovh` dans les deux namespaces : + +```bash +# Dans cert-manager-webhook-ovh-ops +kubectl create secret generic cert-manager-webhook-ovh \ + --from-literal=application-key="VOTRE_APPLICATION_KEY" \ + --from-literal=application-secret="VOTRE_APPLICATION_SECRET" \ + --from-literal=consumer-key="VOTRE_CONSUMER_KEY" \ + -n cert-manager-webhook-ovh-ops \ + --context=cluster-ops + +# Dans cert-manager-ops +kubectl create secret generic cert-manager-webhook-ovh \ + --from-literal=application-key="VOTRE_APPLICATION_KEY" \ + --from-literal=application-secret="VOTRE_APPLICATION_SECRET" \ + --from-literal=consumer-key="VOTRE_CONSUMER_KEY" \ + -n cert-manager-ops \ + --context=cluster-ops +``` + +### Option 2 : External Secrets Operator - Stratégie Multi-Namespace (recommandé) + +Utilisez External Secrets Operator pour synchroniser automatiquement les credentials depuis HashiCorp Vault dans **plusieurs namespaces** en utilisant un **ClusterSecretStore** partagé. + +#### Avantages de la stratégie Multi-Namespace + +- ✅ **Un seul ClusterSecretStore** : Configuration centralisée pour tous les namespaces +- ✅ **Synchronisation automatique** : Les secrets sont créés automatiquement dans chaque namespace +- ✅ **Rotation automatique** : Les secrets sont rafraîchis automatiquement selon `refreshInterval` +- ✅ **Sécurité** : Les credentials ne sont jamais stockés en clair dans Git +- ✅ **Partage facile** : Le même secret est disponible dans `cert-manager-ops` et `cert-manager-webhook-ovh-ops` + +#### Prérequis + +1. **External Secrets Operator installé** dans le cluster +2. **HashiCorp Vault configuré** avec un rôle Kubernetes auth +3. **ServiceAccount configuré** : Le ServiceAccount `cert-manager-webhook-ovh-sa` doit être autorisé dans Vault pour les namespaces `cert-manager-ops` et `cert-manager-webhook-ovh-ops` + +#### Configuration dans Vault + +Créez un rôle Vault pour l'authentification Kubernetes : + +```bash +# Configuration du rôle Vault +vault write auth/kubernetes/role/cert-manager-webhook-ovh-role \ + bound_service_account_names=cert-manager-webhook-ovh-sa \ + bound_service_account_namespaces=cert-manager-webhook-ovh-ops,cert-manager-ops \ + policies=cert-manager-webhook-ovh-policy \ + ttl=1h + +# IMPORTANT : Ne configurez PAS bound_service_account_namespace_selector +# Utilisez bound_service_account_namespaces avec une liste de namespaces +``` + +Créez une policy Vault pour accéder aux secrets OVH : + +```bash +vault policy write cert-manager-webhook-ovh-policy - <