full-cluster-external-secret.yaml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. externalSecretName: "hello-world-es"
  9. # This is a basic label selector to select the namespaces to deploy ExternalSecrets 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. # Deprecated: Use namespaceSelectors instead.
  12. # namespaceSelector:
  13. # matchLabels:
  14. # cool: label
  15. # This is a list of basic label selector to select the namespaces to deploy ExternalSecrets to.
  16. # you can read more about them here https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#resources-that-support-set-based-requirements
  17. # The list is OR'd together, so if any of the namespaceSelectors match the namespace,
  18. # the ExternalSecret will be deployed to that namespace.
  19. namespaceSelectors:
  20. - matchLabels:
  21. cool: label
  22. # How often the ClusterExternalSecret should reconcile itself
  23. # This will decide how often to check and make sure that the ExternalSecrets exist in the matching namespaces
  24. refreshTime: "1m"
  25. # This is the spec of the ExternalSecrets to be created
  26. # The content of this was taken from our ExternalSecret example
  27. externalSecretSpec:
  28. secretStoreRef:
  29. name: secret-store-name
  30. kind: SecretStore
  31. # RefreshPolicy determines how the ExternalSecret should be refreshed:
  32. # - CreatedOnce: Creates the Secret only if it does not exist and does not update it afterward
  33. # - Periodic: (default) Synchronizes the Secret at intervals specified by refreshInterval
  34. # - OnChange: Only synchronizes when the ExternalSecret's metadata or specification changes
  35. refreshPolicy: Periodic
  36. refreshInterval: "1h"
  37. target:
  38. name: my-secret
  39. creationPolicy: 'Merge'
  40. template:
  41. type: kubernetes.io/dockerconfigjson
  42. metadata:
  43. annotations: {}
  44. labels: {}
  45. data:
  46. config.yml: |
  47. endpoints:
  48. - https://{{ .data.user }}:{{ .data.password }}@api.exmaple.com
  49. templateFrom:
  50. - configMap:
  51. name: alertmanager
  52. items:
  53. - key: alertmanager.yaml
  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. dataFrom:
  61. - key: provider-key
  62. version: provider-key-version
  63. property: provider-key-property
  64. status:
  65. # This will list any namespaces where the creation of the ExternalSecret failed
  66. # This will not list any issues with the ExternalSecrets, you will have to check the
  67. # ExternalSecrets to see any issues with them.
  68. failedNamespaces:
  69. - namespace: "matching-ns-1"
  70. # This is one of the possible messages, and likely the most common
  71. reason: "external secret already exists in namespace"
  72. # You can find all matching and successfully deployed namespaces here
  73. provisionedNamespaces:
  74. - "matching-ns-3"
  75. - "matching-ns-2"
  76. # The condition can be Ready, PartiallyReady, or NotReady
  77. # PartiallyReady would indicate an error in 1 or more namespaces
  78. # NotReady would indicate errors in all namespaces meaning all ExternalSecrets resulted in errors
  79. conditions:
  80. - type: PartiallyReady
  81. status: "True"
  82. lastTransitionTime: "2022-01-12T12:33:02Z"
  83. {% endraw %}