full-external-secret.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. # Specify a blueprint for the resulting Kind=Secret
  35. template:
  36. type: kubernetes.io/dockerconfigjson # or TLS...
  37. metadata:
  38. annotations: {}
  39. labels: {}
  40. # Use inline templates to construct your desired config file that contains your secret
  41. data:
  42. config.yml: |
  43. endpoints:
  44. - https://{{ .data.user }}:{{ .data.password }}@api.exmaple.com
  45. # Uses an existing template from configmap
  46. # Secret is fetched, merged and templated within the referenced configMap data
  47. # It does not update the configmap, it creates a secret with: data["alertmanager.yml"] = ...result...
  48. templateFrom:
  49. - configMap:
  50. name: alertmanager
  51. items:
  52. - key: alertmanager.yaml
  53. # Data defines the connection between the Kubernetes Secret keys and the Provider data
  54. data:
  55. - secretKey: secret-key-to-be-managed
  56. remoteRef:
  57. key: provider-key
  58. version: provider-key-version
  59. property: provider-key-property
  60. # Used to fetch all properties from the Provider key
  61. # If multiple dataFrom are specified, secrets are merged in the specified order
  62. dataFrom:
  63. - extract:
  64. key: provider-key
  65. version: provider-key-version
  66. property: provider-key-property
  67. conversionStrategy: Default
  68. - find:
  69. path: path-to-filter
  70. name:
  71. regexp: ".*foobar.*"
  72. tags:
  73. foo: bar
  74. conversionStrategy: Unicode
  75. status:
  76. # refreshTime is the time and date the external secret was fetched and
  77. # the target secret updated
  78. refreshTime: "2019-08-12T12:33:02Z"
  79. # Standard condition schema
  80. conditions:
  81. # ExternalSecret ready condition indicates the secret is ready for use.
  82. # This is defined as:
  83. # - The target secret exists
  84. # - The target secret has been refreshed within the last refreshInterval
  85. # - The target secret content is up-to-date based on any target templates
  86. - type: Ready
  87. status: "True" # False if last refresh was not successful
  88. reason: "SecretSynced"
  89. message: "Secret was synced"
  90. lastTransitionTime: "2019-08-12T12:33:02Z"
  91. {% endraw %}