full-cluster-external-secret.yaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {% raw %}
  2. apiVersion: external-secrets.io/v1
  3. kind: ClusterExternalSecret
  4. metadata:
  5. name: "hello-world"
  6. spec:
  7. # The name to be used on the ExternalSecrets.
  8. # Defaults to the name of the ClusterExternalSecret when omitted.
  9. externalSecretName: "hello-world-es"
  10. # Optional labels and annotations to set on every created ExternalSecret.
  11. externalSecretMetadata:
  12. labels: {}
  13. annotations: {}
  14. # This is a basic label selector to select the namespaces to deploy ExternalSecrets to.
  15. # you can read more about them here https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements
  16. # Deprecated: Use namespaceSelectors instead.
  17. # namespaceSelector:
  18. # matchLabels:
  19. # cool: label
  20. # This is a list of basic label selector to select the namespaces to deploy ExternalSecrets to.
  21. # you can read more about them here https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements
  22. # The list is OR'd together, so if any of the namespaceSelectors match the namespace,
  23. # the ExternalSecret will be deployed to that namespace.
  24. namespaceSelectors:
  25. - matchLabels:
  26. cool: label
  27. # Choose namespaces by name. This is OR'd with anything namespaceSelectors matches.
  28. # Deprecated: Use namespaceSelectors instead.
  29. # namespaces:
  30. # - my-namespace
  31. # How often the ClusterExternalSecret should reconcile itself
  32. # This will decide how often to check and make sure that the ExternalSecrets exist in the matching namespaces
  33. # If omitted, the controller's default requeue interval is used.
  34. refreshTime: "1m"
  35. # This is the spec of the ExternalSecrets to be created
  36. # The content of this was taken from our ExternalSecret example
  37. externalSecretSpec:
  38. secretStoreRef:
  39. name: secret-store-name
  40. kind: SecretStore
  41. # RefreshPolicy determines how the ExternalSecret should be refreshed:
  42. # - CreatedOnce: Creates the Secret only if it does not exist and does not update it afterward
  43. # - Periodic: (default) Synchronizes the Secret at intervals specified by refreshInterval
  44. # - OnChange: Only synchronizes when the ExternalSecret's metadata or specification changes
  45. refreshPolicy: Periodic
  46. refreshInterval: "1h0m0s"
  47. target:
  48. name: my-secret
  49. creationPolicy: 'Merge'
  50. template:
  51. type: kubernetes.io/dockerconfigjson
  52. metadata:
  53. annotations: {}
  54. labels: {}
  55. data:
  56. config.yml: |
  57. endpoints:
  58. - https://{{ .data.user }}:{{ .data.password }}@api.exmaple.com
  59. templateFrom:
  60. - configMap:
  61. name: alertmanager
  62. items:
  63. - key: alertmanager.yaml
  64. data:
  65. - secretKey: secret-key-to-be-managed
  66. remoteRef:
  67. key: provider-key
  68. version: provider-key-version
  69. property: provider-key-property
  70. dataFrom:
  71. - key: provider-key
  72. version: provider-key-version
  73. property: provider-key-property
  74. status:
  75. # This will list any namespaces where the creation of the ExternalSecret failed
  76. # This will not list any issues with the ExternalSecrets, you will have to check the
  77. # ExternalSecrets to see any issues with them.
  78. failedNamespaces:
  79. - namespace: "matching-ns-1"
  80. # This is one of the possible messages, and likely the most common
  81. reason: "external secret already exists in namespace"
  82. # You can find all matching and successfully deployed namespaces here
  83. provisionedNamespaces:
  84. - "matching-ns-3"
  85. - "matching-ns-2"
  86. # The only condition type is Ready. status is "True" when all matching
  87. # namespaces synced, and "False" if one or more namespaces failed (the failed
  88. # ones are listed under failedNamespaces above).
  89. conditions:
  90. - type: Ready
  91. status: "False"
  92. message: "one or more namespaces failed"
  93. lastTransitionTime: "2022-01-12T12:33:02Z"
  94. {% endraw %}