update 2
This commit is contained in:
@@ -104,8 +104,10 @@ vault kv get secret/cert-manager-webhook-ovh
|
|||||||
```
|
```
|
||||||
|
|
||||||
**Important** :
|
**Important** :
|
||||||
- Le format du chemin dans `remoteRef` pour External Secrets est `cert-manager-webhook-ovh#application-key` (sans le préfixe `secret/data/`), car le mount path `secret` est déjà défini dans le ClusterSecretStore.
|
- Pour Vault KV v2 avec External Secrets, utilisez le format avec `key` et `property` séparés :
|
||||||
- Le nom du secret dans Vault (`cert-manager-webhook-ovh`) doit correspondre exactement au nom utilisé dans `remoteRef`.
|
- `key`: Le chemin du secret dans Vault (ex: `cert-manager-webhook-ovh`)
|
||||||
|
- `property`: La clé dans le JSON du secret (ex: `application-key`)
|
||||||
|
- Le mount path `secret` est déjà défini dans le ClusterSecretStore, donc ne l'incluez pas dans `key`.
|
||||||
|
|
||||||
#### Configuration dans values.yaml
|
#### Configuration dans values.yaml
|
||||||
|
|
||||||
@@ -116,10 +118,11 @@ externalSecret:
|
|||||||
enabled: true
|
enabled: true
|
||||||
refreshInterval: "1h"
|
refreshInterval: "1h"
|
||||||
secretName: "cert-manager-webhook-ovh"
|
secretName: "cert-manager-webhook-ovh"
|
||||||
|
secretPath: "cert-manager-webhook-ovh" # Chemin du secret dans Vault
|
||||||
remoteRef:
|
remoteRef:
|
||||||
applicationKey: "cert-manager-webhook-ovh#application-key"
|
applicationKey: "application-key" # Clé dans le JSON
|
||||||
applicationSecret: "cert-manager-webhook-ovh#application-secret"
|
applicationSecret: "application-secret" # Clé dans le JSON
|
||||||
consumerKey: "cert-manager-webhook-ovh#consumer-key"
|
consumerKey: "consumer-key" # Clé dans le JSON
|
||||||
vault:
|
vault:
|
||||||
secretStoreName: "vault-backend"
|
secretStoreName: "vault-backend"
|
||||||
server: "https://vault.example.com:8200"
|
server: "https://vault.example.com:8200"
|
||||||
@@ -230,16 +233,21 @@ kubectl logs -n external-secrets-system \
|
|||||||
|
|
||||||
#### 6. Vérifier le format des chemins
|
#### 6. Vérifier le format des chemins
|
||||||
|
|
||||||
Le format correct pour Vault KV v2 est `cert-manager-webhook-ovh#application-key` (sans le préfixe `secret/data/`).
|
Le format correct pour Vault KV v2 avec External Secrets utilise `key` et `property` séparés :
|
||||||
|
|
||||||
Vérifiez dans `values.yaml` :
|
Vérifiez dans `values.yaml` :
|
||||||
```yaml
|
```yaml
|
||||||
|
secretPath: "cert-manager-webhook-ovh" # ✅ Correct - chemin du secret
|
||||||
remoteRef:
|
remoteRef:
|
||||||
applicationKey: "cert-manager-webhook-ovh#application-key" # ✅ Correct
|
applicationKey: "application-key" # ✅ Correct - clé dans le JSON
|
||||||
|
# ❌ Incorrect: "cert-manager-webhook-ovh#application-key"
|
||||||
# ❌ Incorrect: "secret/data/cert-manager-webhook-ovh#application-key"
|
# ❌ Incorrect: "secret/data/cert-manager-webhook-ovh#application-key"
|
||||||
```
|
```
|
||||||
|
|
||||||
**Important** : Le nom du secret dans Vault doit correspondre exactement au nom utilisé dans `remoteRef` (ici `cert-manager-webhook-ovh`).
|
**Important** :
|
||||||
|
- `secretPath` : Le chemin du secret dans Vault (sans le préfixe `secret/data/`)
|
||||||
|
- `remoteRef.*` : Les clés dans le JSON du secret
|
||||||
|
- Le mount path `secret` est géré par le ClusterSecretStore
|
||||||
|
|
||||||
#### 7. Forcer une nouvelle synchronisation
|
#### 7. Forcer une nouvelle synchronisation
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{{- if .Values.externalSecret.enabled }}
|
{{- if .Values.externalSecret.enabled }}
|
||||||
{{- if and .Values.externalSecret.vault.server .Values.externalSecret.remoteRef.applicationKey .Values.externalSecret.remoteRef.applicationSecret .Values.externalSecret.remoteRef.consumerKey }}
|
{{- if and .Values.externalSecret.vault.server .Values.externalSecret.secretPath .Values.externalSecret.remoteRef.applicationKey .Values.externalSecret.remoteRef.applicationSecret .Values.externalSecret.remoteRef.consumerKey }}
|
||||||
---
|
---
|
||||||
# ExternalSecret pour cert-manager-webhook-ovh-ops
|
# ExternalSecret pour cert-manager-webhook-ovh-ops
|
||||||
apiVersion: external-secrets.io/v1
|
apiVersion: external-secrets.io/v1
|
||||||
@@ -22,13 +22,16 @@ spec:
|
|||||||
data:
|
data:
|
||||||
- secretKey: application-key
|
- secretKey: application-key
|
||||||
remoteRef:
|
remoteRef:
|
||||||
key: {{ .Values.externalSecret.remoteRef.applicationKey }}
|
key: {{ .Values.externalSecret.secretPath | default "cert-manager-webhook-ovh" }}
|
||||||
|
property: {{ .Values.externalSecret.remoteRef.applicationKey }}
|
||||||
- secretKey: application-secret
|
- secretKey: application-secret
|
||||||
remoteRef:
|
remoteRef:
|
||||||
key: {{ .Values.externalSecret.remoteRef.applicationSecret }}
|
key: {{ .Values.externalSecret.secretPath | default "cert-manager-webhook-ovh" }}
|
||||||
|
property: {{ .Values.externalSecret.remoteRef.applicationSecret }}
|
||||||
- secretKey: consumer-key
|
- secretKey: consumer-key
|
||||||
remoteRef:
|
remoteRef:
|
||||||
key: {{ .Values.externalSecret.remoteRef.consumerKey }}
|
key: {{ .Values.externalSecret.secretPath | default "cert-manager-webhook-ovh" }}
|
||||||
|
property: {{ .Values.externalSecret.remoteRef.consumerKey }}
|
||||||
---
|
---
|
||||||
# ExternalSecret pour cert-manager-ops (partage du même secret)
|
# ExternalSecret pour cert-manager-ops (partage du même secret)
|
||||||
apiVersion: external-secrets.io/v1
|
apiVersion: external-secrets.io/v1
|
||||||
@@ -51,14 +54,17 @@ spec:
|
|||||||
data:
|
data:
|
||||||
- secretKey: application-key
|
- secretKey: application-key
|
||||||
remoteRef:
|
remoteRef:
|
||||||
key: {{ .Values.externalSecret.remoteRef.applicationKey }}
|
key: {{ .Values.externalSecret.secretPath | default "cert-manager-webhook-ovh" }}
|
||||||
|
property: {{ .Values.externalSecret.remoteRef.applicationKey }}
|
||||||
- secretKey: application-secret
|
- secretKey: application-secret
|
||||||
remoteRef:
|
remoteRef:
|
||||||
key: {{ .Values.externalSecret.remoteRef.applicationSecret }}
|
key: {{ .Values.externalSecret.secretPath | default "cert-manager-webhook-ovh" }}
|
||||||
|
property: {{ .Values.externalSecret.remoteRef.applicationSecret }}
|
||||||
- secretKey: consumer-key
|
- secretKey: consumer-key
|
||||||
remoteRef:
|
remoteRef:
|
||||||
key: {{ .Values.externalSecret.remoteRef.consumerKey }}
|
key: {{ .Values.externalSecret.secretPath | default "cert-manager-webhook-ovh" }}
|
||||||
|
property: {{ .Values.externalSecret.remoteRef.consumerKey }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
{{- fail "External Secrets est activé mais la configuration est incomplète. Veuillez définir externalSecret.vault.server et tous les remoteRef (applicationKey, applicationSecret, consumerKey)" }}
|
{{- fail "External Secrets est activé mais la configuration est incomplète. Veuillez définir externalSecret.vault.server, externalSecret.secretPath et tous les remoteRef (applicationKey, applicationSecret, consumerKey)" }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
@@ -91,14 +91,14 @@ externalSecret:
|
|||||||
|
|
||||||
# Références aux clés dans Vault
|
# Références aux clés dans Vault
|
||||||
# Format pour Vault KV v2 avec External Secrets:
|
# Format pour Vault KV v2 avec External Secrets:
|
||||||
# - Si le mount path est "secret" et le secret est dans "cert-manager-webhook-ovh": "cert-manager-webhook-ovh#application-key"
|
# - Le chemin du secret dans Vault (sans le préfixe "secret/data/")
|
||||||
# - Le préfixe "secret/data/" n'est PAS nécessaire car il est géré par le ClusterSecretStore
|
# - Les propriétés sont les clés dans le JSON du secret
|
||||||
# - Le format est: "chemin-du-secret#clef-dans-le-json"
|
|
||||||
# ⚠️ IMPORTANT: Le nom du secret dans Vault doit correspondre exactement ici
|
# ⚠️ IMPORTANT: Le nom du secret dans Vault doit correspondre exactement ici
|
||||||
|
secretPath: "cert-manager-webhook-ovh" # ⚠️ Chemin du secret dans Vault (ex: secret/cert-manager-webhook-ovh)
|
||||||
remoteRef:
|
remoteRef:
|
||||||
applicationKey: "cert-manager-webhook-ovh#application-key" # ⚠️ Chemin: secret/cert-manager-webhook-ovh avec clé application-key
|
applicationKey: "application-key" # ⚠️ Clé dans le JSON du secret
|
||||||
applicationSecret: "cert-manager-webhook-ovh#application-secret" # ⚠️ Chemin: secret/cert-manager-webhook-ovh avec clé application-secret
|
applicationSecret: "application-secret" # ⚠️ Clé dans le JSON du secret
|
||||||
consumerKey: "cert-manager-webhook-ovh#consumer-key" # ⚠️ Chemin: secret/cert-manager-webhook-ovh avec clé consumer-key
|
consumerKey: "consumer-key" # ⚠️ Clé dans le JSON du secret
|
||||||
|
|
||||||
# Configuration HashiCorp Vault
|
# Configuration HashiCorp Vault
|
||||||
vault:
|
vault:
|
||||||
|
|||||||
Reference in New Issue
Block a user