full-external-secret.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. {% raw %}
  2. apiVersion: external-secrets.io/v1beta1
  3. kind: ExternalSecret
  4. metadata:
  5. name: "hello-world"
  6. # labels and annotations are copied over to the
  7. # secret that will be created
  8. labels:
  9. acme.org/owned-by: "q-team"
  10. annotations:
  11. acme.org/sha: 1234
  12. spec:
  13. # SecretStoreRef defines which SecretStore to use when fetching the secret data
  14. secretStoreRef:
  15. name: secret-store-name
  16. kind: SecretStore # or ClusterSecretStore
  17. # RefreshInterval is the amount of time before the values reading again from the SecretStore provider
  18. # Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h" (from time.ParseDuration)
  19. # May be set to zero to fetch and create it once
  20. refreshInterval: "1h"
  21. # the target describes the secret that shall be created
  22. # there can only be one target per ExternalSecret
  23. target:
  24. # The secret name of the resource
  25. # Defaults to .metadata.name of the ExternalSecret
  26. # It is immutable
  27. name: my-secret
  28. # Enum with values: 'Owner', 'Merge', or 'None'
  29. # Default value of 'Owner'
  30. # Owner creates the secret and sets .metadata.ownerReferences of the resource
  31. # Merge does not create the secret, but merges in the data fields to the secret
  32. # None does not create a secret (future use with injector)
  33. creationPolicy: 'Merge'
  34. # DeletionPolicy defines how/when to delete the Secret in Kubernetes
  35. # if the provider secret gets deleted.
  36. # Valid values are Delete, Merge, Retain
  37. deletionPolicy: "Retain"
  38. # Specify a blueprint for the resulting Kind=Secret
  39. template:
  40. type: kubernetes.io/dockerconfigjson # or TLS...
  41. metadata:
  42. annotations: {}
  43. labels: {}
  44. # Use inline templates to construct your desired config file that contains your secret
  45. data:
  46. config.yml: |
  47. endpoints:
  48. - https://{{ .data.user }}:{{ .data.password }}@api.exmaple.com
  49. # Uses an existing template from configmap
  50. # Secret is fetched, merged and templated within the referenced configMap data
  51. # It does not update the configmap, it creates a secret with: data["alertmanager.yml"] = ...result...
  52. templateFrom:
  53. - configMap:
  54. name: alertmanager
  55. items:
  56. - key: alertmanager.yaml
  57. # Data defines the connection between the Kubernetes Secret keys and the Provider data
  58. data:
  59. - secretKey: secret-key-to-be-managed
  60. remoteRef:
  61. key: provider-key
  62. version: provider-key-version
  63. property: provider-key-property
  64. decodingStrategy: None # can be None, Base64, Base64URL or Auto
  65. # Used to fetch all properties from the Provider key
  66. # If multiple dataFrom are specified, secrets are merged in the specified order
  67. dataFrom:
  68. - extract:
  69. key: provider-key
  70. version: provider-key-version
  71. property: provider-key-property
  72. conversionStrategy: Default
  73. decodingStrategy: Auto
  74. - find:
  75. path: path-to-filter
  76. name:
  77. regexp: ".*foobar.*"
  78. tags:
  79. foo: bar
  80. conversionStrategy: Unicode
  81. decodingStrategy: Base64
  82. status:
  83. # refreshTime is the time and date the external secret was fetched and
  84. # the target secret updated
  85. refreshTime: "2019-08-12T12:33:02Z"
  86. # Standard condition schema
  87. conditions:
  88. # ExternalSecret ready condition indicates the secret is ready for use.
  89. # This is defined as:
  90. # - The target secret exists
  91. # - The target secret has been refreshed within the last refreshInterval
  92. # - The target secret content is up-to-date based on any target templates
  93. - type: Ready
  94. status: "True" # False if last refresh was not successful
  95. reason: "SecretSynced"
  96. message: "Secret was synced"
  97. lastTransitionTime: "2019-08-12T12:33:02Z"
  98. {% endraw %}