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
+77-1Lines changed: 77 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -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
25
25
26
The custom resources based on these CRDs are a somewhat simplified projection of the real S3 resources. From the operator's point of view :
26
27
27
28
- 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
28
29
- 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)
29
30
- 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
+
- A `S3User` CR matches a user in the s3 server, and has a name, a set of policy and a set of group.
30
32
31
-
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.
33
+
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.
32
34
33
35
Two important caveats :
34
36
@@ -86,7 +88,56 @@ The parameters are summarized in the table below :
86
88
|`bucket-deletion`| false | - | no | Trigger bucket deletion on the S3 backend upon CR deletion. Will fail if bucket is not empty. |
87
89
|`policy-deletion`| false | - | no | Trigger policy deletion on the S3 backend upon CR deletion |
88
90
|`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
+
|`s3User-deletion`| false | - | no | Trigger S3User deletion on the S3 backend upon CR deletion. |
92
+
|`override-existing-secret`| false | - | no | Update secret linked to s3User if already exist, else noop |
93
+
94
+
## Minimal rights needed to work
95
+
96
+
The Operator need at least this rights:
97
+
98
+
```json
99
+
{
100
+
"Version": "2012-10-17",
101
+
"Statement": [
102
+
{
103
+
"Effect": "Allow",
104
+
"Action": [
105
+
"s3:CreateBucket",
106
+
"s3:GetObject",
107
+
"s3:ListAllMyBuckets",
108
+
"s3:ListBucket",
109
+
"s3:PutObject"
110
+
],
111
+
"Resource": [
112
+
"arn:aws:s3:::*"
113
+
]
114
+
},
115
+
{
116
+
"Effect": "Allow",
117
+
"Action": [
118
+
"admin:CreatePolicy",
119
+
"admin:GetBucketQuota",
120
+
"admin:GetPolicy",
121
+
"admin:ListPolicy",
122
+
"admin:SetBucketQuota",
123
+
"admin:CreateUser",
124
+
"admin:ListUsers",
125
+
"admin:DeleteUser",
126
+
"admin:GetUser",
127
+
"admin:AddUserToGroup",
128
+
"admin:RemoveUserFromGroup",
129
+
"admin:AttachUserOrGroupPolicy",
130
+
"admin:ListUserPolicies"
131
+
132
+
],
133
+
"Resource": [
134
+
"arn:aws:s3:::*"
135
+
]
136
+
}
137
+
]
138
+
}
89
139
140
+
```
90
141
91
142
## Usage
92
143
@@ -197,6 +248,29 @@ spec:
197
248
198
249
```
199
250
251
+
### S3User example
252
+
253
+
```yaml
254
+
apiVersion: s3.onyxia.sh/v1alpha1
255
+
kind: S3User
256
+
metadata:
257
+
labels:
258
+
app.kubernetes.io/name: user
259
+
app.kubernetes.io/instance: user-sample
260
+
app.kubernetes.io/part-of: s3-operator
261
+
app.kubernetes.io/managed-by: kustomize
262
+
app.kubernetes.io/created-by: s3-operator
263
+
name: user-sample
264
+
spec:
265
+
accessKey: user-sample
266
+
policies:
267
+
- policy-example1
268
+
- policy-example2
269
+
270
+
```
271
+
272
+
Each S3user is linked to a kubernetes secret which have the same name that the S3User. The secret contains 2 keys: `accessKey` and `secretKey`.
273
+
200
274
## Operator SDK generated guidelines
201
275
202
276
<details>
@@ -276,3 +350,5 @@ make manifests
276
350
More information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html)
0 commit comments