SGObjectStorage.yaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. apiVersion: apiextensions.k8s.io/v1
  2. kind: CustomResourceDefinition
  3. metadata:
  4. name: sgobjectstorages.stackgres.io
  5. spec:
  6. group: stackgres.io
  7. scope: Namespaced
  8. names:
  9. kind: SGObjectStorage
  10. listKind: SGObjectStorageList
  11. plural: sgobjectstorages
  12. singular: sgobjectstorage
  13. shortNames:
  14. - sgobjs
  15. versions:
  16. - name: v1beta1
  17. served: true
  18. storage: true
  19. additionalPrinterColumns:
  20. - name: type
  21. type: string
  22. jsonPath: .spec.type
  23. schema:
  24. openAPIV3Schema:
  25. type: object
  26. required: ["metadata", "spec"]
  27. properties:
  28. metadata:
  29. type: object
  30. properties:
  31. name:
  32. type: string
  33. description: |
  34. Name of the Object Storage configuration.
  35. The name must be unique across all object storage configurations in the same namespace.
  36. spec:
  37. type: object
  38. description: |
  39. Object Storage configuration
  40. properties:
  41. type:
  42. type: string
  43. enum: ["s3", "s3Compatible", "gcs", "azureBlob"]
  44. description: |
  45. Determine the type of object storage used for storing the base backups and WAL segments.
  46. Possible values:
  47. * `s3`: Amazon Web Services S3 (Simple Storage Service).
  48. * `s3Compatible`: non-AWS services that implement a compatibility API with AWS S3.
  49. * `gcs`: Google Cloud Storage.
  50. * `azureBlob`: Microsoft Azure Blob Storage.
  51. s3:
  52. type: object
  53. description: |
  54. Amazon Web Services S3 configuration.
  55. properties:
  56. bucket:
  57. type: string
  58. pattern: '^((s3|https?)://)?[^/]+(/[^/]*)*$'
  59. description: |
  60. AWS S3 bucket name.
  61. region:
  62. type: string
  63. description: |
  64. The AWS S3 region. The Region may be detected using s3:GetBucketLocation, but if you wish to avoid giving permissions to this API call or forbid it from the applicable IAM policy, you must then specify this property.
  65. storageClass:
  66. type: string
  67. description: |
  68. The [Amazon S3 Storage Class](https://aws.amazon.com/s3/storage-classes/) to use for the backup object storage. By default, the `STANDARD` storage class is used. Other supported values include `STANDARD_IA` for Infrequent Access and `REDUCED_REDUNDANCY`.
  69. awsCredentials:
  70. type: object
  71. description: |
  72. The credentials to access AWS S3 for writing and reading.
  73. properties:
  74. secretKeySelectors:
  75. type: object
  76. description: |
  77. Kubernetes [SecretKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretkeyselector-v1-core)(s) to reference the Secrets that contain the information about the `awsCredentials`. Note that you may use the same or different Secrets for the `accessKeyId` and the `secretAccessKey`. In the former case, the `keys` that identify each must be, obviously, different.
  78. properties:
  79. accessKeyId:
  80. type: object
  81. description: |
  82. AWS [access key ID](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). For example, `AKIAIOSFODNN7EXAMPLE`.
  83. properties:
  84. key:
  85. type: string
  86. description: |
  87. The key of the secret to select from. Must be a valid secret key.
  88. name:
  89. type: string
  90. description: |
  91. Name of the referent. [More information](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
  92. required: ["key", "name"]
  93. secretAccessKey:
  94. type: object
  95. description: |
  96. AWS [secret access key](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). For example, `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`.
  97. properties:
  98. key:
  99. type: string
  100. description: |
  101. The key of the secret to select from. Must be a valid secret key.
  102. name:
  103. type: string
  104. description: |
  105. Name of the referent. [More information](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
  106. required: ["key", "name"]
  107. required: ["accessKeyId", "secretAccessKey"]
  108. required: ["secretKeySelectors"]
  109. required: ["bucket", "awsCredentials"]
  110. s3Compatible:
  111. type: object
  112. description: "AWS S3-Compatible API configuration"
  113. properties:
  114. bucket:
  115. type: string
  116. pattern: '^((s3|https?)://)?[^/]+(/[^/]*)*$'
  117. description: |
  118. Bucket name.
  119. enablePathStyleAddressing:
  120. type: boolean
  121. description: |
  122. Enable path-style addressing (i.e. `http://s3.amazonaws.com/BUCKET/KEY`) when connecting to an S3-compatible service that lacks support for sub-domain style bucket URLs (i.e. `http://BUCKET.s3.amazonaws.com/KEY`).
  123. Defaults to false.
  124. endpoint:
  125. type: string
  126. description: |
  127. Overrides the default url to connect to an S3-compatible service.
  128. For example: `http://s3-like-service:9000`.
  129. region:
  130. type: string
  131. description: |
  132. The AWS S3 region. The Region may be detected using s3:GetBucketLocation, but if you wish to avoid giving permissions to this API call or forbid it from the applicable IAM policy, you must then specify this property.
  133. storageClass:
  134. type: string
  135. description: |
  136. The [Amazon S3 Storage Class](https://aws.amazon.com/s3/storage-classes/) to use for the backup object storage. By default, the `STANDARD` storage class is used. Other supported values include `STANDARD_IA` for Infrequent Access and `REDUCED_REDUNDANCY`.
  137. awsCredentials:
  138. type: object
  139. description: |
  140. The credentials to access AWS S3 for writing and reading.
  141. properties:
  142. secretKeySelectors:
  143. type: object
  144. description: |
  145. Kubernetes [SecretKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretkeyselector-v1-core)(s) to reference the Secret(s) that contain the information about the `awsCredentials`. Note that you may use the same or different Secrets for the `accessKeyId` and the `secretAccessKey`. In the former case, the `keys` that identify each must be, obviously, different.
  146. properties:
  147. accessKeyId:
  148. type: object
  149. description: |
  150. AWS [access key ID](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). For example, `AKIAIOSFODNN7EXAMPLE`.
  151. properties:
  152. key:
  153. type: string
  154. description: |
  155. The key of the secret to select from. Must be a valid secret key.
  156. name:
  157. type: string
  158. description: |
  159. Name of the referent. [More information](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
  160. required: ["key", "name"]
  161. secretAccessKey:
  162. type: object
  163. description: |
  164. AWS [secret access key](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys). For example, `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`.
  165. properties:
  166. key:
  167. type: string
  168. description: |
  169. The key of the secret to select from. Must be a valid secret key.
  170. name:
  171. type: string
  172. description: |
  173. Name of the referent. [More information](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
  174. required: ["key", "name"]
  175. caCertificate:
  176. type: object
  177. description: |
  178. CA Certificate file to be used when connecting to the S3 Compatible Service.
  179. properties:
  180. key:
  181. type: string
  182. description: |
  183. The key of the secret to select from. Must be a valid secret key.
  184. name:
  185. type: string
  186. description: |
  187. Name of the referent. [More information](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
  188. required: ["key", "name"]
  189. required: ["accessKeyId", "secretAccessKey"]
  190. required: ["secretKeySelectors"]
  191. required: ["bucket", "awsCredentials"]
  192. gcs:
  193. type: object
  194. description: |
  195. Google Cloud Storage configuration.
  196. properties:
  197. bucket:
  198. type: string
  199. pattern: "^(gs://)?[^/]+(/[^/]*)*$"
  200. description: |
  201. GCS bucket name.
  202. gcpCredentials:
  203. type: object
  204. description: |
  205. The credentials to access GCS for writing and reading.
  206. properties:
  207. fetchCredentialsFromMetadataService:
  208. type: boolean
  209. description: |
  210. If true, the credentials will be fetched from the GCE/GKE metadata service and the field `secretKeySelectors` have to be set to null or omitted.
  211. This is useful when running StackGres inside a GKE cluster using [Workload Identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity).
  212. secretKeySelectors:
  213. type: object
  214. description: |
  215. A Kubernetes [SecretKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretkeyselector-v1-core) to reference the Secrets that contain the information about the Service Account to access GCS.
  216. properties:
  217. serviceAccountJSON:
  218. type: object
  219. description: |
  220. A service account key from GCP. In JSON format, as downloaded from the GCP Console.
  221. properties:
  222. key:
  223. type: string
  224. description: |
  225. The key of the secret to select from. Must be a valid secret key.
  226. name:
  227. type: string
  228. description: |
  229. Name of the referent. [More information](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
  230. required: [ "key", "name" ]
  231. required: [ "serviceAccountJSON" ]
  232. required: [ "bucket", "gcpCredentials" ]
  233. azureBlob:
  234. type: object
  235. description: |
  236. Azure Blob Storage configuration.
  237. properties:
  238. bucket:
  239. type: string
  240. pattern: "^(azure://)?[^/]+(/[^/]*)*$"
  241. description: |
  242. Azure Blob Storage bucket name.
  243. azureCredentials:
  244. type: object
  245. description: |
  246. The credentials to access Azure Blob Storage for writing and reading.
  247. properties:
  248. secretKeySelectors:
  249. type: object
  250. description: |
  251. Kubernetes [SecretKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretkeyselector-v1-core)(s) to reference the Secret(s) that contain the information about the `azureCredentials`. . Note that you may use the same or different Secrets for the `storageAccount` and the `accessKey`. In the former case, the `keys` that identify each must be, obviously, different.
  252. properties:
  253. storageAccount:
  254. type: object
  255. description: |
  256. The [Storage Account](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview?toc=/azure/storage/blobs/toc.json) that contains the Blob bucket to be used.
  257. properties:
  258. key:
  259. type: string
  260. description: |
  261. The key of the secret to select from. Must be a valid secret key.
  262. name:
  263. type: string
  264. description: |
  265. Name of the referent. [More information](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
  266. required: [ "key", "name" ]
  267. accessKey:
  268. type: object
  269. description: |
  270. The [storage account access key](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage?tabs=azure-portal).
  271. properties:
  272. key:
  273. type: string
  274. description: |
  275. The key of the secret to select from. Must be a valid secret key.
  276. name:
  277. type: string
  278. description: |
  279. Name of the referent. [More information](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
  280. required: [ "key", "name" ]
  281. required: [ "storageAccount", "accessKey" ]
  282. required: [ "bucket", "azureCredentials" ]
  283. required: [ "type" ]