Skip to content

Commit 03a5713

Browse files
committed
build(cozyplane): mechanize chart vendoring with update targets
The three charts were copied from lllamnyp/cozyplane by hand, with nothing tying the tree to an upstream ref. Each package now carries an update target that re-vendors chart/<name> from a pinned COZYPLANE_REF (a commit sha until upstream cuts release tags) and re-applies the one Cozystack-side difference, the Chart.yaml version stanza. Makefile and tests/ survive the vendor; the apiserver chart's README and .helmignore are vendored now too, so the tree matches the upstream chart directory exactly. Assisted-by: LLM Signed-off-by: Timofei Larkin <[email protected]>
1 parent 08f3bef commit 03a5713

5 files changed

Lines changed: 97 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
*.swp
3+
*.bak
4+
*.tmp
5+
*~
6+
.git
7+
.gitignore
8+
tests/

‎packages/system/cozyplane-apiserver/Makefile‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,16 @@ include ../../../hack/package.mk
1212
test:
1313
helm lint .
1414
helm unittest .
15+
16+
# The vendoring ref in lllamnyp/cozyplane (a release tag once upstream cuts
17+
# them; keep the three cozyplane packages on the same ref). Makefile and
18+
# tests/ are Cozystack-side and survive the vendor, and so does the version
19+
# stanza below: Cozystack owns the chart version, upstream keeps 0.0.0.
20+
COZYPLANE_REF=ac934e14d469a3085bcae6084687b51672698eff
21+
CHART_VERSION=0.0.1
22+
23+
update:
24+
find . -mindepth 1 -maxdepth 1 ! -name Makefile ! -name tests -exec rm -rf {} +
25+
curl -sSL https://github.com/lllamnyp/cozyplane/archive/$(COZYPLANE_REF).tar.gz | \
26+
tar -xzf - --strip-components=3 cozyplane-$(COZYPLANE_REF)/chart/cozyplane-apiserver
27+
sed -i -e '/# Unused as a release coordinate/,/^version: 0.0.0/c\# Placeholder; the real version is stamped by the build/release pipeline.\nversion: $(CHART_VERSION)' Chart.yaml
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# cozyplane-apiserver Helm chart
2+
3+
The `sdn.cozystack.io` API group served by a real **aggregated API server**
4+
(backed by a dedicated etcd) instead of CRDs — the design target: custom
5+
validation, the export/peer verb checks in-server, and subresources (e.g. the
6+
`/ports` observability subresource) beyond CRD ergonomics.
7+
8+
This is a **separate chart from [cozyplane](../cozyplane)** by design. cozyplane
9+
is the CNI and must install before almost everything — including cert-manager —
10+
while this apiserver needs cert-manager `Certificate`s (its serving cert, the
11+
etcd PKI). Splitting lets the CNI slot stay cert-manager-free and this chart
12+
install later, once cert-manager is up (in Cozystack: a component that
13+
`dependsOn` cert-manager).
14+
15+
## The takeover
16+
17+
The cozyplane chart installs the group's **CRDs** (its `crds.enabled` default),
18+
so `sdn.cozystack.io` is served — and tenancy works — from the moment the CNI
19+
lands. Installing this chart creates an explicit `APIService` for
20+
`v1alpha1.sdn.cozystack.io`, which **atomically replaces** the CRDs' implicit
21+
serving of the group: from that moment every request goes to the aggregated
22+
server and its etcd. On a fresh cluster the CRD store is empty when that happens
23+
(tenants come later), so the takeover needs no migration. On a cluster with
24+
existing CRD-stored objects, export them first and re-apply after — the CRD
25+
store is not visible through the aggregated server:
26+
27+
```sh
28+
kubectl get vpcs,ports,vpcbindings,vpcpeerings,securitygroups,floatingips,servicevips -A -o yaml > sdn-backup.yaml
29+
helm install cozyplane-apiserver ./chart/cozyplane-apiserver -n cozyplane-system
30+
kubectl apply -f sdn-backup.yaml
31+
kubectl -n <cozyplane-namespace> rollout restart deploy/cozyplane-controller ds/cozyplane-agent
32+
```
33+
34+
(Strip `resourceVersion`/`uid`/`status` on re-apply, or use `kubectl create`.)
35+
36+
The final restart is load-bearing: watch streams opened against the CRD serving
37+
survive the takeover (the kube-apiserver closes idle watches only after 30–60
38+
minutes), so without it the controller and agents keep watching the shadowed
39+
CRD store. Restart **after** the import so agent startup pruning sees a
40+
populated store and no-ops instead of tearing down live datapath state.
41+
42+
## Requirements
43+
44+
- cert-manager (serving certificate, etcd PKI).
45+
- For the production etcd: the aenix-io etcd-operator (`etcd.operator.enabled`),
46+
replicated and PVC-backed. The default is a built-in single-pod etcd with
47+
emptyDir storage — dev/evaluation only; a pod reschedule erases every
48+
`sdn.cozystack.io` object.
49+
- The [cozyplane](../cozyplane) chart (any order relative to it — but the CNI
50+
normally lands first).

‎packages/system/cozyplane-kpr/Makefile‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,16 @@ include ../../../hack/package.mk
1111
test:
1212
helm lint .
1313
helm unittest .
14+
15+
# The vendoring ref in lllamnyp/cozyplane (a release tag once upstream cuts
16+
# them; keep the three cozyplane packages on the same ref). Makefile and
17+
# tests/ are Cozystack-side and survive the vendor, and so does the version
18+
# stanza below: Cozystack owns the chart version, upstream keeps 0.0.0.
19+
COZYPLANE_REF=ac934e14d469a3085bcae6084687b51672698eff
20+
CHART_VERSION=0.1.0
21+
22+
update:
23+
find . -mindepth 1 -maxdepth 1 ! -name Makefile ! -name tests -exec rm -rf {} +
24+
curl -sSL https://github.com/lllamnyp/cozyplane/archive/$(COZYPLANE_REF).tar.gz | \
25+
tar -xzf - --strip-components=3 cozyplane-$(COZYPLANE_REF)/chart/cozyplane-kpr
26+
sed -i -e '/# Unused as a release coordinate/,/^version: 0.0.0/c\# Placeholder; the real version is stamped by the build/release pipeline.\nversion: $(CHART_VERSION)' Chart.yaml

‎packages/system/cozyplane/Makefile‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,16 @@ include ../../../hack/package.mk
1212
test:
1313
helm lint .
1414
helm unittest .
15+
16+
# The vendoring ref in lllamnyp/cozyplane (a release tag once upstream cuts
17+
# them; keep the three cozyplane packages on the same ref). Makefile and
18+
# tests/ are Cozystack-side and survive the vendor, and so does the version
19+
# stanza below: Cozystack owns the chart version, upstream keeps 0.0.0.
20+
COZYPLANE_REF=ac934e14d469a3085bcae6084687b51672698eff
21+
CHART_VERSION=0.3.29
22+
23+
update:
24+
find . -mindepth 1 -maxdepth 1 ! -name Makefile ! -name tests -exec rm -rf {} +
25+
curl -sSL https://github.com/lllamnyp/cozyplane/archive/$(COZYPLANE_REF).tar.gz | \
26+
tar -xzf - --strip-components=3 cozyplane-$(COZYPLANE_REF)/chart/cozyplane
27+
sed -i -e '/# Unused as a release coordinate/,/^version: 0.0.0/c\# Placeholder; the real version is stamped by the build/release pipeline.\nversion: $(CHART_VERSION)' Chart.yaml

0 commit comments

Comments
 (0)