full-cluster-push-secret.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {% raw %}
  2. apiVersion: external-secrets.io/v1alpha1
  3. kind: ClusterPushSecret
  4. metadata:
  5. name: "hello-world"
  6. spec:
  7. # The name to be used on the PushSecrets
  8. pushSecretName: "hello-world-ps"
  9. # This is a list of basic label selector to select the namespaces to deploy PushSecrets to.
  10. # you can read more about them here https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements
  11. # The list is OR'd together, so if any of the namespaceSelectors match the namespace,
  12. # the ExternalSecret will be deployed to that namespace.
  13. namespaceSelectors:
  14. - matchLabels:
  15. cool: label
  16. # How often the ClusterPushSecret should reconcile itself
  17. # This will decide how often to check and make sure that the PushSecrets exist in the matching namespaces
  18. refreshTime: "1m"
  19. # This is the spec of the PushSecrets to be created
  20. # The content of this was taken from our PushSecret example
  21. pushSecretSpec:
  22. updatePolicy: Replace # Policy to overwrite existing secrets in the provider on sync
  23. deletionPolicy: Delete # the provider' secret will be deleted if the PushSecret is deleted
  24. refreshInterval: 1h # Refresh interval for which push secret will reconcile
  25. secretStoreRefs: # A list of secret stores to push secrets to
  26. - name: aws-parameterstore
  27. kind: SecretStore
  28. selector:
  29. secret:
  30. name: pokedex-credentials # Source Kubernetes secret to be pushed
  31. # Alternatively, you can point to a generator that produces values to be pushed
  32. generatorRef:
  33. apiVersion: external-secrets.io/v1alpha1
  34. kind: ECRAuthorizationToken
  35. name: prod-registry-credentials
  36. template:
  37. metadata:
  38. annotations: { }
  39. labels: { }
  40. data:
  41. best-pokemon: "{{ .best-pokemon | toString | upper }} is the really best!"
  42. # Uses an existing template from configmap
  43. # Secret is fetched, merged and templated within the referenced configMap data
  44. # It does not update the configmap, it creates a secret with: data["alertmanager.yml"] = ...result...
  45. templateFrom:
  46. - configMap:
  47. name: application-config-tmpl
  48. items:
  49. - key: config.yml
  50. data:
  51. - conversionStrategy: None # Also supports the ReverseUnicode strategy
  52. match:
  53. secretKey: best-pokemon # Source Kubernetes secret key to be pushed
  54. remoteRef:
  55. remoteKey: my-first-parameter # Remote reference (where the secret is going to be pushed)
  56. status:
  57. # This will list any namespaces where the creation of the ExternalSecret failed
  58. # This will not list any issues with the ExternalSecrets, you will have to check the
  59. # ExternalSecrets to see any issues with them.
  60. failedNamespaces:
  61. - namespace: "matching-ns-1"
  62. # This is one of the possible messages, and likely the most common
  63. reason: "external secret already exists in namespace"
  64. # You can find all matching and successfully deployed namespaces here
  65. provisionedNamespaces:
  66. - "matching-ns-3"
  67. - "matching-ns-2"
  68. # The condition can be Ready, PartiallyReady, or NotReady
  69. # PartiallyReady would indicate an error in 1 or more namespaces
  70. # NotReady would indicate errors in all namespaces meaning all ExternalSecrets resulted in errors
  71. conditions:
  72. - type: PartiallyReady
  73. status: "True"
  74. lastTransitionTime: "2022-01-12T12:33:02Z"
  75. {% endraw %}