• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javaandroidc++linuxc#objective-ccocoa誰得qtrubypythongamewindowsbathyscaphephpguic翻訳omegattwitterframeworktestbtronarduinovb.net計画中(planning stage)directxpreviewerゲームエンジンdom

the default GitOps source repository for booting up Jenkins X


Commit MetaInfo

修订版7ced6a8a450bab2feb4a36e7ff9f1708302256d4 (tree)
时间2019-09-24 23:22:05
作者James Strachan <james.strachan@gmai...>
CommiterJames Strachan

Log Message

fix: add support for scheduled velero backups

更改概述

差异

--- a/jenkins-x.yml
+++ b/jenkins-x.yml
@@ -1,110 +1,230 @@
11 buildPack: none
22 pipelineConfig:
33 pipelines:
4- release:
4+ pullRequest:
55 pipeline:
66 agent:
77 image: gcr.io/jenkinsxio/builder-go
8- environment:
9- - name: DEPLOY_NAMESPACE
10- value: jx
118 stages:
12- - name: release
13- steps:
14- - name: validate-git
15- dir: /workspace/source/env
16- command: jx
17- args: ['step','git','validate']
18- - name: verify-preinstall
19- dir: /workspace/source/env
20- command: jx
21- args: ['step','verify','preinstall']
22- - name: install-jx-crds
23- command: jx
24- args: ['upgrade','crd']
25- - name: install-nginx
26- dir: /workspace/source/systems/jxing
27- command: jx
28- args: ['step','helm','apply', '--boot', '--remote', '--no-vault', '--name', 'jxing']
29- env:
30- - name: DEPLOY_NAMESPACE
31- value: kube-system
32- - name: create-install-values
33- dir: /workspace/source/env
34- command: jx
35- args: ['step','create','install', 'values', '-b']
36- - name: install-external-dns
37- dir: /workspace/source/systems/external-dns
38- command: jx
39- args: ['step','helm','apply', '--boot', '--remote', '--no-vault', '--name', 'jx']
40- - name: install-cert-manager-crds
41- dir: /workspace/source
42- command: kubectl
43- args: ['apply', '--wait', '--validate=true', '-f', 'https://raw.githubusercontent.com/jetstack/cert-manager/release-0.8/deploy/manifests/00-crds.yaml']
44- env:
45- - name: DEPLOY_NAMESPACE
46- value: cert-manager
47- - name: install-cert-manager
48- dir: /workspace/source/systems/cm
49- command: jx
50- args: ['step','helm','apply', '--boot', '--remote', '--no-vault', '--name', 'jx']
51- env:
52- - name: DEPLOY_NAMESPACE
53- value: cert-manager
54- - name: install-acme-issuer-and-certificate
55- dir: /workspace/source/systems/acme
56- command: jx
57- args: ['step','helm','apply', '--boot', '--remote', '--no-vault', '--name', 'jx']
58- - name: install-vault
59- dir: /workspace/source/systems/vault
60- command: jx
61- args: ['step', 'boot','vault']
62- - name: helm-populate-params
63- dir: /workspace/source/env
64- command: jx
65- args: ['step', 'create', 'values', '--name', 'parameters']
66- - name: install-env
67- dir: /workspace/source/env
68- command: jx
69- args: ['step','helm','apply', '--boot', '--remote', '--name', 'jenkins-x', '--provider-values-dir', '../kubeProviders']
70- - name: verify-env
71- dir: /workspace/source
72- command: jx
73- args: ['step','verify','env']
74- - name: log-repos
75- dir: /workspace/source/repositories
76- command: echo
77- args:
78- - ""
79- - ""
80- - "now populating projects...."
81- - ""
82- - ""
83- - name: apply-repositories
84- dir: /workspace/source/repositories
85- command: jx
86- args: ['step','helm','apply', '--boot', '--name', 'repos']
87- - name: apply-pipeline-schedulers
88- dir: /workspace/source/prowConfig
89- command: jx
90- args: ['step','scheduler','config', 'apply', '--direct=true']
91- - name: update-webhooks
92- dir: /workspace/source/repositories
93- command: jx
94- args: ['update','webhooks','--verbose', '--warn-on-fail']
95- - name: verify-install
96- dir: /workspace/source/env
97- command: jx
98- args: ['step','verify','install', '--pod-wait-time', '30m']
99- pullRequest:
9+ - name: pr
10+ steps:
11+ - args:
12+ - build
13+ command: make
14+ dir: /workspace/source/env
15+ name: helm-build
16+ release:
10017 pipeline:
10118 agent:
10219 image: gcr.io/jenkinsxio/builder-go
20+ environment:
21+ - name: DEPLOY_NAMESPACE
22+ value: jx
10323 stages:
104- - name: pr
105- steps:
106- - name: helm-build
107- dir: /workspace/source/env
108- command: make
109- args: ['build']
110-
24+ - name: release
25+ steps:
26+ - args:
27+ - step
28+ - git
29+ - validate
30+ command: jx
31+ dir: /workspace/source/env
32+ name: validate-git
33+ - args:
34+ - step
35+ - verify
36+ - preinstall
37+ command: jx
38+ dir: /workspace/source/env
39+ name: verify-preinstall
40+ - args:
41+ - upgrade
42+ - crd
43+ command: jx
44+ name: install-jx-crds
45+ - args:
46+ - step
47+ - helm
48+ - apply
49+ - --boot
50+ - --remote
51+ - --no-vault
52+ - --name
53+ - velero
54+ command: jx
55+ dir: /workspace/source/systems/velero
56+ env:
57+ - name: DEPLOY_NAMESPACE
58+ value: velero
59+ name: install-velero
60+ - args:
61+ - step
62+ - helm
63+ - apply
64+ - --boot
65+ - --remote
66+ - --no-vault
67+ - --name
68+ - velero-backups
69+ command: jx
70+ dir: /workspace/source/systems/velero-backups
71+ env:
72+ - name: DEPLOY_NAMESPACE
73+ value: velero
74+ name: install-velero-backups
75+ - args:
76+ - step
77+ - helm
78+ - apply
79+ - --boot
80+ - --remote
81+ - --no-vault
82+ - --name
83+ - jxing
84+ command: jx
85+ dir: /workspace/source/systems/jxing
86+ env:
87+ - name: DEPLOY_NAMESPACE
88+ value: kube-system
89+ name: install-nginx
90+ - args:
91+ - step
92+ - create
93+ - install
94+ - values
95+ - -b
96+ command: jx
97+ dir: /workspace/source/env
98+ name: create-install-values
99+ - args:
100+ - step
101+ - helm
102+ - apply
103+ - --boot
104+ - --remote
105+ - --no-vault
106+ - --name
107+ - exdns
108+ command: jx
109+ dir: /workspace/source/systems/external-dns
110+ name: install-external-dns
111+ - args:
112+ - apply
113+ - --wait
114+ - --validate=true
115+ - -f
116+ - https://raw.githubusercontent.com/jetstack/cert-manager/release-0.8/deploy/manifests/00-crds.yaml
117+ command: kubectl
118+ dir: /workspace/source
119+ env:
120+ - name: DEPLOY_NAMESPACE
121+ value: cert-manager
122+ name: install-cert-manager-crds
123+ - args:
124+ - step
125+ - helm
126+ - apply
127+ - --boot
128+ - --remote
129+ - --no-vault
130+ - --name
131+ - cm
132+ command: jx
133+ dir: /workspace/source/systems/cm
134+ env:
135+ - name: DEPLOY_NAMESPACE
136+ value: cert-manager
137+ name: install-cert-manager
138+ - args:
139+ - step
140+ - helm
141+ - apply
142+ - --boot
143+ - --remote
144+ - --no-vault
145+ - --name
146+ - acme
147+ command: jx
148+ dir: /workspace/source/systems/acme
149+ name: install-acme-issuer-and-certificate
150+ - args:
151+ - step
152+ - boot
153+ - vault
154+ command: jx
155+ dir: /workspace/source/systems/vault
156+ name: install-vault
157+ - args:
158+ - step
159+ - create
160+ - values
161+ - --name
162+ - parameters
163+ command: jx
164+ dir: /workspace/source/env
165+ name: helm-populate-params
166+ - args:
167+ - step
168+ - helm
169+ - apply
170+ - --boot
171+ - --remote
172+ - --name
173+ - jenkins-x
174+ - --provider-values-dir
175+ - ../kubeProviders
176+ command: jx
177+ dir: /workspace/source/env
178+ name: install-env
179+ - args:
180+ - step
181+ - verify
182+ - env
183+ command: jx
184+ dir: /workspace/source
185+ name: verify-env
186+ - args:
187+ - ""
188+ - ""
189+ - now populating projects....
190+ - ""
191+ - ""
192+ command: echo
193+ dir: /workspace/source/repositories
194+ name: log-repos
195+ - args:
196+ - step
197+ - helm
198+ - apply
199+ - --boot
200+ - --name
201+ - repos
202+ command: jx
203+ dir: /workspace/source/repositories
204+ name: apply-repositories
205+ - args:
206+ - step
207+ - scheduler
208+ - config
209+ - apply
210+ - --direct=true
211+ command: jx
212+ dir: /workspace/source/prowConfig
213+ name: apply-pipeline-schedulers
214+ - args:
215+ - update
216+ - webhooks
217+ - --verbose
218+ - --warn-on-fail
219+ command: jx
220+ dir: /workspace/source/repositories
221+ name: update-webhooks
222+ - args:
223+ - step
224+ - verify
225+ - install
226+ - --pod-wait-time
227+ - 30m
228+ command: jx
229+ dir: /workspace/source/env
230+ name: verify-install
--- a/systems/acme/Chart.yaml
+++ b/systems/acme/Chart.yaml
@@ -1,3 +1,4 @@
1+apiVersion: v1
12 description: ACME Chart
23 maintainers:
34 - name: Team
--- a/systems/cm/Chart.yaml
+++ b/systems/cm/Chart.yaml
@@ -1,3 +1,4 @@
1+apiVersion: v1
12 description: Cert Manager Chart
23 maintainers:
34 - name: Team
--- a/systems/external-dns/Chart.yaml
+++ b/systems/external-dns/Chart.yaml
@@ -1,3 +1,4 @@
1+apiVersion: v1
12 description: External-DNS Chart
23 maintainers:
34 - name: Team
--- a/systems/jxing/Chart.yaml
+++ b/systems/jxing/Chart.yaml
@@ -1,4 +1,6 @@
1+apiVersion: v1
12 description: Ingress Chart
3+icon: https://raw.githubusercontent.com/nginxinc/kubernetes-ingress/v1.5.5/deployments/helm-chart/chart-icon.png
24 maintainers:
35 - name: Team
46 name: jxing
--- /dev/null
+++ b/systems/velero-backups/Chart.yaml
@@ -0,0 +1,6 @@
1+apiVersion: v1
2+description: Velero Backup Chart
3+maintainers:
4+- name: Team
5+name: velero-backups
6+version: "1"
--- /dev/null
+++ b/systems/velero-backups/README.MD
@@ -0,0 +1,6 @@
1+# velero
2+
3+|App Metadata||
4+|---|---|
5+| **Version** | 1.1.0 |
6+| **Chart Repository** | https://kubernetes-charts.storage.googleapis.com |
--- /dev/null
+++ b/systems/velero-backups/templates/default-backup.yaml
@@ -0,0 +1,21 @@
1+{{- if .Values.velero.enabled }}
2+apiVersion: velero.io/v1
3+kind: Schedule
4+metadata:
5+ name: default-backup
6+spec:
7+ schedule: '@every 10m'
8+ template:
9+ excludedNamespaces: null
10+ excludedResources: null
11+ hooks:
12+ resources: null
13+ includeClusterResources: null
14+ includedNamespaces:
15+ - '*'
16+ includedResources: null
17+ labelSelector: null
18+ storageLocation: ""
19+ ttl: 720h0m0s
20+ volumeSnapshotLocations: null
21+{{- end }}
--- /dev/null
+++ b/systems/velero-backups/values.tmpl.yaml
@@ -0,0 +1,10 @@
1+velero:
2+{{- if and (hasKey .Requirements "velero") (hasKey .Requirements.velero "namespace") }}
3+ {{- if .Requirements.velero.namespace }}
4+ enabled: true
5+ {{- else }}
6+ enabled: false
7+ {{- end }}
8+{{- else }}
9+ enabled: false
10+{{- end }}
\ No newline at end of file
--- /dev/null
+++ b/systems/velero/Chart.yaml
@@ -0,0 +1,6 @@
1+apiVersion: v1
2+description: Velero Chart
3+maintainers:
4+- name: Team
5+name: velero
6+version: "1"
--- /dev/null
+++ b/systems/velero/README.MD
@@ -0,0 +1,6 @@
1+# velero
2+
3+|App Metadata||
4+|---|---|
5+| **Version** | 1.1.0 |
6+| **Chart Repository** | https://kubernetes-charts.storage.googleapis.com |
--- /dev/null
+++ b/systems/velero/requirements.yaml
@@ -0,0 +1,5 @@
1+dependencies:
2+- condition: velero.enabled
3+ alias: velero
4+ name: velero
5+ repository: https://kubernetes-charts.storage.googleapis.com
\ No newline at end of file
--- /dev/null
+++ b/systems/velero/values.tmpl.yaml
@@ -0,0 +1,39 @@
1+velero:
2+{{- if and (hasKey .Requirements "velero") (hasKey .Requirements.velero "namespace") }}
3+ {{- if .Requirements.velero.namespace }}
4+ enabled: true
5+ {{- else }}
6+ enabled: false
7+ {{- end }}
8+{{- else }}
9+ enabled: false
10+{{- end }}
11+ rbac:
12+ create: true
13+ credentials:
14+ useSecret: true
15+ existingSecret: velero-secret
16+{{- if eq .Requirements.cluster.provider "gke" }}
17+ configuration:
18+ provider: gcp
19+ backupStorageLocation:
20+ name: gcp
21+ bucket: {{ .Requirements.storage.backup.url | removeScheme | quote }}
22+{{- else if or (eq .Requirements.cluster.provider "aws") (eq .Requirements.cluster.provider "eks") }}
23+ configuration:
24+ provider: aws
25+ backupStorageLocation:
26+ name: aws
27+ bucket: {{ .Requirements.storage.backup.url | removeScheme | quote }}
28+ config:
29+ region: {{ .Requirements.cluster.region | quote }}
30+{{- else if eq .Requirements.cluster.provider "azure" }}
31+ configuration:
32+ provider: azure
33+ backupStorageLocation:
34+ name: azure
35+ bucket: {{ .Requirements.storage.backup.url | removeScheme | quote }}
36+ config:
37+ storageAccount: {{ .Requirements.velero.serviceAccount | quote }}
38+{{- end }}
39+