pushsecret-datato-chained.yaml 710 B

123456789101112131415161718192021222324252627282930
  1. apiVersion: external-secrets.io/v1alpha1
  2. kind: PushSecret
  3. metadata:
  4. name: pushsecret-datato-chained
  5. namespace: default
  6. spec:
  7. refreshInterval: 10s
  8. secretStoreRefs:
  9. - name: secret-store
  10. kind: SecretStore
  11. selector:
  12. secret:
  13. name: source-secret
  14. # Apply multiple transformations sequentially
  15. dataTo:
  16. - storeRef:
  17. name: secret-store
  18. match:
  19. regexp: "^db-.*"
  20. rewrite:
  21. # First: Remove "db-" prefix
  22. - regexp:
  23. source: "^db-"
  24. target: ""
  25. # Second: Add "prod/" prefix
  26. - regexp:
  27. source: "^"
  28. target: "prod/"
  29. # db-host -> host -> prod/host
  30. # db-port -> port -> prod/port