Skip to content

Commit 4421ef4

Browse files
Ash-expShivam-nagar23iamayushmSATYAsasini
authored
feat: cluster backup feature using velero (#356)
* fix: update validation tags for TimeBoundariesRequest fields * Feat/finops config (#337) * feat: add cost module installation topics and configurations * feat: add cost module installation topics and time range utilities * adding new topic for gpu installation * feat: velero backup storage location informer register * feat: storage module nats jetstream and bean * feat: bsl informer registration * feat: storage event msg struct * misc: vendor file update for velro * feat: common msg struct implementation for bsl informer * feat: vsl informer registration * feat: backup status nats message struct * feat: change in data types of backup status nats message struct * feat: backup status version datatype change * feat: backup informer registration * feat: nats message struct for restore events * feat: restore informer registration * feat: BackupSchedule status update event msg struct * feat: backup schedule resource constant * feat: backup schedule informer registration * wip: topic for velero installation * feat: refactor backup storage location status handling and clean up unused code * feat: refactor Velero event handling to use unified resource event structure * feat: enhance BackupStatus structure with additional fields for improved backup tracking * feat: streamline Velero resource event handling with new builder methods * feat: update common-lib dependency * feat: remove unused data handling methods from VeleroResourceEvent * feat: remove unused data fields and methods from VeleroResourceEvent * feat: enhance restore object change detection with backup name comparison * feat: update TLS configuration and socket handling for improved performance and deprecation cleanup * feat: update CreateOrUpdateSecretByName method to support additional data formats * feat: enhance CreateOrUpdateSecretByName method to support additional data formats * feat: add post-installation topics and groups for Velero storage * feat: add VeleroBackupSchedule client type to client.go * feat: rename ClusterVeleroBslType to ClusterStorageModuleType for clarity * feat: fix variable name typo for veleroVslInformer in informer and advisor * feat: update default value for ClusterStorageModuleType to ALL_CLUSTER * feat: enhance status comparison logic to handle nil progress and hook status * feat: improve status comparison logic to handle nil progress cases * feat: update velero informer logic to use centralized velero config * feat: add post-installation topics and update common-lib dependency * feat: add velero v1.14.1 dependency for cluster backup functionality * feat: update common-lib dependency to v0.0.0-20251205120949 for improved functionality --------- Co-authored-by: Shivam-nagar23 <shivam@devtron.ai> Co-authored-by: Shivam Nagar <124123645+Shivam-nagar23@users.noreply.github.com> Co-authored-by: ayushmaheshwari <ayush@devtron.ai> Co-authored-by: SATYAsasini <satya.prakash@devtron.ai>
1 parent 0399bf7 commit 4421ef4

164 files changed

Lines changed: 17357 additions & 93 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

chart-sync/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.0
44

55
toolchain go1.24.3
66

7-
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232
7+
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713
88

99
require (
1010
github.com/caarlos0/env v3.5.0+incompatible

chart-sync/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
4343
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
4444
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
4545
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
46-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232 h1:6eggXHuRQOWaqmmuxW5mQSIXLZhB4irR/GJ59MixkKY=
47-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232/go.mod h1:+CUhxuWB8uMYIoiXwofuLIXPyiNnwmoZlH90KWAE5Ew=
46+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713 h1:xDbz5etX5h6foQDgpT9ukTo2I65b6q32Nu9do5nBPk8=
47+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713/go.mod h1:CqHnvltrng2O40hNGVl56qcAhv7tiXK3SKx47LKyE/A=
4848
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
4949
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
5050
github.com/distribution/distribution/v3 v3.0.0 h1:q4R8wemdRQDClzoNNStftB2ZAfqOiN6UX90KJc4HjyM=

chart-sync/vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ github.com/containerd/platforms
9595
# github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
9696
## explicit
9797
github.com/davecgh/go-spew/spew
98-
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232
98+
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713
9999
## explicit; go 1.24.0
100100
github.com/devtron-labs/common-lib/constants
101101
github.com/devtron-labs/common-lib/fetchAllEnv
@@ -975,4 +975,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
975975
sigs.k8s.io/yaml
976976
sigs.k8s.io/yaml/goyaml.v2
977977
sigs.k8s.io/yaml/goyaml.v3
978-
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232
978+
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713

ci-runner/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.24.0
44

55
toolchain go1.24.3
66

7-
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232
7+
replace github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713
88

99
require (
1010
github.com/Knetic/govaluate v3.0.0+incompatible

ci-runner/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
114114
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
115115
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
116116
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
117-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232 h1:6eggXHuRQOWaqmmuxW5mQSIXLZhB4irR/GJ59MixkKY=
118-
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232/go.mod h1:+CUhxuWB8uMYIoiXwofuLIXPyiNnwmoZlH90KWAE5Ew=
117+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713 h1:xDbz5etX5h6foQDgpT9ukTo2I65b6q32Nu9do5nBPk8=
118+
github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713/go.mod h1:CqHnvltrng2O40hNGVl56qcAhv7tiXK3SKx47LKyE/A=
119119
github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk=
120120
github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
121121
github.com/docker/cli v28.1.1+incompatible h1:eyUemzeI45DY7eDPuwUcmDyDj1pM98oD5MdSpiItp8k=

ci-runner/vendor/github.com/devtron-labs/common-lib/pubsub-lib/JetStreamUtil.go

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci-runner/vendor/modules.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ github.com/cncf/xds/go/xds/type/v3
298298
# github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
299299
## explicit
300300
github.com/davecgh/go-spew/spew
301-
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232
301+
# github.com/devtron-labs/common-lib v0.19.1 => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713
302302
## explicit; go 1.24.0
303303
github.com/devtron-labs/common-lib/blob-storage
304304
github.com/devtron-labs/common-lib/constants
@@ -1199,4 +1199,4 @@ sigs.k8s.io/structured-merge-diff/v4/value
11991199
## explicit; go 1.22
12001200
sigs.k8s.io/yaml
12011201
sigs.k8s.io/yaml/goyaml.v2
1202-
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205084952-33d5b5ea8232
1202+
# github.com/devtron-labs/common-lib => github.com/devtron-labs/devtron-services/common-lib v0.0.0-20251205120949-62ef158e4713

common-lib/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ require (
3232
github.com/prometheus/client_golang v1.22.0
3333
github.com/robfig/cron/v3 v3.0.1
3434
github.com/stretchr/testify v1.10.0
35+
github.com/vmware-tanzu/velero v1.14.1
3536
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0
3637
go.uber.org/zap v1.27.0
3738
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
@@ -97,7 +98,6 @@ require (
9798
github.com/moby/sys/atomicwriter v0.1.0 // indirect
9899
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
99100
github.com/morikuni/aec v1.0.0 // indirect
100-
github.com/nxadm/tail v1.4.8 // indirect
101101
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
102102
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
103103
github.com/stretchr/objx v0.5.2 // indirect

common-lib/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSw
169169
github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k=
170170
github.com/foxcpp/go-mockdns v1.1.0 h1:jI0rD8M0wuYAxL7r/ynTrCQQq0BVqfB99Vgk7DlmewI=
171171
github.com/foxcpp/go-mockdns v1.1.0/go.mod h1:IhLeSFGed3mJIAXPH2aiRQB+kqz7oqu8ld2qVbOu7Wk=
172-
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
173172
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
174173
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
175174
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
@@ -375,6 +374,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
375374
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
376375
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
377376
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
377+
github.com/vmware-tanzu/velero v1.14.1 h1:HYj73scn7ZqtfTanjW/X4W0Hn3w/qcfoRbrHCWM52iI=
378+
github.com/vmware-tanzu/velero v1.14.1/go.mod h1:/OzHzTvbevkkX+bK/BS4AgYMv6nKuOgsybuuvLWkSS0=
378379
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
379380
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
380381
github.com/xlab/treeprint v1.2.0 h1:HzHnuAF1plUN2zGlAFHbSQP2qJ0ZAD3XF5XD7OesXRQ=
@@ -494,7 +495,6 @@ golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw=
494495
golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
495496
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
496497
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
497-
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
498498
golang.org/x/sys v0.0.0-20191112214154-59a1497f0cea/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
499499
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
500500
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=

common-lib/pubsub-lib/JetStreamUtil.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ const (
130130
COST_MODULE_GPU_INSTALLATION_TOPIC string = "COST_MODULE_GPU_INSTALLATION_TOPIC"
131131
COST_MODULE_GPU_INSTALLATION_GROUP string = "COST_MODULE_GPU_INSTALLATION_GROUP"
132132
COST_MODULE_GPU_INSTALLATION_DURABLE string = "COST_MODULE_GPU_INSTALLATION_DURABLE"
133+
STORAGE_MODULE_TOPIC string = "STORAGE_MODULE_TOPIC"
134+
STORAGE_MODULE_GROUP string = "STORAGE_MODULE_GROUP"
135+
STORAGE_MODULE_DURABLE string = "STORAGE_MODULE_DURABLE"
136+
STORAGE_VELERO_INSTALL_TOPIC string = "STORAGE_VELERO_INSTALL_TOPIC"
137+
STORAGE_VELERO_INSTALL_GROUP string = "STORAGE_VELERO_INSTALL_GROUP"
138+
STORAGE_VELERO_INSTALL_DURABLE string = "STORAGE_VELERO_INSTALL_DURABLE"
139+
STORAGE_VELERO_POST_INSTALLATION_TOPIC string = "STORAGE_VELERO_POST_INSTALLATION_TOPIC"
140+
STORAGE_VELERO_POST_INSTALLATION_GROUP string = "STORAGE_VELERO_POST_INSTALLATION_GROUP"
141+
STORAGE_VELERO_POST_INSTALLATION_DURABLE string = "STORAGE_VELERO_POST_INSTALLATION_DURABLE"
133142
)
134143

135144
type NatsTopic struct {
@@ -187,6 +196,9 @@ var natsTopicMapping = map[string]NatsTopic{
187196
INFRA_HELM_RELEASE_ACTION_TOPIC: {topicName: INFRA_HELM_RELEASE_ACTION_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: INFRA_HELM_RELEASE_ACTION_GROUP, consumerName: INFRA_HELM_RELEASE_ACTION_DURABLE},
188197
COST_MODULE_INSTALLATION_TOPIC: {topicName: COST_MODULE_INSTALLATION_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: COST_MODULE_INSTALLATION_GROUP, consumerName: COST_MODULE_INSTALLATION_DURABLE},
189198
COST_MODULE_GPU_INSTALLATION_TOPIC: {topicName: COST_MODULE_GPU_INSTALLATION_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: COST_MODULE_GPU_INSTALLATION_GROUP, consumerName: COST_MODULE_GPU_INSTALLATION_DURABLE},
199+
STORAGE_MODULE_TOPIC: {topicName: STORAGE_MODULE_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: STORAGE_MODULE_GROUP, consumerName: STORAGE_MODULE_DURABLE},
200+
STORAGE_VELERO_INSTALL_TOPIC: {topicName: STORAGE_VELERO_INSTALL_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: STORAGE_VELERO_INSTALL_GROUP, consumerName: STORAGE_VELERO_INSTALL_DURABLE},
201+
STORAGE_VELERO_POST_INSTALLATION_TOPIC: {topicName: STORAGE_VELERO_POST_INSTALLATION_TOPIC, streamName: ORCHESTRATOR_STREAM, queueName: STORAGE_VELERO_POST_INSTALLATION_GROUP, consumerName: STORAGE_VELERO_POST_INSTALLATION_DURABLE},
190202
}
191203

192204
var NatsStreamWiseConfigMapping = map[string]NatsStreamConfig{
@@ -231,6 +243,9 @@ var NatsConsumerWiseConfigMapping = map[string]NatsConsumerConfig{
231243
INFRA_HELM_RELEASE_ACTION_DURABLE: {},
232244
COST_MODULE_INSTALLATION_DURABLE: {},
233245
COST_MODULE_GPU_INSTALLATION_DURABLE: {},
246+
STORAGE_MODULE_DURABLE: {},
247+
STORAGE_VELERO_INSTALL_DURABLE: {},
248+
STORAGE_VELERO_POST_INSTALLATION_DURABLE: {},
234249
}
235250

236251
// getConsumerConfigMap will fetch the consumer wise config from the json string

0 commit comments

Comments
 (0)