136 lines
3.7 KiB
Markdown
136 lines
3.7 KiB
Markdown
# Installation du Webhook OVH pour cert-manager
|
|
|
|
## Problème
|
|
|
|
Cert-manager v1.19.2 ne supporte **pas nativement** le provider OVH. L'erreur `no DNS01 provider configured` apparaît car cert-manager ne reconnaît pas la syntaxe `ovh:` directement.
|
|
|
|
## Solution
|
|
|
|
Installer le webhook `cert-manager-webhook-ovh` qui ajoute le support OVH à cert-manager.
|
|
|
|
## Étape 1 : Ajouter le dépôt Helm
|
|
|
|
```bash
|
|
helm repo add cert-manager-webhook-ovh https://cert-manager.github.io/webhook-ovh
|
|
helm repo update
|
|
```
|
|
|
|
## Étape 2 : Installer le Webhook OVH
|
|
|
|
```bash
|
|
helm install cert-manager-webhook-ovh cert-manager-webhook-ovh/cert-manager-webhook-ovh \
|
|
-n cert-manager-ops \
|
|
--create-namespace \
|
|
--set groupName=acme.gkdomaine.fr
|
|
```
|
|
|
|
**Important** : Le `groupName` doit correspondre à celui configuré dans le ClusterIssuer (`acme.gkdomaine.fr`).
|
|
|
|
## Étape 3 : Vérifier l'Installation
|
|
|
|
```bash
|
|
# Vérifier que le webhook est installé
|
|
kubectl get pods -n cert-manager-ops | grep webhook-ovh
|
|
|
|
# Vérifier les logs
|
|
kubectl logs -n cert-manager-ops -l app.kubernetes.io/name=cert-manager-webhook-ovh
|
|
```
|
|
|
|
## Étape 4 : Mettre à jour le Secret OVH
|
|
|
|
Le Secret doit maintenant contenir les 3 clés (application-key, application-secret, consumer-key) :
|
|
|
|
```bash
|
|
kubectl create secret generic ovh-credentials \
|
|
--from-literal=application-key=e598bb73ded17ee6 \
|
|
--from-literal=application-secret=VOTRE_APPLICATION_SECRET \
|
|
--from-literal=consumer-key=372e273858204d972dbf7c50506d12a1 \
|
|
-n certificates-ops \
|
|
--context=cluster-ops
|
|
```
|
|
|
|
Ou mettez à jour le Secret existant :
|
|
|
|
```bash
|
|
kubectl patch secret ovh-credentials -n certificates-ops \
|
|
--type='json' \
|
|
-p='[
|
|
{"op": "add", "path": "/data/application-key", "value": "'$(echo -n 'e598bb73ded17ee6' | base64)'"},
|
|
{"op": "add", "path": "/data/consumer-key", "value": "'$(echo -n '372e273858204d972dbf7c50506d12a1' | base64)'"}
|
|
]' \
|
|
--context=cluster-ops
|
|
```
|
|
|
|
## Étape 5 : Vérifier le ClusterIssuer
|
|
|
|
Après installation du webhook, le ClusterIssuer devrait être accepté :
|
|
|
|
```bash
|
|
# Vérifier le ClusterIssuer
|
|
kubectl get clusterissuer letsencrypt-dns01-prod --context=cluster-ops
|
|
|
|
# Voir les détails
|
|
kubectl describe clusterissuer letsencrypt-dns01-prod --context=cluster-ops
|
|
```
|
|
|
|
## Alternative : Utiliser Cloudflare (si disponible)
|
|
|
|
Si vous avez accès à Cloudflare pour gérer votre DNS, vous pouvez utiliser Cloudflare qui est supporté nativement par cert-manager :
|
|
|
|
```yaml
|
|
solvers:
|
|
- selector:
|
|
dnsZones:
|
|
- "dev.gkdomaine.fr"
|
|
dns01:
|
|
cloudflare:
|
|
email: gkpoubelle78@gmail.com
|
|
apiKeySecretRef:
|
|
name: cloudflare-api-key
|
|
key: api-key
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Le webhook ne démarre pas
|
|
|
|
1. Vérifiez les logs :
|
|
```bash
|
|
kubectl logs -n cert-manager-ops -l app.kubernetes.io/name=cert-manager-webhook-ovh
|
|
```
|
|
|
|
2. Vérifiez les événements :
|
|
```bash
|
|
kubectl get events -n cert-manager-ops --sort-by='.lastTimestamp' | grep webhook-ovh
|
|
```
|
|
|
|
### Le ClusterIssuer est toujours rejeté
|
|
|
|
1. Vérifiez que le `groupName` correspond :
|
|
- Dans le ClusterIssuer : `groupName: acme.gkdomaine.fr`
|
|
- Dans l'installation du webhook : `--set groupName=acme.gkdomaine.fr`
|
|
|
|
2. Vérifiez les logs du webhook cert-manager :
|
|
```bash
|
|
kubectl logs -n cert-manager-ops -l app.kubernetes.io/component=webhook
|
|
```
|
|
|
|
### Le certificat ne se génère pas
|
|
|
|
1. Vérifiez que le Secret contient les 3 clés :
|
|
```bash
|
|
kubectl get secret ovh-credentials -n certificates-ops -o yaml
|
|
```
|
|
|
|
2. Vérifiez les challenges DNS :
|
|
```bash
|
|
kubectl get challenges -n certificates-ops
|
|
kubectl describe challenge -n certificates-ops
|
|
```
|
|
|
|
## Documentation
|
|
|
|
- [cert-manager-webhook-ovh GitHub](https://github.com/cert-manager/webhook-ovh)
|
|
- [Documentation cert-manager DNS-01](https://cert-manager.io/docs/configuration/acme/dns01/)
|
|
|