Skip to content

Commit 10fc1f4

Browse files
committed
Merge branch 'main' into fix/redis-sentinel-spread
Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <[email protected]>
2 parents a2576bc + 56224a1 commit 10fc1f4

254 files changed

Lines changed: 32474 additions & 1137 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.

‎.github/workflows/e2e-fork.yaml‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ jobs:
543543
# Covers a green full suite. It does not cover a tenant-Kubernetes suite
544544
# running into its node-join deadline, so a red there can end as a
545545
# cancelled job. Held to one figure across every lane that runs the suite.
546-
timeout-minutes: 215
546+
timeout-minutes: 265
547547
permissions:
548548
contents: read
549549
packages: read
@@ -771,21 +771,6 @@ jobs:
771771
name: cozyreport
772772
path: _out/cozyreport.tgz
773773
if-no-files-found: warn
774-
# Both halves, and in this order: the compose project owns the nodes and
775-
# the zpools outlive it.
776-
- name: Tear down sandbox
777-
if: always()
778-
run: |
779-
# Annotated, not fatal: same reasoning as the in-tree lane. The runner
780-
# is discarded after the job, so a dirty host has no next tenant, and
781-
# failing here would post the required "E2E Tests" status as a failure
782-
# indistinguishable from a real one.
783-
cleanup_rc=0
784-
make -C packages/core/testing SANDBOX_NAME=$SANDBOX_NAME delete-cluster-container || cleanup_rc=$?
785-
make -C packages/core/testing SANDBOX_NAME=$SANDBOX_NAME delete || true
786-
if [ "$cleanup_rc" -ne 0 ]; then
787-
echo "::error title=sandbox teardown::teardown exited $cleanup_rc; the host may hold a stale compose project or zpool"
788-
fi
789774

790775
# Flip the pending "E2E Tests" commit status posted by `resolve` to its
791776
# terminal state. Runs on failure too, so a failed publish or e2e turns the

‎.github/workflows/e2e-tag.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
# Covers a green full suite. It does not cover a tenant-Kubernetes suite
138138
# running into its node-join deadline, so a red there can end as a
139139
# cancelled job. Held to one figure across every lane that runs the suite.
140-
timeout-minutes: 215
140+
timeout-minutes: 265
141141
permissions:
142142
contents: read
143143
checks: write # Breakpoint action updates its dedicated "Breakpoint Open" Check Run.
@@ -292,7 +292,7 @@ jobs:
292292
# collect-report packages cozyreport plus per-failed-test crust-gather
293293
# snapshots captured before Chainsaw cleanup.
294294
#
295-
# A ceiling of its own, not the job's 215 minutes. `Upload cozyreport.tgz`
295+
# A ceiling of its own, not the job's 265 minutes. `Upload cozyreport.tgz`
296296
# is the next step and the collector writes its tarball at the very end of
297297
# its run, so a read that never returns spends what is left of the job
298298
# budget, the job is cancelled, and the upload never runs -- the artifact

‎.github/workflows/nightly.yaml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ jobs:
250250
# Covers a green full suite. It does not cover a tenant-Kubernetes suite
251251
# running into its node-join deadline, so a red there can end as a
252252
# cancelled job. Held to one figure across every lane that runs the suite.
253-
timeout-minutes: 215
253+
timeout-minutes: 265
254254
permissions:
255255
contents: read
256256
packages: read
@@ -385,7 +385,7 @@ jobs:
385385
path: _out/chainsaw-report.xml
386386
if-no-files-found: ignore
387387

388-
# A ceiling of its own, not the job's 215 minutes. `Upload cozyreport.tgz`
388+
# A ceiling of its own, not the job's 265 minutes. `Upload cozyreport.tgz`
389389
# is the next step and the collector writes its tarball at the very end of
390390
# its run, so a read that never returns spends what is left of the job
391391
# budget, the job is cancelled, and the upload never runs -- the artifact

‎.github/workflows/pull-requests.yaml‎

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ jobs:
953953
# Covers a green full suite. It does not cover a tenant-Kubernetes suite
954954
# running into its node-join deadline, so a red there can end as a
955955
# cancelled job. Held to one figure across every lane that runs the suite.
956-
timeout-minutes: 215
956+
timeout-minutes: 265
957957
permissions:
958958
contents: read
959959
packages: read
@@ -1224,7 +1224,7 @@ jobs:
12241224

