Sync with manager

commit de3962d5a0b99b70f440dc4cef2c43773097026f
Author: Sheng Yang <sheng@yasker.org>
Date:   Fri Mar 22 19:51:13 2019 -0700

    Longhorn v0.4.1 release
This commit is contained in:
Sheng Yang 2019-03-22 20:04:26 -07:00
parent 0ac92d5bac
commit 69e6a333f9
4 changed files with 150 additions and 8 deletions

View File

@ -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"

View File

@ -0,0 +1,48 @@
apiVersion: v1
kind: Pod
metadata:
name: restore-to-file
namespace: longhorn-system
spec:
nodeName: <NODE_NAME>
containers:
- name: restore-to-file
command:
# set restore-to-file arguments here
- /bin/sh
- -c
- longhorn backup restore-to-file
'<BACKUP_URL>'
--output-file '/tmp/restore/<OUTPUT_FILE>'
--output-format <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 <output-file> should be in this directory
env:
# set Backup Target Credential Secret here.
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: <S3_SECRET_NAME>
key: AWS_ACCESS_KEY_ID
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: <S3_SECRET_NAME>
key: AWS_SECRET_ACCESS_KEY
- name: AWS_ENDPOINTS
valueFrom:
secretKeyRef:
name: <S3_SECRET_NAME>
key: AWS_ENDPOINTS
volumes:
# the output file can be found on this host path
- name: disk-directory
hostPath:
path: /tmp/restore
restartPolicy: Never

View File

@ -0,0 +1,94 @@
apiVersion: v1
kind: Pod
metadata:
name: restore-to-file
namespace: longhorn-system
spec:
nodeName: <NODE_NAME>
initContainers:
- name: prime-base-image
# set base image here
command:
- /bin/sh
- -c
- echo primed-base-image
# set base image here
image: <BASE_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: <BASE_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
'<BACKUP_URL>'
--backing-file $list
--output-file '/tmp/restore/<OUTPUT_FILE>'
--output-format <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 <output-file> should be in this directory
env:
# set Backup Target Credential Secret here.
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: <S3_SECRET_NAME>
key: AWS_ACCESS_KEY_ID
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: <S3_SECRET_NAME>
key: AWS_SECRET_ACCESS_KEY
- name: AWS_ENDPOINTS
valueFrom:
secretKeyRef:
name: <S3_SECRET_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

View File

@ -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