From 6e396ff6637069d4dff62468c72bee454bc07bee Mon Sep 17 00:00:00 2001 From: Illyoung Choi Date: Thu, 31 Oct 2024 13:42:57 -0700 Subject: [PATCH] update docs --- docs/install.md | 101 ++++++++++ docs/irodsfs_static_volume_provisioning.md | 190 ++++++++++++++++++ .../irodsfuse/app.yaml | 12 +- .../irodsfuse/pv.yaml | 26 +-- .../irodsfuse/pvc.yaml | 8 +- .../irodsfuse/{storageclass.yaml => sc.yaml} | 2 +- .../irodsfuse_pathmappings/app.yaml | 10 +- .../irodsfuse_pathmappings/pv.yaml | 25 +-- .../irodsfuse_pathmappings/pvc.yaml | 8 +- .../{storageclass.yaml => sc.yaml} | 2 +- .../irodsfuse_secrets/app.yaml | 12 +- .../irodsfuse_secrets/pv.yaml | 28 +-- .../irodsfuse_secrets/pvc.yaml | 8 +- .../{storageclass.yaml => sc.yaml} | 2 +- .../irodsfuse_secrets/secret.yaml | 6 +- .../static_volume_provisioning/nfs/app.yaml | 12 +- .../static_volume_provisioning/nfs/pv.yaml | 18 +- .../static_volume_provisioning/nfs/pvc.yaml | 8 +- .../nfs/{storageclass.yaml => sc.yaml} | 2 +- .../webdav/app.yaml | 12 +- .../static_volume_provisioning/webdav/pv.yaml | 20 +- .../webdav/pvc.yaml | 8 +- .../static_volume_provisioning/webdav/sc.yaml | 5 + .../webdav/storageclass.yaml | 5 - pkg/client/irods/connection_info.go | 4 +- pkg/client/irods/operations.go | 4 +- 26 files changed, 415 insertions(+), 123 deletions(-) create mode 100644 docs/install.md create mode 100644 docs/irodsfs_static_volume_provisioning.md rename examples/kubernetes/static_volume_provisioning/irodsfuse/{storageclass.yaml => sc.yaml} (71%) rename examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/{storageclass.yaml => sc.yaml} (71%) rename examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/{storageclass.yaml => sc.yaml} (71%) rename examples/kubernetes/static_volume_provisioning/nfs/{storageclass.yaml => sc.yaml} (71%) create mode 100644 examples/kubernetes/static_volume_provisioning/webdav/sc.yaml delete mode 100644 examples/kubernetes/static_volume_provisioning/webdav/storageclass.yaml diff --git a/docs/install.md b/docs/install.md new file mode 100644 index 0000000..c3cde9c --- /dev/null +++ b/docs/install.md @@ -0,0 +1,101 @@ +# Install iRODS CSI Driver using Helm + +You will need [Helm](https://helm.sh/docs/helm/helm_install/) to install `iRODS CSI Driver`. + +## Add Helm Chart Repository to Helm + +Run following command to add `iRODS CSI Driver Helm Chart Repository`. +```shell script +helm repo add irods-csi-driver-repo https://cyverse.github.io/irods-csi-driver-helm/ +helm repo update +``` + +Verify if the repository is added successfully. +```shell script +helm search repo irods +``` + +## Install iRODS CSI Driver + +Install `iRODS CSI Driver` with default configurations. +The command below will install `irods-csi-driver-repo/irods-csi-driver` chart and the installed driver will be named `irods-csi-driver`. The driver pods will be created in `irods-csi-driver` namespace. + +```shell script +helm install --create-namespace -n irods-csi-driver irods-csi-driver irods-csi-driver-repo/irods-csi-driver +``` + +Check pods of `iRODS CSI Driver`. + +```shell script +kubectl get pods -n irods-csi-driver +``` + +The command will display following output. +``` +NAME READY STATUS RESTARTS AGE +irods-csi-driver-controller-6c7bb75479-d7z4p 2/2 Running 0 35m +irods-csi-driver-controller-6c7bb75479-nk6cd 2/2 Running 0 35m +irods-csi-driver-node-zbnkp 4/4 Running 0 35m +``` + +By default, `iRODS CSI Driver` will create: +- two `irods-csi-driver-controller` pods in a cluster +- one `irods-csi-driver-node` pod per cluster node + +## Advanced configuration + +### Cache Configuration + +`iRODS FUSE Lite Pool Server` is built-in `iRODS CSI Driver` to provide connection pooling and data caching. The server runs in `irods-csi-driver-node` pod. + +To configure cache-related settings, create a YAML file that adds `nodeService/irodsPool/extraArgs`. + +For example, the following sets `cache timeout` for paths, increase `max cache size`, and set `data root path` for storing cache and log. + +```yaml +nodeService: + irodsPool: + extraArgs: + - '--cache_timeout_settings=[{"path":"/","timeout":"-1ns","inherit":false},{"path":"/cyverse","timeout":"-1ns","inherit":false},{"path":"/cyverse/home","timeout":"1h","inherit":false},{"path":"/cyverse/home/shared","timeout":"1h","inherit":true}]' + - --cache_size_max=10737418240 + - --data_root=/irodsfs-pool +``` + +Then, provide the YAML file when installing `iRODS CSI Driver` using Helm. + +```shell script +helm install --create-namespace -n irods-csi-driver irods-csi-driver irods-csi-driver-repo/irods-csi-driver -f ./pool_config.yaml +``` + +### Volume Configuration + +To configure default volume settings, create a YAML file that adds `globalConfig/secret/stringData`. + +For example, the following sets default `client`, `host`, `port`, `zone`, `user`, `password` for iRODS access. + +Set `retainData` to `false` to delete the volume directory in iRODS after use (only for dynamic volume provisioning mode). +Set `enforceProxyAccess` to `true` for only allowing proxy access to iRODS. +Set `mountPathWhitelist` to allow mounting certain iRODS paths. + +```yaml +globalConfig: + secret: + stringData: + client: "irodsfuse" + host: "bishop.cyverse.org" + port: "1247" + zone: "cyverse" + user: "de-irods" + retainData: "false" + password: "real-password-here" + enforceProxyAccess: "true" + mountPathWhitelist: "/cyverse/home" +``` + +Then, provide the YAML file when installing `iRODS CSI Driver` using Helm. + +```shell script +helm install --create-namespace -n irods-csi-driver irods-csi-driver irods-csi-driver-repo/irods-csi-driver -f ./volume_config.yaml +``` + + diff --git a/docs/irodsfs_static_volume_provisioning.md b/docs/irodsfs_static_volume_provisioning.md new file mode 100644 index 0000000..98ec7d5 --- /dev/null +++ b/docs/irodsfs_static_volume_provisioning.md @@ -0,0 +1,190 @@ +# Create a Persistent Volume using iRODS CSI Driver + +This document shows how to create a `Persistent Volume (PV)` using `static volume provisioning` in `iRODS CSI Driver`. + +## Create a Storage Class (SC) + +Define a `Storage Class` with following YAML file (`sc.yaml`). + +```yaml +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: irods-sc # the name of the SC +provisioner: irods.csi.cyverse.org +``` + +Create a Kubernetes object. + +```shell script +kubectl apply -f sc.yaml +``` + +Check if the `Storage Class` is created successfully. + +```shell script +kubectl get sc +``` + +The command will display following output. + +``` +NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE +irods-sc irods.csi.cyverse.org Delete Immediate false 5s +local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 7h +``` + +## Create a Secret + +Define a `Secret` that stores access information with following YAML file (`secret.yaml`). + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: my-secret # the name of the secret +type: Opaque +stringData: + user: "my_username" # iRODS username + password: "my_password" # iRODS password +``` + +Create a Kubernetes object. + +```shell script +kubectl apply -f secret.yaml +``` + +Check if the `Secret` is created successfully. + +```shell script +kubectl get secret +``` + +The command will display following output. + +``` +NAME TYPE DATA AGE +my-secret Opaque 2 40s +``` + +## Create a Persistent Volume (PV) + +Define a `Persistent Volume` with following YAML file (`pv.yaml`). + +```yaml +apiVersion: v1 +kind: PersistentVolume +metadata: + name: my-pv # the name of the pv + labels: + vol-name: my-pv # same as the name +spec: + capacity: + storage: 5Gi # this is required but not meaningful (ignored by csi driver) + volumeMode: Filesystem + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: Retain + storageClassName: irods-sc # the name of Storage Class + csi: + driver: irods.csi.cyverse.org # the name of iRODS CSI driver + volumeHandle: my-vol-id # unique volume ID + volumeAttributes: + client: "irodsfuse" # iRODS client + host: "data.cyverse.org" # iRODS host + port: "1247" # iRODS port + zone: "iplant" # iRODS zone name + path: "/iplant/home/my_username" # iRODS path to mount + nodeStageSecretRef: + name: "my-secret" # the name of the secret (read user and password from the secret) + namespace: "default" +``` + +Create a Kubernetes object. + +```shell script +kubectl apply -f pv.yaml +``` + +Check if the `Persistent Volume` is created successfully. + +```shell script +kubectl get pv +``` + +The command will display following output. + +``` +NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS VOLUMEATTRIBUTESCLASS REASON AGE +my-pv 5Gi RWX Retain Available irods-sc 5s +``` + +## Create a Persistent Volume Claim (PVC) + +Define a `Persistent Volume Claim` with following YAML file (`pvc.yaml`). + +```yaml +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: my-pvc # the name of the pvc +spec: + accessModes: + - ReadWriteMany + storageClassName: irods-sc # the name of Storage Class + selector: + matchLabels: + vol-name: my-pv # the name of the pv + resources: + requests: + storage: 5Gi # this is required but not meaningful (must match to PV's storage capacity) +``` + +Create a Kubernetes object. + +```shell script +kubectl apply -f pvc.yaml +``` + +Check if the `Persistent Volume Claim` is created successfully. + +```shell script +kubectl get pvc +``` + +The command will display following output. + +``` +NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE +my-pvc Bound my-pv 5Gi RWX irods-sc 12s +``` + +## Use it in Apps + +Mount the iRODS volume using the `Persistent Volume Claim` created above. + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: my-app # the name of the app +spec: + containers: + - name: app + image: busybox + command: ["/bin/sh"] + args: ["-c", "echo Hello Kubernetes! $(date -u) >> /data/irods_csi_driver_out.txt"] + volumeMounts: + - name: persistent-storage # the name of the volume + mountPath: /data # mount point + restartPolicy: Never + volumes: + - name: persistent-storage # the name of the volume + persistentVolumeClaim: + claimName: my-pvc # the name of the PVC +``` + +The example app will create a file `irods_csi_driver_out.txt` at `/data` directory in the pod. +Because the `/data` directory is a mount point where `iRODS CSI Driver` mounts the iRODS path `/iplant/home/my_username` on. +So this will create the file `/iplant/home/my_username/irods_csi_driver_out.txt`. \ No newline at end of file diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse/app.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse/app.yaml index 47fddf7..27c6b2f 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse/app.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse/app.yaml @@ -1,18 +1,18 @@ apiVersion: v1 kind: Pod metadata: - name: irods-irodsfuse-app + name: my-app # the name of the app spec: containers: - name: app image: busybox command: ["/bin/sh"] - args: ["-c", "echo Hello Kubernetes! $(date -u) >> /data/kubernetes_irodsfuse_out.txt"] + args: ["-c", "echo Hello Kubernetes! $(date -u) >> /data/irods_csi_driver_out.txt"] volumeMounts: - - name: persistent-storage - mountPath: /data + - name: persistent-storage # the name of the volume + mountPath: /data # mount point restartPolicy: Never volumes: - - name: persistent-storage + - name: persistent-storage # the name of the volume persistentVolumeClaim: - claimName: irods-irodsfuse-pvc + claimName: my-pvc # the name of the PVC diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse/pv.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse/pv.yaml index 8210de9..7f61822 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse/pv.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse/pv.yaml @@ -1,25 +1,25 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: irods-irodsfuse-pv + name: my-pv # the name of the pv labels: - vol-name: irods-irodsfuse-pv + vol-name: my-pv # same as the name spec: capacity: - storage: 5Gi + storage: 5Gi # this is required but not meaningful (ignored by csi driver) volumeMode: Filesystem accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain - storageClassName: irods-sc + storageClassName: irods-sc # the name of Storage Class csi: - driver: irods.csi.cyverse.org - volumeHandle: irods-irodsfuse-vol-id + driver: irods.csi.cyverse.org # the name of iRODS CSI driver + volumeHandle: my-vol-id # unique volume ID volumeAttributes: - client: "irodsfuse" - host: "data.cyverse.org" - port: "1247" - zone: "iplant" - user: "iychoi" - password: "yourpassword" - path: "/iplant/home/iychoi" + client: "irodsfuse" # iRODS client + host: "data.cyverse.org" # iRODS host + port: "1247" # iRODS port + zone: "iplant" # iRODS zone name + path: "/iplant/home/my_username" # iRODS path to mount + user: "my_username" # iRODS username + password: "my_password" # iRODS password diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse/pvc.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse/pvc.yaml index f753720..09a9260 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse/pvc.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse/pvc.yaml @@ -1,14 +1,14 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: irods-irodsfuse-pvc + name: my-pvc # the name of the pvc spec: accessModes: - ReadWriteMany - storageClassName: irods-sc + storageClassName: irods-sc # the name of Storage Class selector: matchLabels: - vol-name: irods-irodsfuse-pv + vol-name: my-pv # the name of the pv resources: requests: - storage: 5Gi + storage: 5Gi # this is required but not meaningful (must match to PV's storage capacity) diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse/storageclass.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse/sc.yaml similarity index 71% rename from examples/kubernetes/static_volume_provisioning/irodsfuse/storageclass.yaml rename to examples/kubernetes/static_volume_provisioning/irodsfuse/sc.yaml index ad2676e..d10cb3f 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse/storageclass.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse/sc.yaml @@ -1,5 +1,5 @@ kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: - name: irods-sc + name: irods-sc # the name of the SC provisioner: irods.csi.cyverse.org diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/app.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/app.yaml index 78424cc..111993f 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/app.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/app.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Pod metadata: - name: irods-irodsfuse-app + name: my-app # the name of the app spec: containers: - name: app @@ -9,10 +9,10 @@ spec: command: ["/bin/sh"] args: ["-c", "wc -l /data/input/mrsa_mssa.fa >> /data/output/mrsa_mssa.txt && wc -l /data/input/pov.fa >> /data/output/pov.txt"] volumeMounts: - - name: persistent-storage - mountPath: /data + - name: persistent-storage # the name of the volume + mountPath: /data # mount point restartPolicy: Never volumes: - - name: persistent-storage + - name: persistent-storage # the name of the volume persistentVolumeClaim: - claimName: irods-irodsfuse-pvc + claimName: my-pvc # the name of the PVC diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/pv.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/pv.yaml index 5872ca8..32ac2ad 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/pv.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/pv.yaml @@ -1,25 +1,26 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: irods-irodsfuse-pv + name: my-pv # the name of the pv labels: - vol-name: irods-irodsfuse-pv + vol-name: my-pv # same as the name spec: capacity: - storage: 5Gi + storage: 5Gi # this is required but not meaningful (ignored by csi driver) volumeMode: Filesystem accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain - storageClassName: irods-sc + storageClassName: irods-sc # the name of Storage Class csi: - driver: irods.csi.cyverse.org - volumeHandle: irods-irodsfuse-vol-id + driver: irods.csi.cyverse.org # the name of iRODS CSI driver + volumeHandle: my-vol-id # unique volume ID volumeAttributes: - client: "irodsfuse" - host: "data.cyverse.org" - port: "1247" - zone: "iplant" - user: "iychoi" - password: "yourpassword" + client: "irodsfuse" # iRODS client + host: "data.cyverse.org" # iRODS host + port: "1247" # iRODS port + zone: "iplant" # iRODS zone name + user: "my_username" # iRODS username + password: "my_password" # iRODS password + # path_mapping_json sets multiple iRODS paths for either file or dir to mount in JSON format path_mapping_json: '[{"irods_path": "/iplant/home/iychoi/datasets/MSSA_MRSA/500k_MSSA_MRSA_1.fa", "mapping_path": "/input/mrsa_mssa.fa", "resource_type": "file"},{"irods_path": "/iplant/home/iychoi/datasets/POV/POV_L.Spr.C.1000m_reads.fa", "mapping_path": "/input/pov.fa", "resource_type": "file"},{"irods_path": "/iplant/home/iychoi", "mapping_path": "/output", "resource_type": "dir"}]' diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/pvc.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/pvc.yaml index f753720..09a9260 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/pvc.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/pvc.yaml @@ -1,14 +1,14 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: irods-irodsfuse-pvc + name: my-pvc # the name of the pvc spec: accessModes: - ReadWriteMany - storageClassName: irods-sc + storageClassName: irods-sc # the name of Storage Class selector: matchLabels: - vol-name: irods-irodsfuse-pv + vol-name: my-pv # the name of the pv resources: requests: - storage: 5Gi + storage: 5Gi # this is required but not meaningful (must match to PV's storage capacity) diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/storageclass.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/sc.yaml similarity index 71% rename from examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/storageclass.yaml rename to examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/sc.yaml index ad2676e..d10cb3f 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/storageclass.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse_pathmappings/sc.yaml @@ -1,5 +1,5 @@ kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: - name: irods-sc + name: irods-sc # the name of the SC provisioner: irods.csi.cyverse.org diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/app.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/app.yaml index 47fddf7..27c6b2f 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/app.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/app.yaml @@ -1,18 +1,18 @@ apiVersion: v1 kind: Pod metadata: - name: irods-irodsfuse-app + name: my-app # the name of the app spec: containers: - name: app image: busybox command: ["/bin/sh"] - args: ["-c", "echo Hello Kubernetes! $(date -u) >> /data/kubernetes_irodsfuse_out.txt"] + args: ["-c", "echo Hello Kubernetes! $(date -u) >> /data/irods_csi_driver_out.txt"] volumeMounts: - - name: persistent-storage - mountPath: /data + - name: persistent-storage # the name of the volume + mountPath: /data # mount point restartPolicy: Never volumes: - - name: persistent-storage + - name: persistent-storage # the name of the volume persistentVolumeClaim: - claimName: irods-irodsfuse-pvc + claimName: my-pvc # the name of the PVC diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/pv.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/pv.yaml index 18dee79..b04dfae 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/pv.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/pv.yaml @@ -1,26 +1,26 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: irods-irodsfuse-pv + name: my-pv # the name of the pv labels: - vol-name: irods-irodsfuse-pv + vol-name: my-pv # same as the name spec: capacity: - storage: 5Gi + storage: 5Gi # this is required but not meaningful (ignored by csi driver) volumeMode: Filesystem accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain - storageClassName: irods-sc + storageClassName: irods-sc # the name of Storage Class csi: - driver: irods.csi.cyverse.org - volumeHandle: irods-irodsfuse-vol-id + driver: irods.csi.cyverse.org # the name of iRODS CSI driver + volumeHandle: my-vol-id # unique volume ID volumeAttributes: - client: "irodsfuse" - host: "data.cyverse.org" - port: "1247" - zone: "iplant" - path: "/iplant/home/iychoi" - nodeStageSecretRef: - name: "irods-irodsfuse-secret" - namespace: "default" + client: "irodsfuse" # iRODS client + host: "data.cyverse.org" # iRODS host + port: "1247" # iRODS port + zone: "iplant" # iRODS zone name + path: "/iplant/home/my_username" # iRODS path to mount + nodeStageSecretRef: + name: "my-secret" # the name of the secret + namespace: "default" \ No newline at end of file diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/pvc.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/pvc.yaml index f753720..09a9260 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/pvc.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/pvc.yaml @@ -1,14 +1,14 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: irods-irodsfuse-pvc + name: my-pvc # the name of the pvc spec: accessModes: - ReadWriteMany - storageClassName: irods-sc + storageClassName: irods-sc # the name of Storage Class selector: matchLabels: - vol-name: irods-irodsfuse-pv + vol-name: my-pv # the name of the pv resources: requests: - storage: 5Gi + storage: 5Gi # this is required but not meaningful (must match to PV's storage capacity) diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/storageclass.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/sc.yaml similarity index 71% rename from examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/storageclass.yaml rename to examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/sc.yaml index ad2676e..d10cb3f 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/storageclass.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/sc.yaml @@ -1,5 +1,5 @@ kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: - name: irods-sc + name: irods-sc # the name of the SC provisioner: irods.csi.cyverse.org diff --git a/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/secret.yaml b/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/secret.yaml index fb388af..e06adac 100644 --- a/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/secret.yaml +++ b/examples/kubernetes/static_volume_provisioning/irodsfuse_secrets/secret.yaml @@ -1,8 +1,8 @@ apiVersion: v1 kind: Secret metadata: - name: irods-irodsfuse-secret + name: my-secret # the name of the secret type: Opaque stringData: - user: "iychoi" - password: "yourpassword" \ No newline at end of file + user: "my_username" # iRODS username + password: "my_password" # iRODS password \ No newline at end of file diff --git a/examples/kubernetes/static_volume_provisioning/nfs/app.yaml b/examples/kubernetes/static_volume_provisioning/nfs/app.yaml index be52a52..27c6b2f 100644 --- a/examples/kubernetes/static_volume_provisioning/nfs/app.yaml +++ b/examples/kubernetes/static_volume_provisioning/nfs/app.yaml @@ -1,18 +1,18 @@ apiVersion: v1 kind: Pod metadata: - name: irods-nfs-app + name: my-app # the name of the app spec: containers: - name: app image: busybox command: ["/bin/sh"] - args: ["-c", "echo Hello Kubernetes! $(date -u) >> /data/kubernetes_nfs_out.txt"] + args: ["-c", "echo Hello Kubernetes! $(date -u) >> /data/irods_csi_driver_out.txt"] volumeMounts: - - name: persistent-storage - mountPath: /data + - name: persistent-storage # the name of the volume + mountPath: /data # mount point restartPolicy: Never volumes: - - name: persistent-storage + - name: persistent-storage # the name of the volume persistentVolumeClaim: - claimName: irods-nfs-pvc + claimName: my-pvc # the name of the PVC diff --git a/examples/kubernetes/static_volume_provisioning/nfs/pv.yaml b/examples/kubernetes/static_volume_provisioning/nfs/pv.yaml index 7af9825..27fddc6 100644 --- a/examples/kubernetes/static_volume_provisioning/nfs/pv.yaml +++ b/examples/kubernetes/static_volume_provisioning/nfs/pv.yaml @@ -1,21 +1,21 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: irods-nfs-pv + name: my-pv # the name of the pv labels: - vol-name: irods-nfs-pv + vol-name: my-pv # same as the name spec: capacity: - storage: 5Gi + storage: 5Gi # this is required but not meaningful (ignored by csi driver) volumeMode: Filesystem accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain - storageClassName: irods-sc + storageClassName: irods-sc # the name of Storage Class csi: - driver: irods.csi.cyverse.org - volumeHandle: irods-nfs-vol-id + driver: irods.csi.cyverse.org # the name of iRODS CSI driver + volumeHandle: my-vol-id # unique volume ID volumeAttributes: - client: "nfs" - host: "data.cyverse.org" - path: "/home/public" + client: "nfs" # iRODS client + host: "data.cyverse.org" # iRODS host + path: "/home/my_username" # iRODS path to mount (this is NFS path) diff --git a/examples/kubernetes/static_volume_provisioning/nfs/pvc.yaml b/examples/kubernetes/static_volume_provisioning/nfs/pvc.yaml index 7ae82bc..09a9260 100644 --- a/examples/kubernetes/static_volume_provisioning/nfs/pvc.yaml +++ b/examples/kubernetes/static_volume_provisioning/nfs/pvc.yaml @@ -1,14 +1,14 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: irods-nfs-pvc + name: my-pvc # the name of the pvc spec: accessModes: - ReadWriteMany - storageClassName: irods-sc + storageClassName: irods-sc # the name of Storage Class selector: matchLabels: - vol-name: irods-nfs-pv + vol-name: my-pv # the name of the pv resources: requests: - storage: 5Gi + storage: 5Gi # this is required but not meaningful (must match to PV's storage capacity) diff --git a/examples/kubernetes/static_volume_provisioning/nfs/storageclass.yaml b/examples/kubernetes/static_volume_provisioning/nfs/sc.yaml similarity index 71% rename from examples/kubernetes/static_volume_provisioning/nfs/storageclass.yaml rename to examples/kubernetes/static_volume_provisioning/nfs/sc.yaml index ad2676e..d10cb3f 100644 --- a/examples/kubernetes/static_volume_provisioning/nfs/storageclass.yaml +++ b/examples/kubernetes/static_volume_provisioning/nfs/sc.yaml @@ -1,5 +1,5 @@ kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: - name: irods-sc + name: irods-sc # the name of the SC provisioner: irods.csi.cyverse.org diff --git a/examples/kubernetes/static_volume_provisioning/webdav/app.yaml b/examples/kubernetes/static_volume_provisioning/webdav/app.yaml index 5c12e88..27c6b2f 100644 --- a/examples/kubernetes/static_volume_provisioning/webdav/app.yaml +++ b/examples/kubernetes/static_volume_provisioning/webdav/app.yaml @@ -1,18 +1,18 @@ apiVersion: v1 kind: Pod metadata: - name: irods-webdav-app + name: my-app # the name of the app spec: containers: - name: app image: busybox command: ["/bin/sh"] - args: ["-c", "echo Hello Kubernetes! $(date -u) >> /data/kubernetes_webdav_out.txt"] + args: ["-c", "echo Hello Kubernetes! $(date -u) >> /data/irods_csi_driver_out.txt"] volumeMounts: - - name: persistent-storage - mountPath: /data + - name: persistent-storage # the name of the volume + mountPath: /data # mount point restartPolicy: Never volumes: - - name: persistent-storage + - name: persistent-storage # the name of the volume persistentVolumeClaim: - claimName: irods-webdav-pvc + claimName: my-pvc # the name of the PVC diff --git a/examples/kubernetes/static_volume_provisioning/webdav/pv.yaml b/examples/kubernetes/static_volume_provisioning/webdav/pv.yaml index 8118e56..57e33cd 100644 --- a/examples/kubernetes/static_volume_provisioning/webdav/pv.yaml +++ b/examples/kubernetes/static_volume_provisioning/webdav/pv.yaml @@ -1,22 +1,22 @@ apiVersion: v1 kind: PersistentVolume metadata: - name: irods-webdav-pv + name: my-pv # the name of the pv labels: - vol-name: irods-webdav-pv + vol-name: my-pv # same as the name spec: capacity: - storage: 5Gi + storage: 5Gi # this is required but not meaningful (ignored by csi driver) volumeMode: Filesystem accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain - storageClassName: irods-sc + storageClassName: irods-sc # the name of Storage Class csi: - driver: irods.csi.cyverse.org - volumeHandle: irods-webdav-vol-id + driver: irods.csi.cyverse.org # the name of iRODS CSI driver + volumeHandle: my-vol-id # unique volume ID volumeAttributes: - client: "webdav" - url: "https://data.cyverse.org/dav/iplant/home/iychoi" - user: "iychoi" - password: "yourpassword" + client: "webdav" # iRODS client + url: "https://data.cyverse.org/dav/iplant/home/my_username" # iRODS URL to mount + user: "my_username" # iRODS username + password: "my_password" # iRODS password diff --git a/examples/kubernetes/static_volume_provisioning/webdav/pvc.yaml b/examples/kubernetes/static_volume_provisioning/webdav/pvc.yaml index d972095..09a9260 100644 --- a/examples/kubernetes/static_volume_provisioning/webdav/pvc.yaml +++ b/examples/kubernetes/static_volume_provisioning/webdav/pvc.yaml @@ -1,14 +1,14 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: irods-webdav-pvc + name: my-pvc # the name of the pvc spec: accessModes: - ReadWriteMany - storageClassName: irods-sc + storageClassName: irods-sc # the name of Storage Class selector: matchLabels: - vol-name: irods-webdav-pv + vol-name: my-pv # the name of the pv resources: requests: - storage: 5Gi + storage: 5Gi # this is required but not meaningful (must match to PV's storage capacity) diff --git a/examples/kubernetes/static_volume_provisioning/webdav/sc.yaml b/examples/kubernetes/static_volume_provisioning/webdav/sc.yaml new file mode 100644 index 0000000..d10cb3f --- /dev/null +++ b/examples/kubernetes/static_volume_provisioning/webdav/sc.yaml @@ -0,0 +1,5 @@ +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: irods-sc # the name of the SC +provisioner: irods.csi.cyverse.org diff --git a/examples/kubernetes/static_volume_provisioning/webdav/storageclass.yaml b/examples/kubernetes/static_volume_provisioning/webdav/storageclass.yaml deleted file mode 100644 index ad2676e..0000000 --- a/examples/kubernetes/static_volume_provisioning/webdav/storageclass.yaml +++ /dev/null @@ -1,5 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: irods-sc -provisioner: irods.csi.cyverse.org diff --git a/pkg/client/irods/connection_info.go b/pkg/client/irods/connection_info.go index 5691bad..36ade40 100644 --- a/pkg/client/irods/connection_info.go +++ b/pkg/client/irods/connection_info.go @@ -66,8 +66,6 @@ func getConnectionInfoFromMap(params map[string]string, connInfo *IRODSFSConnect switch common.NormalizeConfigKey(k) { case common.NormalizeConfigKey("irods_authentication_scheme"), common.NormalizeConfigKey("authentication_scheme"), common.NormalizeConfigKey("auth_scheme"): connInfo.AuthenticationScheme = v - case common.NormalizeConfigKey("irods_authentication_file"): - connInfo.AuthenticationFile = v case common.NormalizeConfigKey("irods_client_server_negotiation"), common.NormalizeConfigKey("client_server_negotiation"): connInfo.ClientServerNegotiation = v case common.NormalizeConfigKey("irods_client_server_policy"), common.NormalizeConfigKey("client_server_negotiation_policy"), common.NormalizeConfigKey("cs_negotiation_policy"): @@ -116,7 +114,7 @@ func getConnectionInfoFromMap(params map[string]string, connInfo *IRODSFSConnect connInfo.SSLCACertificatePath = v case common.NormalizeConfigKey("irods_ssl_verify_server"), common.NormalizeConfigKey("verify_server"): connInfo.SSLVerifyServer = v - case common.NormalizeConfigKey("irods_user_password"), common.NormalizeConfigKey("user_password"): + case common.NormalizeConfigKey("irods_user_password"), common.NormalizeConfigKey("user_password"), common.NormalizeConfigKey("password"): connInfo.Password = v case common.NormalizeConfigKey("irods_ssl_server_name"), common.NormalizeConfigKey("ssl_server_name"): connInfo.SSLServerName = v diff --git a/pkg/client/irods/operations.go b/pkg/client/irods/operations.go index fd5ce85..25685fb 100644 --- a/pkg/client/irods/operations.go +++ b/pkg/client/irods/operations.go @@ -6,6 +6,7 @@ import ( irodsclient_fs "github.com/cyverse/go-irodsclient/fs" irodsclient_connection "github.com/cyverse/go-irodsclient/irods/connection" irodsclient_types "github.com/cyverse/go-irodsclient/irods/types" + "k8s.io/klog" ) const ( @@ -57,9 +58,10 @@ func TestConnection(conn *IRODSFSConnectionInfo) error { account := GetIRODSAccount(conn) // test connect - irodsConn := irodsclient_connection.NewIRODSConnection(account, time.Duration(conn.MountTimeout), applicationName) + irodsConn := irodsclient_connection.NewIRODSConnection(account, time.Second*60, applicationName) err := irodsConn.Connect() if err != nil { + klog.V(5).Infof("Failed to connect to iRODS - %v", conn.ToIRODSAccount().GetRedacted()) return err }