2 # Copyright 2020 Huawei Technologies Co., Ltd.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 - name: check if velero is already installed
21 cmd: kubectl get pods -n velero
27 msg: velero already installed
28 when: result.stdout != ""
31 # yamllint disable rule:line-length
32 msg: Ignore Uninstall Log , velero not installed continue with Installation
33 # yamllint disable rule:line-length
34 when: result.stdout == ""
36 - name: Adding helm repo for velero
37 command: helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
40 when: result.stdout == ""
42 - name: Create name space for velero
43 command: kubectl create ns
46 when: result.stdout == ""
48 - name: Install velero
49 command: helm install vmware-tanzu/velero --namespace velero --set-file credentials.secretContents.cloud=./credentials-velero --set configuration.provider=aws --set configuration.backupStorageLocation.name= default --set configuration.backupStorageLocation.bucket=newbucket > --set configuration.backupStorageLocation.config.region=minio > --set configuration.volumeSnapshotLocation.name=default > --set configuration.volumeSnapshotLocation.config.region=minio > --set image.repository=velero/velero > --set image.tag=v1.5.1 > --set image.pullPolicy=IfNotPresent> --set initContainers[0].name=velero-plugin-for-aws > --set initContainers[0].image=velero/velero-plugin-for-aws:v1.1.0 > --set initContainers[0].volumeMounts[0].mountPath=/target > --set initContainers[0].volumeMounts[0].name=plugins --generate-name =velero
52 when: result.stdout == ""