12251225
# ▸ Collect debug information (always runs)
12261226
#
1227-
# A ceiling of its own, not the job's 215 minutes. `Upload
1227+
# A ceiling of its own, not the job's 265 minutes. `Upload
12281228
# cozyreport.tgz` is the next step and the collector writes its tarball
12291229
# at the very end of its run, so a read that never returns spends what
12301230
# is left of the job budget, the job is cancelled, and the upload never
@@ -1235,7 +1235,7 @@ jobs:
12351235
# 30 minutes is measured against the step: it takes 3-42s across sampled
12361236
# runs, on failed e2e jobs as well as green ones. It RESERVES nothing --
12371237
# `timeout-minutes` caps a step, it does not carve budget out of the job,
1238-
# so a suite that has already burned 210 of the 215 leaves this step five
1238+
# so a suite that has already burned 260 of the 265 leaves this step five
12391239
# minutes and the upload is cancelled with everything else. What the cap
12401240
# buys is that a hung read cannot be the reason.
12411241
# `continue-on-error` because the ceiling must not change what the job
@@ -1348,28 +1348,6 @@ jobs:
13481348
Resume from inside: `breakpoint resume`. Otherwise the breakpoint
13491349
exits 10 minutes after the last SSH session disconnects.
13501350
1351-
# ▸ Tear down environment (always runs)
1352-
#
1353-
# Both halves, and in this order: the compose project owns the nodes and
1354-
# the zpools outlive it. A leftover pool makes the next run on a reused
1355-
# host adopt storage that already carries a dead cluster's volumes.
1356-
- name: Tear down sandbox
1357-
if: always()
1358-
run: |
1359-
# Loud, but never the job's verdict. A failed teardown means a dirty
1360-
# host, and this runner is discarded after the job, so there is no next
1361-
# run to protect -- while failing the job here posts the required
1362-
# "E2E Tests" status as a failure that no reader can tell apart from a
1363-
# real one. The annotation is what a reused host (a developer machine)
1364-
# needs; `delete-cluster-container` returning non-zero is not evidence
1365-
# about the product.
1366-
cleanup_rc=0
1367-
make -C packages/core/testing SANDBOX_NAME=$SANDBOX_NAME delete-cluster-container || cleanup_rc=$?
1368-
make -C packages/core/testing SANDBOX_NAME=$SANDBOX_NAME delete || true
1369-
if [ "$cleanup_rc" -ne 0 ]; then
1370-
echo "::error title=sandbox teardown::teardown exited $cleanup_rc; the host may hold a stale compose project or zpool"
1371-
fi
1372-
13731351
# Report the required "E2E Tests" gate as a commit status rather than relying
13741352
# on a job named "E2E Tests". A required *job* that is skipped counts
13751353
# as PASSED by branch protection — desired for docs-only PRs, but the exact

‎.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ _repos
2323
/flux-shard-operator
2424
/kubeovn-plunger
2525
/lineage-controller-webhook
26+
/observability-proxy
2627
/securitygroup-controller
2728

2829
# User-specific stuff

‎Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ build: build-deps
1717
make -C packages/system/cozystack-api image
1818
make -C packages/system/cozystack-controller image
1919
make -C packages/system/backup-controller image
20+
make -C packages/system/observability-proxy image
2021
make -C packages/system/backupstrategy-controller image
2122
make -C packages/system/lineage-controller-webhook image
2223
make -C packages/system/migration-controller image

‎api/apps/v1alpha1/postgresql/types.go‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎api/apps/v1alpha1/vminstance/types.go‎

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

‎api/apps/v1alpha1/vminstance/zz_generated.deepcopy.go‎

