|
| 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). |
0 commit comments