Skip to content

Commit

Permalink
feat: WIP v3.0.0-rc.1 velero testing, changing templates, schema and …
Browse files Browse the repository at this point in the history
…templates to include snapshot-controller deployment, and enabling volume snapshotting on OnPremises and KFDDistribution providers. Complete refactor of velero schedules settings, simplifying and improving the definition
  • Loading branch information
nutellinoit committed Nov 16, 2024
1 parent 0f795ea commit 45a49b3
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 21 deletions.
10 changes: 10 additions & 0 deletions defaults/ekscluster-kfd-v1alpha2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,16 @@ data:
bucketName: velerobucket
schedules:
install: true
definitions:
manifests:
schedule: "*/15 * * * *"
ttl: "720h0m0s"
full:
schedule: "0 1 * * *"
ttl: "720h0m0s"
snapshotMoveData: false
snapshotController:
install: false
# auth module configuration
auth:
overrides:
Expand Down
10 changes: 10 additions & 0 deletions defaults/kfddistribution-kfd-v1alpha2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ data:
bucketName: velerobucket
schedules:
install: true
definitions:
manifests:
schedule: "*/15 * * * *"
ttl: "720h0m0s"
full:
schedule: "0 1 * * *"
ttl: "720h0m0s"
snapshotMoveData: false
snapshotController:
install: false
# auth module configuration
auth:
overrides:
Expand Down
10 changes: 10 additions & 0 deletions defaults/onpremises-kfd-v1alpha2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,16 @@ data:
bucketName: velerobucket
schedules:
install: true
definitions:
manifests:
schedule: "*/15 * * * *"
ttl: "720h0m0s"
full:
schedule: "0 1 * * *"
ttl: "720h0m0s"
snapshotMoveData: false
snapshotController:
install: false
# auth module configuration
auth:
overrides:
Expand Down
2 changes: 1 addition & 1 deletion kfd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: v1.30.0
modules:
auth: v0.3.0
aws: v4.2.1
dr: v2.3.0
dr: v3.0.0-rc.1
ingress: v2.3.3
logging: v3.4.1
monitoring: v3.2.0
Expand Down
8 changes: 4 additions & 4 deletions templates/distribution/manifests/dr/kustomization.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ resources:
{{- else }}
- {{ print "../" .spec.distribution.common.relativeVendorPath "/modules/dr/katalog/velero/velero-aws" }}
- resources/storageLocation.yaml
- resources/volumeSnapshotLocation.yaml
{{- end }}
- {{ print "../" .spec.distribution.common.relativeVendorPath "/modules/dr/katalog/velero/velero-node-agent" }}

{{- end }}
{{- if .spec.distribution.modules.dr.velero.schedules.install }}
- {{ print "../" .spec.distribution.common.relativeVendorPath "/modules/dr/katalog/velero/velero-schedules" }}
{{- end }}
{{- if .spec.distribution.modules.dr.velero.snapshotController.install }}
- {{ print "../" .spec.distribution.common.relativeVendorPath "/modules/dr/katalog/velero/snapshot-controller" }}
{{- end }}
{{- if eq .spec.distribution.common.provider.type "eks" }}
- resources/eks-velero-backupstoragelocation.yml
- resources/eks-velero-volumesnapshotlocation.yml
Expand All @@ -34,13 +38,9 @@ patchesStrategicMerge:
- patches/eks-velero.yml
{{- end }}
{{- if .spec.distribution.modules.dr.velero.schedules.install }}
{{- if or (index .spec.distribution.modules.dr.velero.schedules "ttl") (and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "manifests")) }}
- patches/velero-schedule-manifests.yml
{{- end }}
{{- if or (index .spec.distribution.modules.dr.velero.schedules "ttl") (and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "full")) }}
- patches/velero-schedule-full.yml
{{- end }}
{{- end }}

{{- if eq .spec.distribution.common.provider.type "none" }}
{{- if eq .spec.distribution.modules.dr.velero.backend "externalEndpoint" }}
Expand Down
17 changes: 17 additions & 0 deletions templates/distribution/manifests/dr/patches/infra-nodes.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,21 @@ spec:
{{ template "tolerations" $veleroArgs }}

{{- end }}

{{- if .spec.distribution.modules.dr.velero.snapshotController.install }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: snapshot-controller
namespace: kube-system
spec:
template:
spec:
nodeSelector:
{{ template "nodeSelector" $veleroArgs }}
tolerations:
{{ template "tolerations" $veleroArgs }}
{{- end }}

{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

{{- if or (index .spec.distribution.modules.dr.velero.schedules "ttl") (and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "full")) }}
---
apiVersion: velero.io/v1
kind: Schedule
metadata:
name: full
namespace: kube-system
spec:
{{- if and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "full") }}
schedule: {{ .spec.distribution.modules.dr.velero.schedules.cron.full }}
{{- end }}
{{- if index .spec.distribution.modules.dr.velero.schedules "ttl" }}
schedule: "{{ .spec.distribution.modules.dr.velero.schedules.definitions.full.schedule }}"
template:
ttl: {{ .spec.distribution.modules.dr.velero.schedules.ttl }}
{{- end }}
{{- end }}
ttl: "{{ .spec.distribution.modules.dr.velero.schedules.definitions.full.ttl }}"
snapshotMoveData: {{ .spec.distribution.modules.dr.velero.schedules.definitions.full.snapshotMoveData }}

Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

{{- if or (index .spec.distribution.modules.dr.velero.schedules "ttl") (and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "manifests")) }}
---
apiVersion: velero.io/v1
kind: Schedule
metadata:
name: manifests
namespace: kube-system
spec:
{{- if and (index .spec.distribution.modules.dr.velero.schedules "cron") (index .spec.distribution.modules.dr.velero.schedules.cron "manifests") }}
schedule: {{ .spec.distribution.modules.dr.velero.schedules.cron.manifests }}
{{- end }}
{{- if index .spec.distribution.modules.dr.velero.schedules "ttl" }}
schedule: "{{ .spec.distribution.modules.dr.velero.schedules.definitions.manifests.schedule }}"
template:
ttl: {{ .spec.distribution.modules.dr.velero.schedules.ttl }}
{{- end }}
{{- end }}
ttl: "{{ .spec.distribution.modules.dr.velero.schedules.definitions.manifests.ttl }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright (c) 2017-present SIGHUP s.r.l All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.

---
apiVersion: velero.io/v1
kind: VolumeSnapshotLocation
metadata:
name: default
namespace: kube-system
labels:
k8s-app: velero
spec:
config:
region: custom
provider: aws

0 comments on commit 45a49b3

Please sign in to comment.