You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-3Lines changed: 39 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This Operator SDK based tool aims at managing S3 related resources (buckets, pol
4
4
5
5
## At a glance
6
6
7
-
- Current S3 providers : [Minio](https://github.com/InseeFrLab/s3-operator/blob/main/controllers/s3/factory/minioS3Client.go)
7
+
- Current S3 providers : [Minio](https://github.com/InseeFrLab/s3-operator/blob/main/internal/s3/factory/minioS3Client.go)
8
8
- Currently managed S3 resources : [buckets](https://github.com/InseeFrLab/s3-operator/blob/main/api/v1alpha1/bucket_types.go), [policies](https://github.com/InseeFrLab/s3-operator/blob/main/api/v1alpha1/policy_types.go)
9
9
10
10
## Compatibility
@@ -21,14 +21,16 @@ At its heart, the operator revolves around CRDs that match S3 resources :
21
21
-`buckets.s3.onyxia.sh`
22
22
-`policies.s3.onyxia.sh`
23
23
-`paths.s3.onyxia.sh`
24
-
-`users.s3.onyxia.sh`
24
+
-`s3Users.s3.onyxia.sh`
25
+
-`s3Instances.s3.onyxia.sh`
25
26
26
27
The custom resources based on these CRDs are a somewhat simplified projection of the real S3 resources. From the operator's point of view :
27
28
28
29
- A `Bucket` CR matches a S3 bucket, and only has a name, a quota (actually two, [see Bucket example in *Usage* section below](#bucket)), and optionally, a set of paths
29
30
- A `Policy` CR matches a "canned" policy (not a bucket policy, but a global one, that can be attached to a user), and has a name, and its actual content (IAM JSON)
30
31
- A `Path` CR matches a set of paths inside of a policy. This is akin to the `paths` property of the `Bucket` CRD, except `Path` is not responsible for Bucket creation.
31
32
- A `S3User` CR matches a user in the s3 server, and has a name, a set of policy and a set of group.
33
+
- A `S3Instance` CR matches a s3Instance.
32
34
33
35
Each custom resource based on these CRDs on Kubernetes is to be matched with a resource on the S3 instance. If the CR and the corresponding S3 resource diverge, the operator will create or update the S3 resource to bring it back to.
34
36
@@ -90,7 +92,7 @@ The parameters are summarized in the table below :
90
92
|`path-deletion`| false | - | no | Trigger path deletion on the S3 backend upon CR deletion. Limited to deleting the `.keep` files used by the operator. |
91
93
|`s3User-deletion`| false | - | no | Trigger S3User deletion on the S3 backend upon CR deletion. |
92
94
|`override-existing-secret`| false | - | no | Update secret linked to s3User if already exist, else noop |
93
-
95
+
|`s3LabelSelector`| "" | - | no | Filter resource that this instance will manage. If Empty all resource in the cluster will be manage |
94
96
## Minimal rights needed to work
95
97
96
98
The Operator need at least this rights:
@@ -147,6 +149,29 @@ The Operator need at least this rights:
147
149
- The same will happen if you modify a CR - the operator will adjust the S3 bucket or policy accordingly - with the notable exception that it will not delete paths for buckets.
148
150
- Upon deleting a CR, the corresponding bucket or policy will be left as is, as mentioned in the [*Description* section above](#description)
149
151
152
+
An instance of S3Operator can manage multiple S3. On each resource created you can set where to create it. To add multiple instance of S3 see S3Instance example. On each object deployed you can attach it to an existing s3Instance. If no instance is set on the resource, S3Operator will failback to default instance configured by env var.
153
+
154
+
### S3Instance example
155
+
156
+
```yaml
157
+
apiVersion: s3.onyxia.sh/v1alpha1
158
+
kind: S3Instance
159
+
metadata:
160
+
labels:
161
+
app.kubernetes.io/name: bucket
162
+
app.kubernetes.io/instance: bucket-sample
163
+
app.kubernetes.io/part-of: s3-operator
164
+
app.kubernetes.io/managed-by: kustomize
165
+
app.kubernetes.io/created-by: s3-operator
166
+
name: s3-default-instance # Name of the S3Instance
167
+
spec:
168
+
s3Provider: minio # Type of the Provider. Can be "mockedS3Provider" or "minio"
169
+
urlEndpoint: minio.example.com # URL of the Provider
170
+
secretName: minio-credentials # Name of the secret containing 2 Keys S3_ACCESS_KEY and S3_SECRET_KEY
171
+
region: us-east-1 # Region of the Provider
172
+
useSSL: true # useSSL to query the Provider
173
+
```
174
+
150
175
### Bucket example
151
176
152
177
```yaml
@@ -182,6 +207,10 @@ spec:
182
207
quota:
183
208
default: 10000000
184
209
# override: 20000000
210
+
211
+
# Optionnal, let empty if you have configured the default s3 else use an existing s3Instance
212
+
s3InstanceRef: "s3-default-instance"
213
+
185
214
186
215
```
187
216
@@ -202,6 +231,9 @@ spec:
202
231
# Policy name (on S3 server, as opposed to the name of the CR)
203
232
name: dummy-policy
204
233
234
+
# Optionnal, let empty if you have configured the default s3 else use an existing s3Instance
235
+
s3InstanceRef: "s3-default-instance"
236
+
205
237
# Content of the policy, as a multiline string
206
238
# This should be IAM compliant JSON - follow the guidelines of the actual
207
239
# S3 provider you're using, as sometimes only a subset is available.
@@ -245,6 +277,8 @@ spec:
245
277
- /home/alice
246
278
- /home/bob
247
279
280
+
# Optionnal, let empty if you have configured the default s3 else use an existing s3Instance
281
+
s3InstanceRef: "s3-default-instance"
248
282
249
283
```
250
284
@@ -266,6 +300,8 @@ spec:
266
300
policies:
267
301
- policy-example1
268
302
- policy-example2
303
+
# Optionnal, let empty if you have configured the default s3 else use an existing s3Instance
0 commit comments