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
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
At its heart, the operator revolves around CRDs that match S3 resources :
20
20
21
21
-`buckets.s3.onyxia.sh`
22
22
-`policies.s3.onyxia.sh`
23
+
-`paths.s3.onyxia.sh`
23
24
24
25
The custom resources based on these CRDs are a somewhat simplified projection of the real S3 resources. From the operator's point of view :
25
26
26
27
- 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
27
28
- 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
+
- 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.
28
30
29
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 .
30
32
31
33
Two important caveats :
32
34
33
-
- It is one-way - if something happens on the S3 side directly (instead of going through the CRs), the operator ha s no way of reacting. At best, the next trigger will overwrite the S3 state with the declared state in the k8s custom resource.
35
+
- It is one-way - if something happens on the S3 side directly (instead of going through the CRs), the operator has no way of reacting. At best, the next trigger will overwrite the S3 state with the declared state in the k8s custom resource.
34
36
- For now, the operator won't delete any resource on S3 - if a CR is removed, its matching resource on S3 will still be present. This behavior was primarily picked to avoid data loss for bucket, but also applied to policies.
35
37
36
38
## Installation
@@ -48,15 +50,15 @@ helm install <name> s3-operator --values <yaml-file/url> # see below for the pa
48
50
49
51
### Running from source
50
52
51
-
Alternatively, if you just wish to try out the operator without actually, it is also possible to just clone this repository, and run the operator locally - outside of the Kubernetes cluster. This requires Go 1.19+ :
53
+
Alternatively, if you just wish to try out the operator without actually installing it, it is also possible to just clone this repository, and run the operator locally - outside of the Kubernetes cluster. This requires Go 1.19+, and prior installation of the CRDs located in `config/crd/bases`, typically with `kubectl`. After which, you can simply run :
52
54
53
55
```shell
54
56
git clone https://github.com/InseeFrLab/s3-operator.git # or use a tag/release
55
57
cd s3-operator
56
58
go run main.go --s3-endpoint-url *** --s3-access-key *** --s3-secret-key ***# see below for the parameters
57
59
```
58
60
59
-
To quote the Operator SDK README (also visible below), running the operator this way *will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).* RBAC-wise, you need to be able to freely manipulate the custom resources associated to the operator (`Bucket`and `Policy`) in every namespace - [see also the generated ClusterRole manifest](https://github.com/InseeFrLab/s3-operator/blob/main/config/rbac/role.yaml).
61
+
To quote the Operator SDK README (also visible below), running the operator this way *will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).* RBAC-wise, you need to be able to freely manipulate the custom resources associated to the operator (`Bucket`, `Policy`and `Path`) in every namespace - [see also the generated ClusterRole manifest](https://github.com/InseeFrLab/s3-operator/blob/main/config/rbac/role.yaml).
60
62
61
63
### Kustomize
62
64
@@ -165,7 +167,30 @@ spec:
165
167
}
166
168
]
167
169
}
170
+
```
171
+
172
+
### Path example
173
+
174
+
```yaml
175
+
apiVersion: s3.onyxia.sh/v1alpha1
176
+
kind: Path
177
+
metadata:
178
+
labels:
179
+
app.kubernetes.io/name: path
180
+
app.kubernetes.io/instance: path-sample
181
+
app.kubernetes.io/part-of: s3-operator
182
+
app.kubernetes.io/managed-by: kustomize
183
+
app.kubernetes.io/created-by: s3-operator
184
+
name: path-sample
185
+
spec:
186
+
# Bucket name (on S3 server, not a Bucket CR's metadata.name)
0 commit comments