From 4e9738962118baf7e427699f9ceb39ddf8571842 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Sat, 4 Aug 2018 00:31:04 -0700 Subject: [PATCH] Update README.md Add link to the example pvc and show the minio-secret yaml file. --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1bb01c8..6e885f8 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,14 @@ Use following command to create a default Longhorn StorageClass named `longhorn` ``` kubectl create -f https://raw.githubusercontent.com/rancher/longhorn/v0.3-rc/examples/storageclass.yaml ``` -Then user can create a PVC directly. For example: + +Now you can create a pod using Longhorn like this: +``` +kubectl create -f https://github.com/rancher/longhorn/blob/v0.3-rc/examples/pvc.yaml +``` + +The yaml contains two parts: +1. Create a PVC using Longhorn StorageClass. ``` apiVersion: v1 kind: PersistentVolumeClaim @@ -144,7 +151,7 @@ spec: storage: 2Gi ``` -Then use it in the pod: +2. Use it in the a Pod as a persistent volume: ``` apiVersion: v1 kind: Pod @@ -202,6 +209,21 @@ minio-secret ``` Click the `Backup` tab in the UI, it should report an empty list without error out. +The `minio-secret` yaml looks like this: +``` +apiVersion: v1 +kind: Secret +metadata: + name: minio-secret + namespace: longhorn-system +type: Opaque +data: + AWS_ACCESS_KEY_ID: bG9uZ2hvcm4tdGVzdC1hY2Nlc3Mta2V5 # longhorn-test-access-key + AWS_SECRET_ACCESS_KEY: bG9uZ2hvcm4tdGVzdC1zZWNyZXQta2V5 # longhorn-test-secret-key + AWS_ENDPOINTS: aHR0cDovL21pbmlvLXNlcnZpY2UuZGVmYXVsdDo5MDAw # http://minio-service.default:9000 +``` +Notice the secret must be created in the `longhorn-system` namespace for Longhorn to access. + ### Recurring Snapshot and Backup Longhorn supports recurring snapshot and backup for volumes. User only need to set when he/she wish to take the snapshot and/or backup, and how many snapshots/backups needs to be retains, then Longhorn will automatically create snapshot/backup for the user at that time, as long as the volume is attached to a node.