Skip to content

Commit 6bbca96

Browse files
authored
Add documentation for storage API resources (#1213)
* Add document for Storage API resources * address review comments and refactoring
1 parent 4c492f2 commit 6bbca96

File tree

8 files changed

+611
-106
lines changed

8 files changed

+611
-106
lines changed

docs/usage/installation.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,80 @@
1-
# Installing IronCore
1+
# Installing Ironcore
2+
3+
## Requirements
4+
5+
* `go` >= 1.20
6+
* `git`, `make`, and `kubectl`
7+
* [Kustomize](https://kustomize.io/)
8+
* Access to a Kubernetes cluster ([Minikube](https://minikube.sigs.k8s.io/docs/), [kind](https://kind.sigs.k8s.io/) or a real cluster)
9+
10+
## Clone the Repository
11+
12+
To bring up and install the `Ironcore` project, you first need to clone the repository.
13+
14+
``` shell
15+
git clone git@github.com:ironcore-dev/ironcore.git
16+
cd ironcore
17+
```
18+
19+
## Install cert-manager
20+
21+
If there is no [cert-manager](https://cert-manager.io/docs/) present in the cluster it needs to be installed.
22+
23+
``` shell
24+
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.2/cert-manager.yaml
25+
```
26+
27+
## Install APIs into the Cluster
28+
29+
Your Kubernetes API server needs to know about the APIs that come with the `Ironcore` project. To install the APIs into your cluster, run
30+
31+
``` shell
32+
make install
33+
```
34+
35+
**Note**: This requires the `APISERVER_IMG` (Makefile default set to `apiserver`) to be pullable from your Kubernetes
36+
cluster. For local development with `kind`, a make target that builds and loads the API server image and then applies
37+
the manifests is available via
38+
39+
``` shell
40+
make kind-install
41+
```
42+
43+
**Note**: In case multiple environments running, ensure that `kind get clusters` is pointing to the
44+
default kind cluster.
45+
46+
## Deploy the Controller Manager
47+
48+
The controller manager can be started via the following command.
49+
50+
``` shell
51+
make kind-deploy
52+
```
53+
## Validate
54+
55+
Make sure you have all the below pods running.
56+
57+
``` shell
58+
$ kubectl get po -n ironcore-system
59+
NAME READY STATUS RESTARTS AGE
60+
ironcore-apiserver-85995846f9-47247 1/1 Running 0 136m
61+
ironcore-controller-manager-84bf4cc6d5-l224c 2/2 Running 0 136m
62+
ironcore-etcd-0 1/1 Running 0 143m
63+
```
64+
65+
## Apply Sample Manifests
66+
67+
The `config/samples` folder contains samples for all APIs supported by this project. You can apply any of the samples by
68+
running
69+
70+
``` shell
71+
kubectl apply -f config/samples/SOME_RESOURCE.yaml
72+
```
73+
74+
## Cleanup
75+
76+
To remove the APIs from your cluster, simply run.
77+
78+
``` shell
79+
make uninstall
80+
```

docs/usage/storage/bucket.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,47 @@
1-
# Bucket
1+
# Bucket
2+
A `Bucket` in `Ironcore` refers to a storage resource that organizes and manages data, similar to the concept of buckets in cloud storage services like Amazon S3. Buckets are containers for storing objects, such as files or data blobs, and are crucial for managing storage workloads.
3+
4+
# Example Bucket Resource
5+
An example of how to define a `Bucket` resource in `Ironcore`
6+
7+
```
8+
apiVersion: storage.ironcore.dev/v1alpha1
9+
kind: Bucket
10+
metadata:
11+
name: bucket-sample
12+
spec:
13+
bucketClassRef:
14+
name: bucketclass-sample
15+
# bucketPoolRef:
16+
# name: bucketpool-sample
17+
```
18+
19+
# Key Fields:
20+
- `bucketClassRef`(`string`):
21+
- Mandatory field
22+
- `BucketClassRef` is the BucketClass of a bucket
23+
24+
- `bucketPoolRef`(`string`):
25+
- Optional field
26+
-  `bucketPoolRef` indicates which BucketPool to use for the bucket, if not specified the controller itself picks the available bucketPool
27+
28+
29+
# Usage
30+
- **Data Storage**: Use `Buckets` to store and organize data blobs, files, or any object-based data.
31+
32+
- **Multi-Tenant Workloads**: Leverage buckets for isolated and secure data storage in multi-tenant environments by using separate BucketClass or BucketPool references.
33+
34+
- **Secure Access**: Buckets store a reference to the `Secret` securely in their status, and the `Secret` has the access credentials, which applications can retrieve access details from the `Secret`.
35+
36+
# Reconciliation Process:
37+
- The controller detects changes and fetches bucket details.
38+
39+
- Creation/Update ensures the backend bucket exists, metadata is synced, and credentials are updated.
40+
41+
- The bucket will automatically sync with the backend storage system, and update the Bucket's state (e.g., `Available`, `Pending`, or `Error`) in the bucket's status.
42+
43+
- Access details and credentials will be managed securely using Kubernetes `Secret` and the bucket status will track a reference to the `Secret`.
44+
45+
- During deletion, resources will be cleaned up gracefully without manual intervention.
46+
47+
- If the bucket is not ready (e.g., backend issues), reconciliation will retry

docs/usage/storage/bucketclass.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,42 @@
1-
# BucketClass
1+
# BucketClass
2+
A `BucketClass` is a concept used to define and manage different types of storage buckets, typically based on resource capabilities. It is conceptually similar to Kubernetes `StorageClass`, enabling users to specify the desired properties for an Ironcore `Bucket` resource creation.
3+
4+
# Example BucketClass Resource
5+
An example of how to define a `BucketClass` resource in `Ironcore`
6+
7+
```
8+
apiVersion: storage.ironcore.dev/v1alpha1
9+
kind: BucketClass
10+
metadata:
11+
name: bucketclass-sample
12+
capabilities:
13+
tps: 100Mi
14+
iops: 100
15+
```
16+
17+
# Key Fields:
18+
19+
- `capabilities`: Capabilities has `tps` and `iops` fields which need to be specified, it's a mandatory field,
20+
- `tps`(`string`): The `tps` represents transactions per second.
21+
22+
- `iops`(`string`): `iops` is the number of input/output operations a storage device can complete per second.
23+
24+
# Usage
25+
26+
- **BucketClass Definition**: Create a `BucketClass` to set storage properties based on resource capabilities.
27+
28+
- **Associate with buckets**: Link a `BucketClass` to a `Bucket` using a reference in the Bucket resource.
29+
30+
- **Dynamic configuration**: Update the `BucketClass` to modify storage properties for all its Buckets.
31+
32+
# Reconciliation Process:
33+
34+
- **Fetches & Validates**: Retrieves the `BucketClass` from the cluster and checks if it exists.
35+
36+
- **Synchronizes State**: Keeps the `BucketClass` resource updated with its current state and dependencies.
37+
38+
- **Monitors Dependencies**: Watches for changes in dependent Bucket resources and reacts accordingly.
39+
40+
- **Handles Errors**: Requeues the reconciliation to handle errors and ensure successful completion.
41+
42+
- **Handles Deletion**: Cleans up references, removes the finalizer, and ensures no dependent Buckets exist before deletion.

docs/usage/storage/bucketpool.md

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
1-
# BucketPool
1+
# BucketPool
2+
A `BucketPool` is a resource in `Ironcore` that represents a pool of storage buckets managed collectively. It defines the infrastructure's storage configuration used to provision and manage buckets, ensuring resource availability and compatibility with associated BucketClasses.
3+
4+
# Example BucketPool Resource
5+
An example of how to define a `BucketPool` resource in `Ironcore`
6+
7+
```
8+
apiVersion: storage.ironcore.dev/v1alpha1
9+
kind: BucketPool
10+
metadata:
11+
name: bucketpool-sample
12+
spec:
13+
providerID: ironcore://shared
14+
#status:
15+
# state: Available
16+
# availableBucketClasses:
17+
# ironcore.dev/fast-class: 10Gi
18+
# ironcore.dev/slow-class: 100Gi
19+
```
20+
21+
# Key Fields:
22+
- `ProviderID`(`string`): The `providerId` helps the controller identify and communicate with the correct storage system within the specific backened storage porvider.
23+
24+
for example `ironcore://shared`
25+
26+
# Reconciliation Process:
27+
28+
- **Bucket Type Discovery**: It constantly checks what kinds of buckets (BucketClasses) are available in the `Ironcore` Infrastructure.
29+
30+
- **Compatibility Check**: Evaluating whether the BucketPool can create and manage each bucket type based on its capabilities.
31+
32+
- **Status Update**: Updating the BucketPool's status to indicate the bucket types it supports, like a menu of available options.
33+
34+
- **Event Handling**: Watches for changes in BucketClass resources and ensures the associated BucketPool is reconciled when relevant changes occur.

docs/usage/storage/volume.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,44 @@
1-
# Volume
1+
# Volume
2+
The `Ironcore` `Volume` is a storage abstraction provided by the `Ironcore Runtime Interface` `(IRI)` service, designed to integrate with external storage backend for managing persistent storage. It acts as a managed storage unit, ensuring consistency, scalability, and compatibility with Kubernetes workloads.
3+
By integrating Ironcore Volumes with Kubernetes, users benefit from seamless storage management, automation, and advanced features such as encryption and scalability, making it suitable for modern cloud-native and hybrid applications.
4+
5+
# Example Volume Resource
6+
An example of how to define a `Volume` resource in `Ironcore`
7+
8+
```
9+
apiVersion: storage.ironcore.dev/v1alpha1
10+
kind: Volume
11+
metadata:
12+
name: volume-sample
13+
spec:
14+
volumeClassRef:
15+
name: volumeclass-sample
16+
# volumePoolRef:
17+
# name: volumepool-sample
18+
resources:
19+
storage: 100Gi
20+
```
21+
22+
# Key Fields:
23+
24+
- `volumeClassRef`(`string`): `volumeClassRef` refers to the name of an Ironcore `volumeClass`( for eg: `slow`, `fast`, `super-fast` etc.) to create a volume,
25+
26+
- `volumePoolRef` (`string`): `VolumePoolRef` indicates which VolumePool to use for a volume. If unset, the scheduler will figure out a suitable `VolumePoolRef`.
27+
28+
- `resources`: `Resources` is a description of the volume's resources and capacity.
29+
30+
# Reconciliation Process:
31+
32+
- **Fetch Volume Resource**: Retrieve the `Volume` resource and clean up any orphaned `IRI` volumes if the resource is missing.
33+
34+
- **Add Finalizer**: Ensure a finalizer is added to manage cleanup during deletion.
35+
36+
- **Check IRI Volumes**: List and identify `IRI` volumes linked to the `Volume` resource.
37+
38+
- **Create or Update Volume**:
39+
- Create a new IRI volume if none exists.
40+
- Update existing IRI volumes if attributes like size or encryption need adjustments.
41+
42+
- **Sync Status**: Reflect the IRI volume's state (e.g., Pending, Available) in the Kubernetes Volume resource's status.
43+
44+
- **Handle Deletion**: Safely delete all associated IRI volumes and remove the finalizer to complete the resource lifecycle.

docs/usage/storage/volumeclass.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,41 @@
1-
# VolumeClass
1+
# VolumeClass
2+
The `VolumeClass` in `Ironcore` is a Kubernetes-like abstraction that defines a set of parameters or configurations for provisioning storage resources through the `Ironcore Runtime Interface (IRI)`. It is conceptually similar to Kubernetes `StorageClass`, enabling users to specify the desired properties for an Ironcore `Volume` resource creation.
3+
4+
# Example VolumeClass Resource
5+
An example of how to define a `VolumeClass` resource in `Ironcore`
6+
7+
```
8+
apiVersion: storage.ironcore.dev/v1alpha1
9+
kind: VolumeClass
10+
metadata:
11+
name: volumeclass-sample
12+
capabilities:
13+
tps: 100Mi
14+
iops: 100
15+
```
16+
17+
# Key Fields:
18+
- `capabilities`: Capabilities has tps and iops fields that need to be specified, it's a mandatory field,
19+
- `tps`(`string`): The `tps` represents transactions per second.
20+
21+
- `iops`(`string`): `iops` is the number of input/output operations a storage device can complete per second.
22+
23+
# Usage
24+
25+
- **VolumeClass Definition**: Create a `VolumeClass` to set storage properties based on resource capabilities.
26+
27+
- **Associate with Volume**: Link a `VolumeClass` to a `Volume` using a reference in the Volume resource.
28+
29+
- **Dynamic configuration**: Update the `VolumeClass` to modify storage properties for all its Volumes.
30+
31+
# Reconciliation Process:
32+
33+
- **Fetches & Validates**: Retrieves the VolumeClass from the cluster and checks if it exists.
34+
35+
- **Synchronizes State**: Keeps the VolumeClass resource updated with its current state and dependencies.
36+
37+
- **Monitors Dependencies**: Watches for changes in dependent Volume resources and reacts accordingly.
38+
39+
- **Handles Errors**: Requeues the reconciliation to handle errors and ensure successful completion.
40+
41+
- **Handles Deletion**: Cleans up references, removes the finalizer, and ensures no dependent Volumes exist before deletion.

docs/usage/storage/volumepool.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
11
# VolumePool
2+
A `VolumePool` is a resource in `Ironcore` that represents a pool of storage volume managed collectively. It defines the infrastructure's storage configuration used to provision and manage volumes, ensuring resource availability and compatibility with associated `VolumeClasses`.
3+
4+
# Example VolumePool Resource
5+
An example of how to define a `VolumePool` resource in `Ironcore`
6+
7+
```
8+
apiVersion: storage.ironcore.dev/v1alpha1
9+
kind: VolumePool
10+
metadata:
11+
name: volumepool-sample
12+
spec:
13+
providerID: ironcore://shared
14+
#status:
15+
# state: Available
16+
# availableVolumeClasses:
17+
# ironcore.dev/fast-class: 10Gi
18+
# ironcore.dev/slow-class: 100Gi
19+
```
20+
21+
# Key Fields:
22+
- `providerID`(`string`): The `providerId` helps the controller identify and communicate with the correct storage system within the specific backened storage porvider.
23+
24+
for example `ironcore://shared`
25+
26+
# Reconciliation Process:
27+
28+
- **Volume Type Discovery**: It constantly checks what kinds of volumes (volumeClasses) are available in the `Ironcore` Infrastructure.
29+
30+
- **Compatibility Check**: Evaluating whether the volumePool can create and manage each volume type based on its capabilities.
31+
32+
- **Status Update**: Updating the VolumePool's status to indicate the volume types it supports, like a menu of available options.
33+
34+
- **Event Handling**: Watches for changes in VolumeClass resources and ensures the associated VolumePool is reconciled when relevant changes occur.

0 commit comments

Comments
 (0)