Lines changed: 8 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
// SPDX-License-Identifier: Apache-2.0
2+
// Package v1alpha1 defines strategy.backups.cozystack.io API types.
3+
//
4+
// Group: strategy.backups.cozystack.io
5+
// Version: v1alpha1
6+
package v1alpha1
7+
8+
import (
9+
corev1 "k8s.io/api/core/v1"
10+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11+
"k8s.io/apimachinery/pkg/runtime"
12+
)
13+
14+
func init() {
15+
SchemeBuilder.Register(func(s *runtime.Scheme) error {
16+
s.AddKnownTypes(GroupVersion,
17+
&Kubernetes{},
18+
&KubernetesList{},
19+
)
20+
return nil
21+
})
22+
}
23+
24+
const (
25+
KubernetesStrategyKind = "Kubernetes"
26+
)
27+
28+
// +kubebuilder:object:root=true
29+
// +kubebuilder:subresource:status
30+
// +kubebuilder:resource:scope=Cluster
31+
32+
// Kubernetes defines a backup strategy for a tenant Kubernetes application.
33+
// A tenant cluster keeps its state in two places the platform can reach: the
34+
// cluster's key prefix in the tenant's shared etcd DataStore, and host-side
35+
// objects (control-plane PKI Secrets, the application HelmReleases, and the
36+
// DataVolumes that back the tenant's PersistentVolumes). The strategy captures
37+
// the first with a one-shot Job and the second with Velero. The two are taken
38+
// one after another, so a backup is crash-consistent at best.
39+
type Kubernetes struct {
40+
metav1.TypeMeta `json:",inline"`
41+
metav1.ObjectMeta `json:"metadata,omitempty"`
42+
43+
Spec KubernetesSpec `json:"spec,omitempty"`
44+
Status KubernetesStatus `json:"status,omitempty"`
45+
}
46+
47+
// +kubebuilder:object:root=true
48+
49+
// KubernetesList contains a list of Kubernetes backup strategies.
50+
type KubernetesList struct {
51+
metav1.TypeMeta `json:",inline"`
52+
metav1.ListMeta `json:"metadata,omitempty"`
53+
Items []Kubernetes `json:"items"`
54+
}
55+
56+
// KubernetesSpec specifies the desired behavior of a Kubernetes backup strategy.
57+
type KubernetesSpec struct {
58+
// Template holds a PodTemplateSpec for the Job that dumps the cluster's
59+
// key prefix from its etcd DataStore to object storage, writes it back on
60+
// restore, and deletes the object on cleanup. The Job runs in the
61+
// application namespace. Helm-like Go templates are supported in every
62+
// string field and are rendered against:
63+
// - `.Release.Name` and `.Release.Namespace` — the application's name and
64+
// namespace; `.Release.Prefix` is `kubernetes-`.
65+
// - `.Mode` — `"backup"`, `"restore"` or `"cleanup"`.
66+
// - `.ObjectKey` — the object-storage key of this backup's dump.
67+
// - `.Datastore.Prefix` — the cluster's key prefix, without slashes.
68+
// - `.Datastore.Endpoints` — comma-separated etcd client URLs.
69+
// - `.Datastore.CertificateSecret` — the Secret holding the cluster's
70+
// etcd client certificate (`ca.crt`, `server.crt`, `server.key`).
71+
// - `.Parameters` — the resolved BackupClass strategy parameters.
72+
//
73+
// Stored schemaless for the same CRD-size reason as redis_types.go.
74+
//
75+
// +kubebuilder:validation:Schemaless
76+
// +kubebuilder:pruning:PreserveUnknownFields
77+
Template corev1.PodTemplateSpec `json:"template"`
78+
79+
// Velero holds the Velero Backup and Restore specs for the host-side
80+
// objects and volumes. Rendered against `.Application` and `.Parameters`,
81+
// like the Velero strategy.
82+
//
83+
// +kubebuilder:validation:Schemaless
84+
// +kubebuilder:pruning:PreserveUnknownFields
85+
Velero VeleroTemplate `json:"velero"`
86+
87+
// CertificateWarningThreshold is how close to expiry a control-plane
88+
// certificate may be before a backup records a warning. Defaults to 720h.
89+
// +optional
90+
CertificateWarningThreshold *metav1.Duration `json:"certificateWarningThreshold,omitempty"`
91+
}
92+
93+
type KubernetesStatus struct {
94+
Conditions []metav1.Condition `json:"conditions,omitempty"`
95+
}

0 commit comments

Comments
 (0)