mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
feat(platform): cozyplane networking variant
An opt-in bundles.system.networkingVariant for the isp-full (Talos) bundle: "cozyplane" swaps kube-ovn, Cilium and kube-proxy for the cozyplane eBPF CNI, its aggregated sdn.cozystack.io apiserver and the cozyplane-kpr socket-LB proxy. The default "kubeovn-cilium" renders identically to main. The variant drops the packages that assume the replaced stack — kubeovn-webhook/-plunger, multus, securitygroup-controller, the virtualprivatecloud app — and turns off sdn aggregation in cozystack-api, since cozyplane owns the group. The selector is validated before any branch is taken: accepted off isp-full it would half-apply, stripping the kube-ovn control plane and the sdn APIService while the Cilium networking package keeps running; and the default "cilium" gateway class is refused on cozyplane, where nothing serves it. The platform's networking.podCIDR and serviceCIDR (and clusterDNS, derived from the service CIDR when not set explicitly) are threaded into the cozyplane component, so the egress masquerade and the VPC gateways' internal denies match the cluster rather than the chart defaults. CiliumNetworkPolicy objects apply but are not enforced on this variant; the values comment, the networking source and the threat model say so, and the threat model records the SecurityGroup split: cozyplane's is a first-class tenant instrument for traffic inside and across VPCs, not cozystack-api's projection onto CiliumNetworkPolicy. Tenant isolation rebuilt on native NetworkPolicy + HostFirewall is a follow-up. Assisted-by: LLM Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
This commit is contained in:
1 parent
12260c43b0
commit
f0d1a802f0
9 files changed
+497
-3
No files matched your search
@@ -59,6 +59,8 @@ The actors below are decomposed **by trust boundary**, not by component: two com
|
||||
| Tenant-to-tenant / tenant-to-platform traffic | Workload (T3) → workload (T3) / system | East-west packets | Cilium enforces policy at **both** endpoints, so a flow needs the source's egress *and* the destination's ingress to allow it. Every tenant pod's egress is confined to its own tenant subtree (namespaces labelled `tenant.cozystack.io/<tenant>`), platform system services (DNS, apiserver, ingress, dashboard, Keycloak, CDI), and `world` (out-of-cluster). Ingress is permissively open to `world` and `cluster`. | Cross-tenant pod-to-pod traffic is **denied** — an unrelated tenant has no egress path to another tenant's pod, even though that pod's ingress would accept it. Within a tenant subtree, parent→descendant traffic is allowed (descendants carry ancestor namespace labels); child→parent traffic is denied except for specific ancestor services (vminsert, etcd, ingress). See Non-goals for the ingress-side and LoadBalancer caveats. |
|
||||
| Distribute platform config to tenants | Platform (T1) → tenant namespace (T2) | `cozystack-values` Secret (cluster/namespace host, OIDC toggles, gateway references) | Rendered by the platform charts and merged into every tenant HelmRelease as `valuesFrom`. | Tenants inherit platform config (host apex, etc.) but cannot forge it. |
|
||||
|
||||
> **`networkingVariant: cozyplane` (opt-in, draft):** the two Cilium-dependent rows above do not hold on this variant. CiliumNetworkPolicy objects apply but are not enforced, so tenant-to-tenant traffic on the default network is **not** denied until the variant's isolation is rebuilt on native NetworkPolicy; and `sdn.cozystack.io` is served by cozyplane's aggregated apiserver, not by `cozystack-api` — its SecurityGroup is a first-class tenant instrument policing traffic inside and across VPCs, not a projection onto CiliumNetworkPolicy.
|
||||
|
||||
## Goals
|
||||
|
||||
Cozystack intends to provide the following security guarantees:
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
kind: PackageSource
|
||||
metadata:
|
||||
name: cozystack.cozyplane-apiserver
|
||||
spec:
|
||||
sourceRef:
|
||||
kind: OCIRepository
|
||||
name: cozystack-packages
|
||||
namespace: cozy-system
|
||||
path: /
|
||||
variants:
|
||||
# The aggregated API server for sdn.cozystack.io (VPC tenancy, policy). It is a
|
||||
# separate component on purpose: the CNI installs before everything (including
|
||||
# cert-manager), while this needs cert-manager Certificates, the etcd-operator
|
||||
# and — since its etcd is PVC-backed — storage.
|
||||
#
|
||||
# It is the ONLY server of the group: the tenant kinds have no CRDs. Until this
|
||||
# component lands, sdn.cozystack.io simply is not served, and the default
|
||||
# network keeps working regardless (the CNI's own CRDs are the separate LOCAL
|
||||
# group, local.sdn.cozystack.io — underlay IPAM, which must come up beneath
|
||||
# cert-manager, etcd and this server, all of which run as pods).
|
||||
- name: default
|
||||
dependsOn:
|
||||
- cozystack.cert-manager
|
||||
- cozystack.etcd-operator
|
||||
# Its etcd is PVC-backed, so the storage layer must exist first. No cycle:
|
||||
# linstor depends on the CNI, not on this.
|
||||
- cozystack.linstor
|
||||
components:
|
||||
- name: cozyplane-apiserver
|
||||
path: system/cozyplane-apiserver
|
||||
install:
|
||||
privileged: true
|
||||
namespace: cozy-cozyplane
|
||||
releaseName: cozyplane-apiserver
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
kind: PackageSource
|
||||
metadata:
|
||||
name: cozystack.cozyplane-cilium-crds
|
||||
spec:
|
||||
sourceRef:
|
||||
kind: OCIRepository
|
||||
name: cozystack-packages
|
||||
namespace: cozy-system
|
||||
path: /
|
||||
variants:
|
||||
- name: default
|
||||
dependsOn: []
|
||||
components:
|
||||
- name: cozyplane-cilium-crds
|
||||
path: system/cozyplane-cilium-crds
|
||||
install:
|
||||
namespace: cozy-system
|
||||
releaseName: cozyplane-cilium-crds
|
||||
@@ -146,3 +146,37 @@ spec:
|
||||
releaseName: kubeovn
|
||||
dependsOn:
|
||||
- cilium
|
||||
# cozyplane eBPF CNI + cozyplane-kpr (kube-proxy replacement) for Talos
|
||||
# clusters — NO Cilium and NO kube-proxy. cozyplane owns the datapath and the
|
||||
# CNI conflist; cozyplane-kpr provides in-cluster Services via socket-LB
|
||||
# (importing Cilium's LB control plane, no Cilium agent). See
|
||||
# docs/kube-proxy-replacement.md in the cozyplane repository.
|
||||
# NOTE: the CiliumNetworkPolicy objects stock charts ship apply but are not
|
||||
# enforced on this variant. Tenant isolation on the default network is a
|
||||
# follow-up, to be rebuilt on what cozyplane does enforce there: native
|
||||
# NetworkPolicy and its operator-only HostFirewall.
|
||||
- name: cozyplane
|
||||
dependsOn:
|
||||
- cozystack.gateway-api-crds
|
||||
components:
|
||||
- name: cozyplane
|
||||
path: system/cozyplane
|
||||
valuesFiles:
|
||||
- values.yaml
|
||||
- values-talos.yaml
|
||||
install:
|
||||
privileged: true
|
||||
namespace: cozy-cozyplane
|
||||
releaseName: cozyplane
|
||||
dependsOn: []
|
||||
- name: cozyplane-kpr
|
||||
path: system/cozyplane-kpr
|
||||
valuesFiles:
|
||||
- values.yaml
|
||||
- values-talos.yaml
|
||||
install:
|
||||
privileged: true
|
||||
namespace: cozy-cozyplane
|
||||
releaseName: cozyplane-kpr
|
||||
dependsOn:
|
||||
- cozyplane
|
||||
@@ -219,7 +219,12 @@ cozystack-scheduler (emitted with its own variant in both branches)
|
||||
*/}}
|
||||
{{- define "cozystack.platform.system.common-packages" -}}
|
||||
{{- $root := . -}}
|
||||
{{- if not (include "cozystack.platform.slim" $root) -}}
|
||||
{{- $networkingVariant := $root.Values.bundles.system.networkingVariant | default "kubeovn-cilium" -}}
|
||||
{{- /* The cozyplane variant runs no kube-ovn, so its control plane is orphaned
|
||||
there (and the fail-closed kube-ovn admission webhook would block
|
||||
resource creation once cert-manager lands). Multus is coupled the same
|
||||
way; it is emitted per-bundle in system.yaml and gated there. */ -}}
|
||||
{{- if and (not (include "cozystack.platform.slim" $root)) (ne $networkingVariant "cozyplane") -}}
|
||||
{{include "cozystack.platform.package.default" (list "cozystack.kubeovn-webhook" $root) }}
|
||||
{{include "cozystack.platform.package.default" (list "cozystack.kubeovn-plunger" $root) }}
|
||||
{{- end }}
|
||||
@@ -240,9 +245,14 @@ cozystack-scheduler (emitted with its own variant in both branches)
|
||||
SecurityGroups, so it only makes sense where Cilium runs. Keeping it here with the
|
||||
other data-plane packages (rather than in the variant-agnostic body of system.yaml)
|
||||
keeps it out of the isp-hosted (networking=noop) variant, which never calls
|
||||
common-packages and has no cilium.io CRD for the controller to watch. */ -}}
|
||||
common-packages and has no cilium.io CRD for the controller to watch.
|
||||
On cozyplane the sdn.cozystack.io group is cozyplane's: its SecurityGroup is a
|
||||
different, first-class kind, and the CiliumNetworkPolicy projection would be a
|
||||
second implementation of the group writing unenforced policy. */ -}}
|
||||
{{- if ne $networkingVariant "cozyplane" }}
|
||||
{{include "cozystack.platform.package.default" (list "cozystack.securitygroup-controller" $root) }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
The block Cilium takes its own addresses from on the kube-ovn variants, the
|
||||
|
||||
@@ -260,7 +260,14 @@
|
||||
{{include "cozystack.platform.package" (list "cozystack.kubernetes-application" "kubevirt" $) }}
|
||||
{{include "cozystack.platform.package" (list "cozystack.kubernetes-nodes-application" "kubevirt" $) }}
|
||||
{{include "cozystack.platform.package" (list "cozystack.computeplane-application" "kubevirt" $) }}
|
||||
{{- /* virtualprivatecloud is Cozystack's kube-ovn/multus tenant VPC app; it
|
||||
hard-depends on cozystack.multus and cannot function without kube-ovn. The
|
||||
cozyplane variant runs neither and provides VPC tenancy through its own
|
||||
sdn.cozystack.io model, so skip it here (otherwise its Package hangs on a
|
||||
multus dependency that the variant never installs). */ -}}
|
||||
{{- if ne (.Values.bundles.system.networkingVariant | default "kubeovn-cilium") "cozyplane" }}
|
||||
{{include "cozystack.platform.package" (list "cozystack.virtualprivatecloud-application" "kubevirt" $) }}
|
||||
{{- end }}
|
||||
{{include "cozystack.platform.package" (list "cozystack.vm-disk-application" "kubevirt" $) }}
|
||||
{{include "cozystack.platform.package" (list "cozystack.vm-instance-application" "kubevirt" $) }}
|
||||
{{- /*
|
||||
|
||||
@@ -1,9 +1,38 @@
|
||||
{{- /* networkingVariant is an isp-full-only selector, but the packages it
|
||||
gates render on every bundle variant. Accepted elsewhere it would
|
||||
half-apply: drop kube-ovn-webhook/-plunger, securitygroup-controller,
|
||||
the VPC app and the sdn APIService while the real CNI keeps running.
|
||||
Refuse the render outright instead — and validated here, outside the
|
||||
enabled/variant branches, so no combination of bundle values slips a
|
||||
half-applied variant through. */ -}}
|
||||
{{- $nv := .Values.bundles.system.networkingVariant | default "kubeovn-cilium" -}}
|
||||
{{- if and (ne $nv "kubeovn-cilium") (ne .Values.bundles.system.variant "isp-full") -}}
|
||||
{{- fail (printf "bundles.system.networkingVariant %q is only supported on the isp-full bundle variant, got %q" $nv .Values.bundles.system.variant) -}}
|
||||
{{- end -}}
|
||||
{{- /* The default gateway.className is the Cilium class, and no Cilium runs on
|
||||
the cozyplane variant — every tenant Gateway would sit unserved with
|
||||
nothing reporting why. */ -}}
|
||||
{{- if and (eq $nv "cozyplane") .Values.gateway.enabled (eq .Values.gateway.className "cilium") -}}
|
||||
{{- fail "gateway.enabled needs a gateway.className another implementation serves on the cozyplane networking variant: nothing serves the \"cilium\" class there" -}}
|
||||
{{- end -}}
|
||||
{{- if .Values.bundles.system.enabled }}
|
||||
|
||||
# Networking
|
||||
{{- if has .Values.bundles.system.variant (list "isp-full" "isp-slim") }}
|
||||
{{- $networkingComponents := dict -}}
|
||||
{{- if .Values.networking -}}
|
||||
{{- /* Networking variant selector. Defaults to kubeovn-cilium (backward compatible);
|
||||
cozyplane swaps kube-ovn AND Cilium for the cozyplane eBPF CNI +
|
||||
cozyplane-kpr (socket-LB kube-proxy replacement) — no Cilium, no kube-proxy.
|
||||
The top-of-file guard keeps cozyplane off the slim variants, so the
|
||||
full/slim choice below only ever sees kubeovn-cilium. */ -}}
|
||||
{{- $networkingVariant := .Values.bundles.system.networkingVariant | default "kubeovn-cilium" -}}
|
||||
{{- if not (or (eq $networkingVariant "kubeovn-cilium") (eq $networkingVariant "cozyplane")) -}}
|
||||
{{- fail (printf "bundles.system.networkingVariant must be \"kubeovn-cilium\" or \"cozyplane\", got %q" $networkingVariant) -}}
|
||||
{{- end -}}
|
||||
{{- /* The kube-ovn/Cilium values below stay inside the kubeovn-cilium path:
|
||||
the ciliumPool derivation they include fails on a podCIDR longer than
|
||||
/20, a kube-ovn-only constraint that must not fire on cozyplane. */ -}}
|
||||
{{- if and .Values.networking (ne $networkingVariant "cozyplane") -}}
|
||||
{{- $kubeovnIpv4 := dict
|
||||
"POD_CIDR" .Values.networking.podCIDR
|
||||
"POD_GATEWAY" .Values.networking.podGateway
|
||||
@@ -43,7 +72,33 @@
|
||||
{{- $ciliumValues := dict "cilium" $cilium -}}
|
||||
{{- $_ := set $networkingComponents "cilium" (dict "values" $ciliumValues) -}}
|
||||
{{- end -}}
|
||||
{{- if eq $networkingVariant "cozyplane" }}
|
||||
{{- /* cozyplane takes the cluster's networking facts as chart values; left
|
||||
unset it would run on the chart defaults, masquerading the wrong pod
|
||||
supernet, denying the wrong internal ranges at VPC gateways, and
|
||||
pointing their one DNS opening at an address with no DNS behind it.
|
||||
clusterDNS follows the kubeadm convention (the service CIDR's .10)
|
||||
unless networking.clusterDNS says otherwise. */ -}}
|
||||
{{- $cozyplaneComponents := dict -}}
|
||||
{{- if .Values.networking -}}
|
||||
{{- $egress := dict "clusterCIDR" .Values.networking.podCIDR "serviceCIDR" .Values.networking.serviceCIDR -}}
|
||||
{{- $clusterDNS := dig "clusterDNS" "" .Values.networking -}}
|
||||
{{- if not $clusterDNS -}}
|
||||
{{- $svcBase := splitList "/" .Values.networking.serviceCIDR | first -}}
|
||||
{{- $octets := splitList "." $svcBase -}}
|
||||
{{- $clusterDNS = printf "%s.%s.%s.10" (index $octets 0) (index $octets 1) (index $octets 2) -}}
|
||||
{{- end -}}
|
||||
{{- $_ := set $egress "clusterDNS" $clusterDNS -}}
|
||||
{{- $_ := set $cozyplaneComponents "cozyplane" (dict "values" (dict "egress" $egress)) -}}
|
||||
{{- end -}}
|
||||
{{- /* The cozyplane leg does not go through package.networking, so it must
|
||||
invoke the live-variant guard itself: a kubeovn-cilium cluster switched
|
||||
here loses Cilium AND kube-ovn in one reconcile. */ -}}
|
||||
{{- include "cozystack.platform.networking.variantGuard" (list $ "cozyplane") -}}
|
||||
{{include "cozystack.platform.package" (list "cozystack.networking" "cozyplane" $ $cozyplaneComponents) }}
|
||||
{{- else }}
|
||||
{{include "cozystack.platform.package.networking" (list $ $networkingComponents "kubeovn-cilium" "cilium") }}
|
||||
{{- end }}
|
||||
{{include "cozystack.platform.system.common-packages" $ }}
|
||||
{{- /* Talos bundles only bridge, firewall, flannel, host-local, loopback and
|
||||
portmap in /opt/cni/bin from its own node image; the other ten this
|
||||
@@ -57,8 +112,13 @@
|
||||
networking.stageCniPlugins turns it off, for nodes whose operator
|
||||
manages that directory. The value is always emitted rather than left to
|
||||
the chart default, so the rendered Package states which way it went. */ -}}
|
||||
{{- /* multus delegates to the Cilium primary conflist (05-cilium.conflist),
|
||||
which cozyplane never writes (it writes 00-cozyplane) → CrashLoopBackOff,
|
||||
so the cozyplane variant runs without it. */ -}}
|
||||
{{- if ne $networkingVariant "cozyplane" }}
|
||||
{{- $multusComponents := dict "multus" (dict "values" (include "cozystack.platform.multus.values" (list $ true) | fromYaml)) -}}
|
||||
{{include "cozystack.platform.package.full" (list "cozystack.multus" "default" $ $multusComponents) }}
|
||||
{{- end }}
|
||||
{{include "cozystack.platform.package.default" (list "cozystack.linstor" $) }}
|
||||
{{include "cozystack.platform.package" (list "cozystack.cozystack-scheduler" "linstor" $) }}
|
||||
{{- end }}
|
||||
@@ -184,6 +244,18 @@
|
||||
{{- if $hasKeycloakTruststores }}
|
||||
{{- $_ := set $keycloakComponents "keycloak" (dict "values" (dict "truststores" $keycloakTruststores)) -}}
|
||||
{{- end }}
|
||||
{{- /* cozyplane owns the sdn.cozystack.io group — served ONLY by the
|
||||
cozyplane-apiserver aggregated server, with no CRDs (why one group must
|
||||
never have two servers: the header of cozyplane's templates/crds.yaml).
|
||||
So cozystack-api must not aggregate it: a second APIService for the group
|
||||
would hijack it and every non-SecurityGroup kind (VPC, Port, …) 404s. */ -}}
|
||||
{{- if eq (.Values.bundles.system.networkingVariant | default "kubeovn-cilium") "cozyplane" -}}
|
||||
{{- $apiValues := index $cozystackEngineComponents "cozystack-api" | default (dict "values" (dict)) -}}
|
||||
{{- $apiInner := index $apiValues "values" | default (dict) -}}
|
||||
{{- $_ := set $apiInner "cozystackAPI" (dict "serveSDN" false) -}}
|
||||
{{- $_ := set $apiValues "values" $apiInner -}}
|
||||
{{- $_ := set $cozystackEngineComponents "cozystack-api" $apiValues -}}
|
||||
{{- end -}}
|
||||
{{- if .Values.authentication.oidc.enabled }}
|
||||
{{include "cozystack.platform.package" (list "cozystack.cozystack-engine" "oidc" $ $cozystackEngineComponents) }}
|
||||
{{- if $hasKeycloakTruststores }}
|
||||
@@ -198,6 +270,22 @@
|
||||
|
||||
# Common Packages
|
||||
{{include "cozystack.platform.package.default" (list "cozystack.gateway-api-crds" $) }}
|
||||
{{- /* The cozyplane variant runs no Cilium, but many stock components (linstor,
|
||||
tenant, monitoring-agents, fluxcd-operator, ...) embed CiliumNetworkPolicy /
|
||||
CiliumClusterwideNetworkPolicy objects and fail to install without the CRDs.
|
||||
Ship them inert so those manifests apply (cozyplane doesn't enforce them yet
|
||||
— host-firewall / default-network NetworkPolicy is a follow-up). On the
|
||||
Cilium variants the cilium chart provides the CRDs, so skip it there. */ -}}
|
||||
{{- if eq (.Values.bundles.system.networkingVariant | default "kubeovn-cilium") "cozyplane" }}
|
||||
{{include "cozystack.platform.package.default" (list "cozystack.cozyplane-cilium-crds" $) }}
|
||||
{{- /* The aggregated sdn.cozystack.io apiserver: a separate component precisely
|
||||
so the CNI slot stays cert-manager-free — this one dependsOn cert-manager,
|
||||
etcd-operator and (for its PVC-backed etcd) storage. There is no takeover:
|
||||
the tenant kinds have no CRDs at all. The CNI package ships only the LOCAL
|
||||
group's CRDs (local.sdn.cozystack.io — underlay IPAM, which must work
|
||||
before cert-manager, etcd and this server, all of which are pods). */ -}}
|
||||
{{include "cozystack.platform.package.default" (list "cozystack.cozyplane-apiserver" $) }}
|
||||
{{- end }}
|
||||
{{- /* The ClusterIssuers of cert-manager-issuers and the per-tenant Issuers
|
||||
rendered for TenantGateway both use an http01.gatewayHTTPRoute solver
|
||||
when the Gateway is enabled, and the controller refuses that solver
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
suite: networkingVariant bundle wiring
|
||||
templates:
|
||||
- templates/bundles/system.yaml
|
||||
release:
|
||||
name: cozystack
|
||||
namespace: cozy-system
|
||||
tests:
|
||||
- it: defaults to kubeovn-cilium with the stock package set
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: metadata.name
|
||||
value: cozystack.networking
|
||||
equal:
|
||||
path: spec.variant
|
||||
value: kubeovn-cilium
|
||||
- containsDocument: &pkg
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
kind: Package
|
||||
name: cozystack.multus
|
||||
any: true
|
||||
- containsDocument:
|
||||
<<: *pkg
|
||||
name: cozystack.securitygroup-controller
|
||||
- containsDocument:
|
||||
<<: *pkg
|
||||
name: cozystack.kubeovn-webhook
|
||||
- containsDocument:
|
||||
<<: *pkg
|
||||
name: cozystack.cozyplane-apiserver
|
||||
not: true
|
||||
- containsDocument:
|
||||
<<: *pkg
|
||||
name: cozystack.cozyplane-cilium-crds
|
||||
not: true
|
||||
|
||||
- it: cozyplane swaps the CNI and drops the Cilium/kube-ovn-coupled packages
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
networkingVariant: cozyplane
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: metadata.name
|
||||
value: cozystack.networking
|
||||
equal:
|
||||
path: spec.variant
|
||||
value: cozyplane
|
||||
- containsDocument: &pkg2
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
kind: Package
|
||||
name: cozystack.cozyplane-apiserver
|
||||
any: true
|
||||
- containsDocument:
|
||||
<<: *pkg2
|
||||
name: cozystack.cozyplane-cilium-crds
|
||||
- containsDocument:
|
||||
<<: *pkg2
|
||||
name: cozystack.cozy-proxy
|
||||
- containsDocument:
|
||||
<<: *pkg2
|
||||
name: cozystack.etcd-operator
|
||||
- containsDocument:
|
||||
<<: *pkg2
|
||||
name: cozystack.multus
|
||||
not: true
|
||||
- containsDocument:
|
||||
<<: *pkg2
|
||||
name: cozystack.securitygroup-controller
|
||||
not: true
|
||||
- containsDocument:
|
||||
<<: *pkg2
|
||||
name: cozystack.kubeovn-webhook
|
||||
not: true
|
||||
- containsDocument:
|
||||
<<: *pkg2
|
||||
name: cozystack.kubeovn-plunger
|
||||
not: true
|
||||
|
||||
# cozyplane owns sdn.cozystack.io; a second APIService from cozystack-api
|
||||
# would hijack the group and 404 every non-SecurityGroup kind.
|
||||
- it: cozyplane turns off sdn aggregation in cozystack-api
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
networkingVariant: cozyplane
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: metadata.name
|
||||
value: cozystack.cozystack-engine
|
||||
equal:
|
||||
path: spec.components.cozystack-api.values.cozystackAPI.serveSDN
|
||||
value: false
|
||||
|
||||
- it: refuses an unknown networkingVariant
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
networkingVariant: nonesuch
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: 'networkingVariant must be'
|
||||
|
||||
# Accepted off isp-full, the selector would half-apply: strip the kube-ovn
|
||||
# control plane, securitygroup-controller and the sdn APIService while
|
||||
# cozystack.networking keeps installing the Cilium variant.
|
||||
- it: refuses cozyplane on a bundle variant other than isp-full
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full-generic
|
||||
networkingVariant: cozyplane
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: 'only supported on the isp-full bundle variant'
|
||||
|
||||
# The default gateway class is Cilium's, and no Cilium runs on cozyplane —
|
||||
# every tenant Gateway would sit unserved with nothing reporting why.
|
||||
- it: refuses the cilium gateway class on cozyplane
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
networkingVariant: cozyplane
|
||||
gateway:
|
||||
enabled: true
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: 'nothing serves the "cilium" class'
|
||||
|
||||
- it: accepts a non-cilium gateway class on cozyplane
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
networkingVariant: cozyplane
|
||||
gateway:
|
||||
enabled: true
|
||||
className: some-other-class
|
||||
asserts:
|
||||
- containsDocument:
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
kind: Package
|
||||
name: cozystack.cozyplane-apiserver
|
||||
any: true
|
||||
|
||||
- it: refuses cozyplane on a slim variant
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-slim
|
||||
networkingVariant: cozyplane
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: 'only supported on the isp-full bundle variant'
|
||||
|
||||
# Left unset, cozyplane would run on its chart-default CIDRs: the masquerade
|
||||
# matches the wrong pod supernet and the VPC gateways' one DNS opening points
|
||||
# at an address with no DNS behind it.
|
||||
- it: threads the cluster CIDRs and derived DNS into cozyplane
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
networkingVariant: cozyplane
|
||||
networking:
|
||||
podCIDR: "192.168.0.0/17"
|
||||
serviceCIDR: "172.20.0.0/16"
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: metadata.name
|
||||
value: cozystack.networking
|
||||
equal:
|
||||
path: spec.components.cozyplane.values.egress
|
||||
value:
|
||||
clusterCIDR: "192.168.0.0/17"
|
||||
serviceCIDR: "172.20.0.0/16"
|
||||
clusterDNS: "172.20.0.10"
|
||||
|
||||
- it: honours an explicit networking.clusterDNS
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
networkingVariant: cozyplane
|
||||
networking:
|
||||
serviceCIDR: "172.20.0.0/16"
|
||||
clusterDNS: "10.43.0.53"
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: metadata.name
|
||||
value: cozystack.networking
|
||||
equal:
|
||||
path: spec.components.cozyplane.values.egress.clusterDNS
|
||||
value: "10.43.0.53"
|
||||
|
||||
# The ciliumPool derivation requires a /20-or-shorter podCIDR — a kube-ovn
|
||||
# constraint: the last /21 is carved out for Cilium. cozyplane runs no
|
||||
# kube-ovn, so a small pod CIDR must render there.
|
||||
- it: accepts a /24 pod CIDR on cozyplane
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
networkingVariant: cozyplane
|
||||
networking:
|
||||
podCIDR: "192.168.5.0/24"
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: metadata.name
|
||||
value: cozystack.networking
|
||||
equal:
|
||||
path: spec.components.cozyplane.values.egress.clusterCIDR
|
||||
value: "192.168.5.0/24"
|
||||
|
||||
# The cozyplane leg bypasses package.networking, so it invokes the
|
||||
# live-variant guard itself — switching a live kubeovn-cilium cluster here
|
||||
# removes Cilium AND kube-ovn in one reconcile.
|
||||
- it: refuses cozyplane on a live kubeovn-cilium cluster without acknowledgement
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
networkingVariant: cozyplane
|
||||
kubernetesProvider:
|
||||
scheme:
|
||||
"cozystack.io/v1alpha1/Package":
|
||||
gvr: {group: "cozystack.io", version: "v1alpha1", resource: "packages"}
|
||||
namespaced: false
|
||||
objects:
|
||||
- kind: Package
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
metadata: {name: cozystack.networking}
|
||||
spec: {variant: kubeovn-cilium}
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: 'runs variant "kubeovn-cilium".*switch it to "cozyplane".*networking.acknowledgeVariantChange: "cozyplane"'
|
||||
|
||||
- it: accepts the switch to cozyplane when acknowledged by name
|
||||
set:
|
||||
bundles:
|
||||
system:
|
||||
enabled: true
|
||||
variant: isp-full
|
||||
networkingVariant: cozyplane
|
||||
networking:
|
||||
acknowledgeVariantChange: cozyplane
|
||||
kubernetesProvider:
|
||||
scheme:
|
||||
"cozystack.io/v1alpha1/Package":
|
||||
gvr: {group: "cozystack.io", version: "v1alpha1", resource: "packages"}
|
||||
namespaced: false
|
||||
objects:
|
||||
- kind: Package
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
metadata: {name: cozystack.networking}
|
||||
spec: {variant: kubeovn-cilium}
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: metadata.name
|
||||
value: cozystack.networking
|
||||
equal:
|
||||
path: spec.variant
|
||||
value: cozyplane
|
||||
@@ -38,6 +38,17 @@ bundles:
|
||||
system:
|
||||
enabled: false
|
||||
variant: "isp-full" # Options: "isp-full", "isp-full-generic", "isp-hosted", "isp-slim", "isp-slim-generic", "isp-hosted-slim"
|
||||
# CNI/networking selector for the "isp-full" (Talos) variant:
|
||||
# "kubeovn-cilium" — KubeOVN fabric + Cilium (default)
|
||||
# "cozyplane" — cozyplane eBPF CNI + cozyplane-kpr socket-LB KPR
|
||||
# (no Cilium, no kube-proxy)
|
||||
# On "cozyplane", CiliumNetworkPolicy objects apply but are NOT ENFORCED
|
||||
# (the CRDs ship inert so stock charts install): tenant network isolation
|
||||
# on the default network and the Cilium host firewall are not in effect.
|
||||
# cozystack-api's SecurityGroup — a restricted interface over
|
||||
# CiliumNetworkPolicy — is not served either; cozyplane's own SecurityGroup
|
||||
# polices traffic inside and across VPCs instead.
|
||||
networkingVariant: "kubeovn-cilium"
|
||||
iaas:
|
||||
enabled: false
|
||||
# gpu-operator variant selector — applies when cozystack.gpu-operator is
|
||||
@@ -91,6 +102,10 @@ networking:
|
||||
podCIDR: "10.244.0.0/16"
|
||||
podGateway: "10.244.0.1"
|
||||
serviceCIDR: "10.96.0.0/16"
|
||||
# Cluster DNS ClusterIP, used by the cozyplane networking variant (the one
|
||||
# cluster-internal door a VPC gateway opens). Empty derives the kubeadm
|
||||
# convention, the service CIDR's .10.
|
||||
clusterDNS: ""
|
||||
joinCIDR: "100.64.0.0/16"
|
||||
# KubeOVN master nodes override (optional)
|
||||
# By default, KubeOVN helm chart uses `lookup` to find control-plane nodes
|
||||
|
||||
Reference in new issue
Block a user