From f1a19e3c619533758c3da5e2b5ebbd88051cce29 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Wed, 18 Sep 2019 18:24:10 -0700 Subject: [PATCH] Sync with manager commit 36b37fcb5955ef5b45ca53cb0dea630806d24541 Author: Sheng Yang Date: Wed Sep 18 18:03:02 2019 -0700 Longhorn v0.6.0-rc2 release Signed-off-by: Sheng Yang --- deploy/longhorn.yaml | 14 +-- examples/csi/example_pv.yaml | 2 +- examples/deployment.yaml | 3 + examples/example_storageclass.yaml | 2 +- examples/flexvolume/example_baseimage.yaml | 43 --------- examples/provisioner_with_baseimage.yaml | 63 ------------- ...tore_to_file_with_base_image.yaml.template | 94 ------------------- examples/storageclass.yaml | 7 +- uninstall/uninstall.yaml | 2 +- 9 files changed, 18 insertions(+), 212 deletions(-) delete mode 100644 examples/flexvolume/example_baseimage.yaml delete mode 100644 examples/provisioner_with_baseimage.yaml delete mode 100644 examples/restore_to_file_with_base_image.yaml.template diff --git a/deploy/longhorn.yaml b/deploy/longhorn.yaml index 04f9e0f..b9468ea 100644 --- a/deploy/longhorn.yaml +++ b/deploy/longhorn.yaml @@ -220,7 +220,7 @@ spec: spec: containers: - name: longhorn-manager - image: longhornio/longhorn-manager:v0.6.0-rc1 + image: longhornio/longhorn-manager:v0.6.0-rc2 imagePullPolicy: Always securityContext: privileged: true @@ -229,9 +229,9 @@ spec: - -d - daemon - --engine-image - - longhornio/longhorn-engine:v0.6.0-rc1 + - longhornio/longhorn-engine:v0.6.0-rc2 - --manager-image - - longhornio/longhorn-manager:v0.6.0-rc1 + - longhornio/longhorn-manager:v0.6.0-rc2 - --service-account - longhorn-service-account ports: @@ -316,7 +316,7 @@ spec: spec: containers: - name: longhorn-ui - image: longhornio/longhorn-ui:v0.6.0-rc1 + image: longhornio/longhorn-ui:v0.6.0-rc2 ports: - containerPort: 8000 env: @@ -356,18 +356,18 @@ spec: spec: initContainers: - name: wait-longhorn-manager - image: longhornio/longhorn-manager:v0.6.0-rc1 + image: longhornio/longhorn-manager:v0.6.0-rc2 command: ['sh', '-c', 'while [ $(curl -m 1 -s -o /dev/null -w "%{http_code}" http://longhorn-backend:9500/v1) != "200" ]; do echo waiting; sleep 2; done'] containers: - name: longhorn-driver-deployer - image: longhornio/longhorn-manager:v0.6.0-rc1 + image: longhornio/longhorn-manager:v0.6.0-rc2 imagePullPolicy: Always command: - longhorn-manager - -d - deploy-driver - --manager-image - - longhornio/longhorn-manager:v0.6.0-rc1 + - longhornio/longhorn-manager:v0.6.0-rc2 - --manager-url - http://longhorn-backend:9500/v1 # manually choose "flexvolume" or "csi" diff --git a/examples/csi/example_pv.yaml b/examples/csi/example_pv.yaml index 6943462..b059eba 100644 --- a/examples/csi/example_pv.yaml +++ b/examples/csi/example_pv.yaml @@ -14,7 +14,7 @@ spec: fsType: ext4 volumeAttributes: numberOfReplicas: '3' - staleReplicaTimeout: '30' + staleReplicaTimeout: '2880' volumeHandle: existing-longhorn-volume --- apiVersion: v1 diff --git a/examples/deployment.yaml b/examples/deployment.yaml index babba8b..bb20480 100644 --- a/examples/deployment.yaml +++ b/examples/deployment.yaml @@ -30,6 +30,9 @@ metadata: labels: app: mysql spec: + selector: + matchLabels: + app: mysql # has to match .spec.template.metadata.labels strategy: type: Recreate template: diff --git a/examples/example_storageclass.yaml b/examples/example_storageclass.yaml index 0f4e9bd..0f60338 100644 --- a/examples/example_storageclass.yaml +++ b/examples/example_storageclass.yaml @@ -5,7 +5,7 @@ metadata: provisioner: rancher.io/longhorn parameters: numberOfReplicas: '3' - staleReplicaTimeout: '30' + staleReplicaTimeout: '2880' reclaimPolicy: Delete --- apiVersion: v1 diff --git a/examples/flexvolume/example_baseimage.yaml b/examples/flexvolume/example_baseimage.yaml deleted file mode 100644 index 640d561..0000000 --- a/examples/flexvolume/example_baseimage.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - labels: - app: flexvol-baseimage - name: flexvol-baseimage - namespace: default -spec: - containers: - - name: flexvol-baseimage - image: nginx:stable-alpine - imagePullPolicy: IfNotPresent - volumeMounts: - - name: flexvol - mountPath: /usr/share/nginx/html - ports: - - containerPort: 80 - volumes: - - name: flexvol - flexVolume: - driver: rancher.io/longhorn - options: - size: 32Mi - numberOfReplicas: "3" - staleReplicaTimeout: "20" - fromBackup: "" - baseImage: rancher/longhorn-test:baseimage-ext4 ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: flexvol-baseimage - name: flexvol-baseimage - namespace: default -spec: - ports: - - name: web - port: 80 - targetPort: 80 - selector: - app: flexvol-baseimage - type: LoadBalancer diff --git a/examples/provisioner_with_baseimage.yaml b/examples/provisioner_with_baseimage.yaml deleted file mode 100644 index e3ab42b..0000000 --- a/examples/provisioner_with_baseimage.yaml +++ /dev/null @@ -1,63 +0,0 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - labels: - app: provisioner-baseimage - name: baseimage-storageclass -provisioner: rancher.io/longhorn -parameters: - numberOfReplicas: '3' - staleReplicaTimeout: '30' - fromBackup: '' - baseImage: rancher/longhorn-test:baseimage-ext4 ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app: provisioner-baseimage - name: provisioner-baseimage-service -spec: - ports: - - port: 80 - name: web - selector: - app: provisioner-baseimage - type: LoadBalancer ---- -apiVersion: apps/v1beta2 -kind: StatefulSet -metadata: - labels: - app: provisioner-baseimage - name: provisioner-baseimage-statefulset -spec: - selector: - matchLabels: - app: provisioner-baseimage - serviceName: provisioner-baseimage - replicas: 2 - template: - metadata: - labels: - app: provisioner-baseimage - spec: - terminationGracePeriodSeconds: 10 - containers: - - name: nginx - image: nginx:stable-alpine - imagePullPolicy: IfNotPresent - volumeMounts: - - name: baseimage-vol - mountPath: /usr/share/nginx/html - ports: - - containerPort: 80 - volumeClaimTemplates: - - metadata: - name: baseimage-vol - spec: - accessModes: [ "ReadWriteOnce" ] - storageClassName: baseimage-storageclass - resources: - requests: - storage: 32Mi diff --git a/examples/restore_to_file_with_base_image.yaml.template b/examples/restore_to_file_with_base_image.yaml.template deleted file mode 100644 index 9a7e154..0000000 --- a/examples/restore_to_file_with_base_image.yaml.template +++ /dev/null @@ -1,94 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: restore-to-file - namespace: longhorn-system -spec: - nodeName: - initContainers: - - name: prime-base-image - # set base image here - command: - - /bin/sh - - -c - - echo primed-base-image - # set base image here - image: - imagePullPolicy: Always - containers: - - name: base-image - command: - - /bin/sh - - -c - - mkdir -p /share/base_image && - mount --bind /base_image/ /share/base_image && - echo base image mounted at /share/base_image && - trap 'umount /share/base_image && echo unmounted' TERM && - while true; do $(ls /talk/done 2>&1); if [ $? -eq 0 ]; then break; - fi; echo waiting; sleep 1; done; - umount /share/base_image && echo unmounted - # set base image here - image: - imagePullPolicy: IfNotPresent - securityContext: - privileged: true - volumeMounts: - - name: share - mountPath: /share - mountPropagation: Bidirectional - - name: talk - mountPath: /talk - - name: restore-to-file - command: - # set restore-to-file arguments here - - /bin/sh - - -c - - while true; do list=$(ls /share/base_image/* 2>&1); if [ $? -eq 0 ]; then break; - fi; echo waiting; sleep 1; done; echo Directory found $list; - longhorn backup restore-to-file - '' - --backing-file $list - --output-file '/tmp/restore/' - --output-format - && touch /talk/done && chmod 777 /talk/done && echo created /share/done - # the version of longhorn engine should be v0.4.1 or higher - image: rancher/longhorn-engine:v0.4.1 - imagePullPolicy: IfNotPresent - securityContext: - privileged: true - volumeMounts: - - name: share - mountPath: /share - mountPropagation: HostToContainer - readOnly: true - - name: talk - mountPath: /talk - - name: disk-directory - mountPath: /tmp/restore # the argument should be in this directory - env: - # set Backup Target Credential Secret here. - - name: AWS_ACCESS_KEY_ID - valueFrom: - secretKeyRef: - name: - key: AWS_ACCESS_KEY_ID - - name: AWS_SECRET_ACCESS_KEY - valueFrom: - secretKeyRef: - name: - key: AWS_SECRET_ACCESS_KEY - - name: AWS_ENDPOINTS - valueFrom: - secretKeyRef: - name: - key: AWS_ENDPOINTS - volumes: - - name: share - emptyDir: {} - - name: talk - emptyDir: {} - # the output file can be found on this host path - - name: disk-directory - hostPath: - path: /tmp/restore - restartPolicy: Never diff --git a/examples/storageclass.yaml b/examples/storageclass.yaml index 3d5e5bb..8e74227 100644 --- a/examples/storageclass.yaml +++ b/examples/storageclass.yaml @@ -5,7 +5,10 @@ metadata: provisioner: rancher.io/longhorn parameters: numberOfReplicas: "3" - staleReplicaTimeout: "30" + staleReplicaTimeout: "2880" fromBackup: "" +# diskSelector: "ssd,fast" +# nodeSelector: "storage,fast" # recurringJobs: '[{"name":"snap", "task":"snapshot", "cron":"*/1 * * * *", "retain":1}, -# {"name":"backup", "task":"backup", "cron":"*/2 * * * *", "retain":1}]' \ No newline at end of file +# {"name":"backup", "task":"backup", "cron":"*/2 * * * *", "retain":1, +# "labels": {"interval":"2m"}}]' diff --git a/uninstall/uninstall.yaml b/uninstall/uninstall.yaml index 9855be2..e4e17cb 100644 --- a/uninstall/uninstall.yaml +++ b/uninstall/uninstall.yaml @@ -55,7 +55,7 @@ spec: spec: containers: - name: longhorn-uninstall - image: longhornio/longhorn-manager:v0.6.0-rc1 + image: longhornio/longhorn-manager:v0.6.0-rc2 imagePullPolicy: Always command: - longhorn-manager