Skip to content

Commit

Permalink
examples: update k8s deployment
Browse files Browse the repository at this point in the history
* Reuse the resource we already configure for the Operator
* Update instructions on how to use these deployments
* Small fixes to the readme

Signed-off-by: Moritz Wanzenböck <[email protected]>
  • Loading branch information
WanzenBug committed Aug 7, 2024
1 parent 912b9bb commit 358d733
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 1,890 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,24 @@ that implement CSI, such as Kubernetes.

# Building

If you wish to create a docker image for a local registry
run `make staticrelease`.
If you wish to create a docker image for a local registry run `make upload REGISTRY=local.example.com`.

# Deployment

If you are looking to deploy a full LINSTOR setup with LINSTOR controller and satellites,
take a look at [our operator](https://github.com/piraeusdatastore/piraeus-operator).

This project _ONLY_ deploys the CSI components, a working LINSTOR cluster is required.
Use our example deployment in `examples/k8s/deploy` as base to deploy only the LINSTOR CSI
components. You will need to update every occurence of `LINSTOR_CONTROLLER_URL` with the actual
URL of your LINSTOR Controller, for example like this:

## Kubernetes

The yaml file in `examples/k8s/deploy` shows an example configuration which
will deploy the LINSTOR csi plugin along with the needed k8s sidecar containers.
You will need to change all instances of `LINSTOR_IP` to point to the controller(s)
of the LINSTOR cluster that you wish this plugin to interact with.

You will need to enable the following feature gates on both the kube-apiserver
and all kubelets for this plugin to be operational: `CSINodeInfo=true`,
`CSIDriverRegistry=true,VolumeSnapshotDataSource=true`. Please ensure that your
version of Kubernetes is recent enough to enable these gates.
```
$ LINSTOR_CONTROLLER_URL=http://linstor-controller.example.com:3370
$ kubectl kustomize http://github.com/piraeusdatastore/linstor-csi/examples/k8s/deploy \
| sed "s#LINSTOR_CONTROLLER_URL#$LINSTOR_CONTROLLER_URL#" \
| kubectl apply --server-side -f -
```

# Usage

Expand Down
18 changes: 18 additions & 0 deletions examples/k8s/deploy/controller-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: linstor-csi-controller
spec:
template:
spec:
initContainers:
- name: linstor-wait-api-online
env:
- name: LS_CONTROLLERS
value: LINSTOR_CONTROLLER_URL
containers:
- name: linstor-csi
env:
- name: LS_CONTROLLERS
value: LINSTOR_CONTROLLER_URL
18 changes: 18 additions & 0 deletions examples/k8s/deploy/daemonset-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: linstor-csi-node
spec:
template:
spec:
initContainers:
- name: linstor-wait-node-online
env:
- name: LS_CONTROLLERS
value: LINSTOR_CONTROLLER_URL
containers:
- name: linstor-csi
env:
- name: LS_CONTROLLERS
value: LINSTOR_CONTROLLER_URL
35 changes: 35 additions & 0 deletions examples/k8s/deploy/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
namespace: piraeus-datastore
resources:
- namespace.yaml
- https://github.com/piraeusdatastore/piraeus-operator//pkg/resources/cluster/csi-controller?ref=v2.5.2
- https://github.com/piraeusdatastore/piraeus-operator//pkg/resources/cluster/csi-node?ref=v2.5.2
images:
- name: csi-attacher
newName: registry.k8s.io/sig-storage/csi-attacher
newTag: v4.6.1
- name: csi-external-health-monitor-controller
newName: registry.k8s.io/sig-storage/csi-external-health-monitor-controller
newTag: v0.12.1
- name: csi-livenessprobe
newName: registry.k8s.io/sig-storage/livenessprobe
newTag: v2.13.1
- name: csi-node-driver-registrar
newName: registry.k8s.io/sig-storage/csi-node-driver-registrar
newTag: v2.11.1
- name: csi-provisioner
newName: registry.k8s.io/sig-storage/csi-provisioner
newTag: v5.0.1
- name: csi-resizer
newName: registry.k8s.io/sig-storage/csi-resizer
newTag: v1.11.1
- name: csi-snapshotter
newName: registry.k8s.io/sig-storage/csi-snapshotter
newTag: v8.0.1
- name: linstor-csi
newName: quay.io/piraeusdatastore/piraeus-csi
newTag: v1.6.3
patches:
- path: controller-patch.yaml
- path: daemonset-patch.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
Loading

0 comments on commit 358d733

Please sign in to comment.