Commit fd7864eb authored by Maarten de Waard's avatar Maarten de Waard 🤘🏻
Browse files

Merge branch '2-create-helm-chart' into 'master'

Resolve "Create helm chart"

Closes #2

See merge request !3
parents 75334931 c10c121f
apiVersion: "v1"
name: "local-storage"
version: "0.1.0"
description: "A local storage provisioner for automatically creating node-local directories."
sources:
- "https://code.greenhost.net/openappstack/local-storage"
maintainers:
- name: "Arie Peterson"
email: "arie@greenhost.nl"
This installs a local storage provisioner to your kubernetes cluster.
**NOTE:** Only use this on single node clusters! On multi-node clusters you will
most probably run into troubles because the storage can not be moved from one
node to the other!
## Requirements
To install:
**NOTE:** Only use this on single-node clusters! On multi-node clusters you
will most probably run into trouble because the storage can not be moved from
one node to the other!
## Configuration
`values.yaml` contains all variables that are considered when installing the
Helm chart.
In particular, you may want to adapt `storageDirectory` to determine where
data are stored.
## Installation
```
$ cd deploy # Enter deploy directory
$ kubectl apply -f rbac.yaml # Creates necessary RBAC rules (if your cluster is rbac-enabled)
$ kubectl apply -f deployment.yaml # Adds the local storage container to your cluster in the kube-system namespace
helm install .
```
Now you can automatically provision local storage volumes by using the
`storageClassName`: `local` in your persistent volume claims.
## Usage
Once this provisioner is installed on your cluster, you can make volumes use it
by using `storageClassName: local` in your persistent volume claims.
Alternatively, you could set this chart's value `defaultStorageClass` to `true`
before installing; then persistent volume claims that do not specify a storage
class are also served.
The local storage provisioner is deployed succesfully.
Data will be stored under {{ .Values.storageDirectory }} on the node itself.
......@@ -18,22 +18,26 @@ spec:
serviceAccountName: local-provisioner
containers:
- name: local-provisioner
image: docker.greenhost.net/openappstack/local-storage/provisioner:develop
imagePullPolicy: "Always"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
volumeMounts:
- mountPath: "/var/lib/OpenAppStack/local-storage"
- mountPath: "{{ .Values.storageDirectory }}"
name: storage-directory
env:
- name: LOCAL_STORAGE_DIR
value: "/var/lib/OpenAppStack/local-storage"
value: "{{ .Values.storageDirectory }}"
volumes:
- name: storage-directory
hostPath:
path: "/var/lib/OpenAppStack/local-storage"
path: "{{ .Values.storageDirectory }}"
---
apiVersion: storage.k8s.io/v1beta1
kind: StorageClass
metadata:
name: local
annotations:
{{- if .Values.defaultStorageClass }}
storageclass.kubernetes.io/is-default-class: "true"
{{- end }}
provisioner: openappstack/local-provisioner
parameters:
# This is the directory on the node under which all data from persistent
# volumes created by this provisioner will be stored.
storageDirectory: "/var/lib/OpenAppStack/local-storage"
image:
repository: "docker.greenhost.net/openappstack/local-storage/provisioner"
tag: "develop"
imagePullPolicy: "Always"
# Make this storage class the default, so persistent volume claims that do not
# specify a class are served by this provisioner.
defaultStorageClass: false
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment