Skip to content

Commit

Permalink
Add helm howto document (#77)
Browse files Browse the repository at this point in the history
* add helm howto
  • Loading branch information
chnliyong authored Feb 7, 2021
1 parent 761da61 commit 3a198da
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
31 changes: 22 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,41 @@ To install Helm, refer to the [Helm install guide](https://github.com/helm/helm#


### Using Helm To Deploy

1. edit your self backend by copy `values.yaml`
```bash
cp deploy/chart/values.yaml ./self-values.yaml
1. Prepare a `values.yaml` file with access infomation about redis and object storage
```yaml
storageClasses:
- name: juicefs-sc
enabled: true
reclaimPolicy: Delete
backend:
name: "<name>"
metaurl: "<redis-url>"
storage: "<storage-type>"
accessKey: "<access-key>"
secretKey: "<secret-key>"
bucket: "<bucket>"
```
2. edit backend part

3. deploy
```shell
helm install -f self-values.yaml juicefs-csi ./deploy/chart
2. Install
```sh
helm repo add juicefs-csi-driver https://juicedata.github.io/juicefs-csi-driver/
helm repo update
helm upgrade juicefs-csi-driver juicefs-csi-driver/juicefs-csi-driver --install -f ./values.yaml
```

3. After above steps, _juicefs-sc_ storage class is created

### Upgrade CSI Driver

1. Stop all pods using this driver.
2. Upgrade driver:
* If you're using `latest` tag, simple run `kubectl rollout restart -f k8s.yaml` and make sure juicefs-csi-controller and juicefs-csi-node pods are restarted.
* If you have pinned to a specific version, modify your k8s.yaml to a newer version, then run `kubectl apply -f k8s.yaml`.
Alternatively, if _juicefs-csi-driver_ is installed using helm, we can also use helm to upgrade it.

Visit [here](https://hub.docker.com/r/juicedata/juicefs-csi-driver) for more versions.


## Examples

Before the example, you need to:
Expand Down
16 changes: 12 additions & 4 deletions charts/juicefs-csi-driver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

A Helm chart for JuiceFS CSI Driver

**Homepage:** <https://github.com/juicedata/juicefs-csi-driver>

## Source Code

* <https://github.com/juicedata/juicefs-csi-driver>

## Requirements

Kubernetes: `>=1.14.0-0`

## Values

| Key | Type | Default | Description |
Expand Down Expand Up @@ -50,11 +60,9 @@ A Helm chart for JuiceFS CSI Driver
| storageClasses[0].backend.name | string | `"juice"` | The JuiceFS file system name. |
| storageClasses[0].backend.secretKey | string | `""` | Secret key for object storage |
| storageClasses[0].backend.storage | string | `""` | Object storage type, such as `s3`, `gs`, `oss`. Read [this document](https://github.com/juicedata/juicefs/blob/main/docs/en/how_to_setup_object_storage.md) for the full supported list. |
| storageClasses[0].enabled | bool | `true` | Default is true will create a new StorageClass. It will create Secret and StorageClass used by CSI driver when set false, existingStorageClass should be set. |
| storageClasses[0].enabled | bool | `true` | Default is true will create a new StorageClass. It will create Secret and StorageClass used by CSI driver |
| storageClasses[0].name | string | `"juicefs-sc"` | |
| storageClasses[0].provisioner | string | `"csi.juicefs.com"` | |
| storageClasses[0].reclaimPolicy | string | `"Delete"` | |
| storageClasses[0].volumeBindingMode | string | `"Immediate"` | |
| storageClasses[0].reclaimPolicy | string | `"Delete"` | Either Delete or Retain. |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.4.0](https://github.com/norwoodj/helm-docs/releases/v1.4.0)
4 changes: 2 additions & 2 deletions charts/juicefs-csi-driver/templates/storageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ parameters:
csi.storage.k8s.io/node-publish-secret-namespace: kube-system
csi.storage.k8s.io/provisioner-secret-name: {{ $sc.name }}-secret
csi.storage.k8s.io/provisioner-secret-namespace: kube-system
provisioner: {{ $sc.provisioner }}
provisioner: csi.juicefs.com
reclaimPolicy: {{ $sc.reclaimPolicy }}
volumeBindingMode: {{ $sc.volumeBindingMode }}
volumeBindingMode: Immediate
{{- end }}
---

Expand Down
11 changes: 1 addition & 10 deletions charts/juicefs-csi-driver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,9 @@ storageClasses:
# StorageClass Name. It is important.
- name: juicefs-sc
# -- Default is true will create a new StorageClass. It will create Secret and StorageClass used by CSI driver
# when set false, existingStorageClass should be set.
enabled: true
# Default will create StorageClass, If use self create or exist, set this value.
# existingStorageClass: null
# StorageClass will read a secret. Set this value if you want use exist
# existingSecret: null
# Determines what volume plugin is used for provisioning PVs
provisioner: csi.juicefs.com
# which can be either Delete or Retain. If no reclaimPolicy is specified when a StorageClass object is created, it will default to Delete.
# -- Either Delete or Retain.
reclaimPolicy: Delete
# The volumeBindingMode field controls when volume binding and dynamic provisioning should occur.
volumeBindingMode: Immediate

backend:
# -- The JuiceFS file system name.
Expand Down

0 comments on commit 3a198da

Please sign in to comment.