diff --git a/deploy/longhorn.yaml b/deploy/longhorn.yaml index 2474e61..62c4884 100644 --- a/deploy/longhorn.yaml +++ b/deploy/longhorn.yaml @@ -181,7 +181,7 @@ spec: spec: containers: - name: longhorn-manager - image: rancher/longhorn-manager:v0.4.1-rc1 + image: rancher/longhorn-manager:v0.4.1 imagePullPolicy: Always securityContext: privileged: true @@ -190,9 +190,9 @@ spec: - -d - daemon - --engine-image - - rancher/longhorn-engine:v0.4.1-rc1 + - rancher/longhorn-engine:v0.4.1 - --manager-image - - rancher/longhorn-manager:v0.4.1-rc1 + - rancher/longhorn-manager:v0.4.1 - --service-account - longhorn-service-account ports: @@ -269,7 +269,7 @@ spec: spec: containers: - name: longhorn-ui - image: rancher/longhorn-ui:v0.4.1-rc1 + image: rancher/longhorn-ui:v0.4.1 ports: - containerPort: 8000 env: @@ -308,18 +308,18 @@ spec: spec: initContainers: - name: wait-longhorn-manager - image: rancher/longhorn-manager:v0.4.1-rc1 + image: rancher/longhorn-manager:v0.4.1 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: rancher/longhorn-manager:v0.4.1-rc1 + image: rancher/longhorn-manager:v0.4.1 imagePullPolicy: Always command: - longhorn-manager - -d - deploy-driver - --manager-image - - rancher/longhorn-manager:v0.4.1-rc1 + - rancher/longhorn-manager:v0.4.1 - --manager-url - http://longhorn-backend:9500/v1 # manually choose "flexvolume" or "csi" diff --git a/examples/restore_to_file.yaml.template b/examples/restore_to_file.yaml.template new file mode 100644 index 0000000..7bfb6e3 --- /dev/null +++ b/examples/restore_to_file.yaml.template @@ -0,0 +1,48 @@ +apiVersion: v1 +kind: Pod +metadata: + name: restore-to-file + namespace: longhorn-system +spec: + nodeName: + containers: + - name: restore-to-file + command: + # set restore-to-file arguments here + - /bin/sh + - -c + - longhorn backup restore-to-file + '' + --output-file '/tmp/restore/' + --output-format + # 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: 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: + # the output file can be found on this host path + - name: disk-directory + hostPath: + path: /tmp/restore + restartPolicy: Never diff --git a/examples/restore_to_file_with_base_image.yaml.template b/examples/restore_to_file_with_base_image.yaml.template new file mode 100644 index 0000000..9a7e154 --- /dev/null +++ b/examples/restore_to_file_with_base_image.yaml.template @@ -0,0 +1,94 @@ +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/uninstall/uninstall.yaml b/uninstall/uninstall.yaml index 2d15334..64c9209 100644 --- a/uninstall/uninstall.yaml +++ b/uninstall/uninstall.yaml @@ -12,7 +12,7 @@ spec: spec: containers: - name: longhorn-uninstall - image: rancher/longhorn-manager:v0.4.1-rc1 + image: rancher/longhorn-manager:v0.4.1 imagePullPolicy: Always command: - longhorn-manager