full-pushsecret.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {% raw %}
  2. apiVersion: external-secrets.io/v1alpha1
  3. kind: PushSecret
  4. metadata:
  5. name: pushsecret-example # Customisable
  6. namespace: default # Same of the SecretStores
  7. spec:
  8. updatePolicy: Replace # Policy to overwrite existing secrets in the provider on sync
  9. deletionPolicy: Delete # the provider' secret will be deleted if the PushSecret is deleted
  10. refreshInterval: 1h # Refresh interval for which push secret will reconcile
  11. secretStoreRefs: # A list of secret stores to push secrets to
  12. - name: aws-parameterstore
  13. kind: SecretStore
  14. selector:
  15. secret:
  16. name: pokedex-credentials # Source Kubernetes secret to be pushed
  17. # Alternatively, you can point to a generator that produces values to be pushed
  18. generatorRef:
  19. apiVersion: external-secrets.io/v1alpha1
  20. kind: ECRAuthorizationToken
  21. name: prod-registry-credentials
  22. template:
  23. metadata:
  24. annotations: { }
  25. labels: { }
  26. data:
  27. best-pokemon: "{{ .best-pokemon | toString | upper }} is the really best!"
  28. # Uses an existing template from configmap
  29. # Secret is fetched, merged and templated within the referenced configMap data
  30. # It does not update the configmap, it creates a secret with: data["alertmanager.yml"] = ...result...
  31. templateFrom:
  32. - configMap:
  33. name: application-config-tmpl
  34. items:
  35. - key: config.yml
  36. data:
  37. - conversionStrategy: None # Also supports the ReverseUnicode strategy
  38. match:
  39. secretKey: best-pokemon # Source Kubernetes secret key to be pushed
  40. remoteRef:
  41. remoteKey: my-first-parameter # Remote reference (where the secret is going to be pushed)
  42. {% endraw %}