Merge branch 'main' into issue-4388

Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
This commit is contained in:
Aleksei Sviridkin committed 2026-11-18 13:38:20 +03:00
commit 1d64d077e3
2101 files changed
+185096 -57801

No files matched your search

+6
View File
@@ -22,6 +22,12 @@ type ConfigSpec struct {
// Selects a specific BucketClass by storage pool name.
// +kubebuilder:default:=""
StoragePool string `json:"storagePool,omitempty"`
// Deploys the web UI (s3manager) with its Service and its Ingress or HTTPRoute at `<bucket>.<tenant host>`. Set to `false` to run the bucket without them.
// +kubebuilder:default:=true
Ui bool `json:"ui"`
// Serves the bucket's objects to anyone without credentials at `<endpoint>/<bucket>/<key>`. Anonymous callers can read objects but cannot list the bucket or write to it.
// +kubebuilder:default:=false
PublicRead bool `json:"publicRead"`
// Users configuration map.
// +kubebuilder:default:={}
Users map[string]User `json:"users,omitempty"`
+6 -3
View File
@@ -17,6 +17,9 @@ type Config struct {
}
type ConfigSpec struct {
// FoundationDB major.minor version to deploy
// +kubebuilder:default:="v7.3"
Version Version `json:"version"`
// Cluster configuration.
// +kubebuilder:default:={}
Cluster Cluster `json:"cluster"`
@@ -98,9 +101,6 @@ type Cluster struct {
// Storage engine (ssd-2, ssd-redwood-v1, ssd-rocksdb-v1, memory).
// +kubebuilder:default:="ssd-2"
StorageEngine string `json:"storageEngine"`
// Version of FoundationDB to use.
// +kubebuilder:default:="7.3.63"
Version string `json:"version"`
}
type ClusterFaultDomain struct {
@@ -161,3 +161,6 @@ type ImageType string
// +kubebuilder:validation:Enum="t1.nano";"t1.micro";"t1.small";"t1.medium";"t1.large";"t1.xlarge";"t1.2xlarge";"t1.4xlarge";"c1.nano";"c1.micro";"c1.small";"c1.medium";"c1.large";"c1.xlarge";"c1.2xlarge";"c1.4xlarge";"s1.nano";"s1.micro";"s1.small";"s1.medium";"s1.large";"s1.xlarge";"s1.2xlarge";"s1.4xlarge";"u1.nano";"u1.micro";"u1.small";"u1.medium";"u1.large";"u1.xlarge";"u1.2xlarge";"u1.4xlarge";"m1.nano";"m1.micro";"m1.small";"m1.medium";"m1.large";"m1.xlarge";"m1.2xlarge";"m1.4xlarge";"nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
type ResourcesPreset string
// +kubebuilder:validation:Enum="v7.4";"v7.3"
type Version string
+3
View File
@@ -20,6 +20,9 @@ type ConfigSpec struct {
// Hostname for external access to Harbor (defaults to 'harbor' subdomain for the tenant host).
// +kubebuilder:default:=""
Host string `json:"host,omitempty"`
// IP addresses or CIDR ranges allowed to reach the Harbor web portal and API. `/v2/` and `/service/token`, which `docker login`, image pulls and pushes use, are not restricted by this list. For the portal and API it replaces the tenant ingress `whitelist` rather than narrowing it, and it is matched against the client address the ingress controller sees, which is a proxy or a forwarded header rather than the real client when something in front of the controller rewrites it. Empty allows every address. Requires Ingress publishing; rejected when the tenant publishes through Gateway API.
// +kubebuilder:default:={}
ManagementWhitelist []string `json:"managementWhitelist,omitempty"`
// StorageClass used to store the data.
// +kubebuilder:default:=""
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="storageClass is immutable"
+5
View File
@@ -53,6 +53,11 @@ func (in *Config) DeepCopyObject() runtime.Object {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) {
*out = *in
if in.ManagementWhitelist != nil {
in, out := &in.ManagementWhitelist, &out.ManagementWhitelist
*out = make([]string, len(*in))
copy(*out, *in)
}
in.Core.DeepCopyInto(&out.Core)
in.Registry.DeepCopyInto(&out.Registry)
in.Jobservice.DeepCopyInto(&out.Jobservice)
+4 -4
View File
@@ -24,8 +24,8 @@ type ConfigSpec struct {
// TLS configuration. Strimzi manages the cluster PKI automatically (no cert-manager is involved for this chart): the operator auto-creates `<release>-cluster-ca-cert` and `<release>-clients-ca-cert` secrets, both exposed for client trust setup. The internal TLS listener on 9093 is always on; this toggle only controls the external listener on 9094.
// +kubebuilder:default:={}
Tls TLS `json:"tls"`
// Kafka version to deploy. Upgrade-only: once a cluster's KRaft metadata is at a given version, Strimzi refuses an in-place downgrade, so lowering this on a running cluster (e.g. v3.9 back to v3.8) leaves the Kafka CR stuck in a reconcile error. Pick the target version at creation and only ever raise it.
// +kubebuilder:default:="v3.9"
// Kafka version to deploy. Upgrade-only: once a cluster's KRaft metadata is at a given version, Strimzi refuses an in-place downgrade, so lowering this on a running cluster (e.g. v4.3 back to v4.2) leaves the Kafka CR stuck in a reconcile error. Pick the target version at creation and only ever raise it.
// +kubebuilder:default:="v4.3"
Version Version `json:"version"`
// Topics configuration.
// +kubebuilder:default:={}
@@ -36,7 +36,7 @@ type ConfigSpec struct {
}
type Kafka struct {
// Persistent Volume size for KRaft controller metadata (used during ZK-to-KRaft migration).
// Persistent Volume size for KRaft controller metadata.
// +kubebuilder:default:="5Gi"
ControllerStorageSize resource.Quantity `json:"controllerStorageSize,omitempty"`
// Number of Kafka replicas.
@@ -83,5 +83,5 @@ type Topic struct {
// +kubebuilder:validation:Enum="t1.nano";"t1.micro";"t1.small";"t1.medium";"t1.large";"t1.xlarge";"t1.2xlarge";"t1.4xlarge";"c1.nano";"c1.micro";"c1.small";"c1.medium";"c1.large";"c1.xlarge";"c1.2xlarge";"c1.4xlarge";"s1.nano";"s1.micro";"s1.small";"s1.medium";"s1.large";"s1.xlarge";"s1.2xlarge";"s1.4xlarge";"u1.nano";"u1.micro";"u1.small";"u1.medium";"u1.large";"u1.xlarge";"u1.2xlarge";"u1.4xlarge";"m1.nano";"m1.micro";"m1.small";"m1.medium";"m1.large";"m1.xlarge";"m1.2xlarge";"m1.4xlarge";"nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
type ResourcesPreset string
// +kubebuilder:validation:Enum="v3.9";"v3.8"
// +kubebuilder:validation:Enum="v4.3";"v4.2"
type Version string
+47 -43
View File
@@ -25,10 +25,10 @@ type ConfigSpec struct {
// Kubernetes major.minor version to deploy
// +kubebuilder:default:="v1.35"
Version Version `json:"version"`
// External hostname for Kubernetes cluster. Defaults to `<cluster-name>.<tenant-host>` if empty.
// External hostname for Kubernetes cluster. Defaults to `kubernetes-<cluster-name>.<tenant-host>` if empty.
// +kubebuilder:default:=""
Host string `json:"host"`
// Which infrastructure provider backs this cluster's worker VMs. `kubevirt` runs them inside this cluster; `proxmox` runs them on an external Proxmox VE cluster through capmox. The control plane is Kamaji either way — this selects the infrastructure half only. Must match the `substrate` of every KubernetesNodes pool attached to this cluster: the pools reference this cluster's infrastructure object by kind, and a mismatch leaves their Machines unreconciled. Switching an existing cluster is not supported; create a new one.
// Which infrastructure provider backs this cluster's worker VMs. `kubevirt` runs them inside this cluster; `proxmox` runs them on an external Proxmox VE cluster through capmox. The control plane is Kamaji either way — this selects the infrastructure half only. Every KubernetesNodes pool of this cluster must set the same `substrate`: a pool set to the other one refuses to render once this cluster exists. Switching an existing cluster is not supported; create a new one.
// +kubebuilder:default:="kubevirt"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="substrate is immutable"
Substrate string `json:"substrate"`
@@ -41,13 +41,7 @@ type ConfigSpec struct {
// Kubernetes control-plane configuration.
// +kubebuilder:default:={}
ControlPlane ControlPlane `json:"controlPlane"`
// Optional image overrides for air-gapped or rate-limited registries.
// +kubebuilder:default:={}
Images Images `json:"images"`
// Talos worker image configuration.
// +kubebuilder:default:={}
Talos Talos `json:"talos"`
// OIDC authentication and per-user RBAC for the tenant kube-apiserver. See docs/oidc-tenant.md for the operator guide.
// OIDC authentication and per-user RBAC for the tenant kube-apiserver. See https://cozystack.io/docs/v1.6/kubernetes/oidc-authentication/ for the operator guide.
// +kubebuilder:default:={}
Oidc OIDC `json:"oidc"`
}
@@ -56,7 +50,7 @@ type APIServer struct {
// Admission plugins the tenant kube-apiserver enables, passed through to KamajiControlPlane `spec.admissionControllers`, which the control plane renders as `--enable-admission-plugins`. A non-empty list replaces the control plane's default set instead of adding to it. The kube-apiserver enables these plugins in addition to its own default ones, so leaving a plugin out does not turn it off; to turn one off, name it in `--disable-admission-plugins` in `controlPlane.apiServer.extraArgs` and keep it out of this list, since the apiserver refuses to start with a plugin in both, and the control plane's default set names several. Empty by default, which keeps that default set, taken from the TenantControlPlane CRD: CertificateApproval, CertificateSigning, CertificateSubjectRestriction, DefaultIngressClass, DefaultStorageClass, DefaultTolerationSeconds, LimitRanger, MutatingAdmissionWebhook, NamespaceLifecycle, PersistentVolumeClaimResize, Priority, ResourceQuota, RuntimeClass, ServiceAccount, StorageObjectInUseProtection, TaintNodesByCondition, ValidatingAdmissionWebhook. `NodeRestriction` is not in it.
// +kubebuilder:default:={}
AdmissionControllers []AdmissionController `json:"admissionControllers,omitempty"`
// Extra command-line flags appended to the tenant kube-apiserver, passed through to KamajiControlPlane `spec.apiServer.extraArgs`. For OIDC use `spec.oidc.mode` — this passthrough is the escape hatch for unrelated apiserver flags. The tenant control plane sets each of the following flags itself and drops an entry naming one before the apiserver sees it. The chart moves an `--enable-admission-plugins=` entry into `controlPlane.apiServer.admissionControllers` and a `--kubelet-preferred-address-types=` entry into `controlPlane.kubelet.preferredAddressTypes` while that field is empty, and refuses any other entry naming one of them: `--advertise-address`, `--client-ca-file`, `--enable-admission-plugins`, `--service-cluster-ip-range`, `--kubelet-client-certificate`, `--kubelet-client-key`, `--kubelet-preferred-address-types`, `--proxy-client-cert-file`, `--proxy-client-key-file`, `--requestheader-allowed-names`, `--requestheader-client-ca-file`, `--secure-port`, `--service-account-key-file`, `--service-account-signing-key-file`, `--tls-cert-file`, `--tls-private-key-file`, `--etcd-servers`, `--etcd-cafile`, `--etcd-certfile`, `--etcd-keyfile`, `--etcd-prefix`, `--etcd-compaction-interval`, `--egress-selector-config-file`. When `spec.oidc.mode` is not `None` the chart also renders OIDC flags here, reads what you have written on them, and refuses some combinations outright; `docs/oidc-tenant.md` carries which flags, which combinations, and why. Do NOT add legacy `--oidc-*` flags here when `spec.oidc.mode` is not `None`; the chart injects `--authentication-config` and the apiserver refuses to boot with both. Empty by default (no change to current behavior).
// Extra command-line flags appended to the tenant kube-apiserver, passed through to KamajiControlPlane `spec.apiServer.extraArgs`. For OIDC use `spec.oidc.mode` — this passthrough is the escape hatch for unrelated apiserver flags. The tenant control plane sets each of the following flags itself and drops an entry naming one before the apiserver sees it. The chart moves an `--enable-admission-plugins=` entry into `controlPlane.apiServer.admissionControllers` and a `--kubelet-preferred-address-types=` entry into `controlPlane.kubelet.preferredAddressTypes` while that field is empty, and refuses any other entry naming one of them: `--advertise-address`, `--client-ca-file`, `--enable-admission-plugins`, `--service-cluster-ip-range`, `--kubelet-client-certificate`, `--kubelet-client-key`, `--kubelet-preferred-address-types`, `--proxy-client-cert-file`, `--proxy-client-key-file`, `--requestheader-allowed-names`, `--requestheader-client-ca-file`, `--secure-port`, `--service-account-key-file`, `--service-account-signing-key-file`, `--tls-cert-file`, `--tls-private-key-file`, `--etcd-servers`, `--etcd-cafile`, `--etcd-certfile`, `--etcd-keyfile`, `--etcd-prefix`, `--etcd-compaction-interval`, `--egress-selector-config-file`. When `spec.oidc.mode` is not `None` the chart also renders OIDC flags here, reads what you have written on them, and refuses some combinations outright; the Aggregated API servers section of the Kubernetes OIDC guide on cozystack.io carries which flags, which combinations, and why. Do NOT add legacy `--oidc-*` flags here when `spec.oidc.mode` is not `None`; the chart injects `--authentication-config` and the apiserver refuses to boot with both. Empty by default.
// +kubebuilder:default:={}
ExtraArgs []string `json:"extraArgs,omitempty"`
// Extra volume mounts added to the tenant kube-apiserver container, passed through to KamajiControlPlane `spec.apiServer.extraVolumeMounts`. Each `name` must reference a volume declared in `extraVolumes`; the chart-managed talos secret volumes cannot be mounted. Each item is a core/v1 VolumeMount. Empty by default.
@@ -77,10 +71,10 @@ type Addons struct {
// Cert-manager addon.
// +kubebuilder:default:={}
CertManager CertManagerAddon `json:"certManager"`
// Cilium CNI plugin.
// Cilium CNI plugin. Always installed as the tenant cluster's CNI; this section only overrides its Helm values.
// +kubebuilder:default:={}
Cilium CiliumAddon `json:"cilium"`
// CoreDNS addon.
// CoreDNS addon. Always installed as the tenant cluster's DNS; this section only overrides its Helm values.
// +kubebuilder:default:={}
Coredns CoreDNSAddon `json:"coredns"`
// Gateway API addon.
@@ -104,7 +98,7 @@ type Addons struct {
// Velero backup/restore addon.
// +kubebuilder:default:={}
Velero VeleroAddon `json:"velero"`
// Vertical Pod Autoscaler.
// Vertical Pod Autoscaler. Installed and removed together with addons.monitoringAgents.enabled; this section only overrides its Helm values.
// +kubebuilder:default:={}
VerticalPodAutoscaler VerticalPodAutoscalerAddon `json:"verticalPodAutoscaler"`
}
@@ -184,18 +178,6 @@ type HAMiAddon struct {
ValuesOverride k8sRuntime.RawExtension `json:"valuesOverride"`
}
type Images struct {
// Image used by the bootstrap-token tenant Job (kubectl). Empty falls back to images/kubectl.tag.
// +kubebuilder:default:=""
Kubectl string `json:"kubectl,omitempty"`
// Image used by the talos-csr-signer sidecar in the Kamaji control plane. Empty falls back to images/talos-csr-signer.tag.
// +kubebuilder:default:=""
TalosCsrSigner string `json:"talosCsrSigner,omitempty"`
// Image used by the wait-for-kubeconfig init container. Empty falls back to images/busybox.tag.
// +kubebuilder:default:=""
WaitForKubeconfig string `json:"waitForKubeconfig,omitempty"`
}
type IngressNginxAddon struct {
// Enable the controller (requires nodes labeled `ingress-nginx`).
// +kubebuilder:default:=false
@@ -288,14 +270,41 @@ type Proxmox struct {
// Proxmox nodes capmox may place VMs on. Empty means every node in the Proxmox cluster.
// +kubebuilder:default:={}
AllowedNodes []string `json:"allowedNodes,omitempty"`
// Proxmox cloud-controller-manager settings.
// +kubebuilder:default:={}
Ccm ProxmoxCCM `json:"ccm,omitempty"`
// Proxmox CSI driver settings.
// +kubebuilder:default:={}
Csi ProxmoxCSI `json:"csi,omitempty"`
// Nameservers written into each worker's network config. Required by the ProxmoxCluster schema.
// +kubebuilder:default:={}
DnsServers []string `json:"dnsServers,omitempty"`
// Skip verification of the Proxmox API server certificate in the CCM and the CSI controller, both of which run in the management cluster. Default false: the certificate is verified unless an operator turns that off. A stock Proxmox VE install serves a self-signed one, so set true for it, or install a certificate the management cluster trusts.
// +kubebuilder:default:=false
Insecure bool `json:"insecure,omitempty"`
// Address pool for workers. capmox assigns static addresses and has no DHCP mode, so this is required rather than optional.
// +kubebuilder:default:={}
Ipv4Config ProxmoxIPv4 `json:"ipv4Config"`
}
type ProxmoxCCM struct {
// Secret in THIS namespace holding the controller's Proxmox API credentials under the keys `url`, `token_id`, `token_secret` and `region`. May name the same Secret as `csi.credentialsSecretName`; it is a separate knob so the two can hold separate tokens, since this one only reads VM inventory while the driver attaches and detaches disks.
// +kubebuilder:default:=""
CredentialsSecretName string `json:"credentialsSecretName"`
}
type ProxmoxCSI struct {
// Secret in THIS namespace holding the driver's Proxmox API credentials under the keys `url`, `token_id`, `token_secret` and `region`. The parent chart composes them into the controller's config file here, in the management cluster; nothing reaches the tenant, and no token is written into a rendered manifest. Distinct from the capmox credentials on purpose: the driver attaches and detaches disks, which is a different blast radius from creating VMs.
// +kubebuilder:default:=""
CredentialsSecretName string `json:"credentialsSecretName"`
// Install the driver. Without it a Proxmox-backed tenant has no way to provision PersistentVolumes at all.
// +kubebuilder:default:=true
Enabled bool `json:"enabled"`
// StorageClasses to create in the tenant.
// +kubebuilder:default:={}
StorageClasses []ProxmoxStorageClass `json:"storageClasses,omitempty"`
}
type ProxmoxIPv4 struct {
// Ranges or CIDRs, e.g. `["10.0.0.120-10.0.0.170"]`. capmox turns these into an InClusterIPPool, so they must not overlap any DHCP range on the same L2 or two workers will answer to one address.
// +kubebuilder:default:={}
@@ -308,6 +317,19 @@ type ProxmoxIPv4 struct {
Prefix int `json:"prefix"`
}
type ProxmoxStorageClass struct {
// Filesystem the driver formats volumes with: ext4 or xfs.
Fstype string `json:"fstype,omitempty"`
// StorageClass name inside the tenant cluster.
Name string `json:"name"`
// Delete or Retain.
ReclaimPolicy string `json:"reclaimPolicy,omitempty"`
// Mark volumes as SSD-backed, which changes the discard/cache defaults Proxmox applies.
Ssd bool `json:"ssd,omitempty"`
// Proxmox storage id the volumes are created on (as it appears in `pvesm status`).
Storage string `json:"storage"`
}
type Resources struct {
// CPU available.
Cpu resource.Quantity `json:"cpu,omitempty"`
@@ -324,24 +346,6 @@ type Scheduler struct {
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
}
type Talos struct {
// Base URL of the Talos Image Factory that serves the worker OS disk image (the `openstack-amd64.raw.xz` raw artifact streamed in by CDI over HTTP). Defaults to the public factory. Point at a self-hosted Image Factory, a caching mirror, or an internal HTTP file server for air-gapped, rate-limited, or flaky-egress environments. No trailing slash.
// +kubebuilder:default:="https://factory.talos.dev"
ImageFactoryURL string `json:"imageFactoryURL"`
// OCI repository prefix for the Talos installer image used by the in-guest `talos-reconcile` upgrade Job. Resolved as `<installerRepository>/<schematicID>:<version>`. Defaults to the public factory's installer path. Override for air-gapped or mirrored registries. No trailing slash.
// +kubebuilder:default:="factory.talos.dev/installer"
InstallerRepository string `json:"installerRepository"`
// Talos `machine.registries.mirrors` passthrough for worker nodes: a map of upstream registry host to `{ endpoints: [ ... ] }`. Empty by default, so workers pull container images (the Talos `kubelet` image included) directly from the upstream registry. Point a host such as `ghcr.io` at an in-cluster pull-through mirror for air-gapped, rate-limited, or flaky-egress environments so a worker's boot does not depend on live public egress. Talos still falls back to the upstream registry unless a host also sets `skipFallback: true`, so a mirror alone does not enforce air-gap.
// +kubebuilder:default:={}
RegistryMirrors k8sRuntime.RawExtension `json:"registryMirrors"`
// Talos image-factory schematic ID. Defaults to the cozystack-tested vanilla schematic. Operators using custom schematics (system extensions, kernel args) override here.
// +kubebuilder:default:="ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515"
SchematicID string `json:"schematicID"`
// Talos release used for worker OS image and installer. Must satisfy the chart's Talos<->Kubernetes support matrix against the chosen `version`.
// +kubebuilder:default:="v1.13.6"
Version string `json:"version"`
}
type VeleroAddon struct {
// Enable Velero.
// +kubebuilder:default:=false
+52 -33
View File
@@ -154,8 +154,6 @@ func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) {
in.Proxmox.DeepCopyInto(&out.Proxmox)
in.Addons.DeepCopyInto(&out.Addons)
in.ControlPlane.DeepCopyInto(&out.ControlPlane)
out.Images = in.Images
in.Talos.DeepCopyInto(&out.Talos)
in.Oidc.DeepCopyInto(&out.Oidc)
}
@@ -268,21 +266,6 @@ func (in *HAMiAddon) DeepCopy() *HAMiAddon {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Images) DeepCopyInto(out *Images) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Images.
func (in *Images) DeepCopy() *Images {
if in == nil {
return nil
}
out := new(Images)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IngressNginxAddon) DeepCopyInto(out *IngressNginxAddon) {
*out = *in
@@ -463,6 +446,8 @@ func (in *Proxmox) DeepCopyInto(out *Proxmox) {
*out = make([]string, len(*in))
copy(*out, *in)
}
out.Ccm = in.Ccm
in.Csi.DeepCopyInto(&out.Csi)
if in.DnsServers != nil {
in, out := &in.DnsServers, &out.DnsServers
*out = make([]string, len(*in))
@@ -481,6 +466,41 @@ func (in *Proxmox) DeepCopy() *Proxmox {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProxmoxCCM) DeepCopyInto(out *ProxmoxCCM) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxmoxCCM.
func (in *ProxmoxCCM) DeepCopy() *ProxmoxCCM {
if in == nil {
return nil
}
out := new(ProxmoxCCM)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProxmoxCSI) DeepCopyInto(out *ProxmoxCSI) {
*out = *in
if in.StorageClasses != nil {
in, out := &in.StorageClasses, &out.StorageClasses
*out = make([]ProxmoxStorageClass, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxmoxCSI.
func (in *ProxmoxCSI) DeepCopy() *ProxmoxCSI {
if in == nil {
return nil
}
out := new(ProxmoxCSI)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProxmoxIPv4) DeepCopyInto(out *ProxmoxIPv4) {
*out = *in
@@ -501,6 +521,21 @@ func (in *ProxmoxIPv4) DeepCopy() *ProxmoxIPv4 {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *ProxmoxStorageClass) DeepCopyInto(out *ProxmoxStorageClass) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProxmoxStorageClass.
func (in *ProxmoxStorageClass) DeepCopy() *ProxmoxStorageClass {
if in == nil {
return nil
}
out := new(ProxmoxStorageClass)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Resources) DeepCopyInto(out *Resources) {
*out = *in
@@ -534,22 +569,6 @@ func (in *Scheduler) DeepCopy() *Scheduler {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Talos) DeepCopyInto(out *Talos) {
*out = *in
in.RegistryMirrors.DeepCopyInto(&out.RegistryMirrors)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Talos.
func (in *Talos) DeepCopy() *Talos {
if in == nil {
return nil
}
out := new(Talos)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *VeleroAddon) DeepCopyInto(out *VeleroAddon) {
*out = *in
+45 -32
View File
@@ -18,11 +18,11 @@ type Config struct {
}
type ConfigSpec struct {
// Name of the parent Kubernetes cluster (the `Kubernetes` CR) in the same namespace this node pool attaches to. Required. The pool's CAPI objects are wired to the parent cluster `kubernetes-<cluster>`; the KubernetesNodes CR must be named `<cluster>-<pool>`. The pool name (the part after `<cluster>-`) must not collide with a nodeGroup still managed by the parent kubernetes chart (e.g. the default `md0`), or the render fails on ownership conflict.
// Name of the parent Kubernetes cluster (the `Kubernetes` CR) in the same namespace this node pool attaches to. Required. The pool's CAPI objects are wired to the parent cluster `kubernetes-<cluster>`; the KubernetesNodes CR must be named `<cluster>-<pool>`. The pool's objects are named `kubernetes-<cluster>-<pool>`; when a MachineDeployment of that name already exists and belongs to another Helm release, the render fails instead of taking it over.
// +kubebuilder:default:=""
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="cluster is immutable"
Cluster string `json:"cluster"`
// StorageClass for the worker node system disk. When empty, the cluster default applies. Worker VMs live-migrate, so their disks need ReadWriteMany — the RWX access mode is supplied by the chosen StorageClass's CDI StorageProfile — and linstor-csi rejects RWX volumes that are not on a DRBD-backed StorageClass, so prefer a replicated/DRBD class. On an `osImage.builtin` pool this field also decides whether the pool renders at all: CDI takes the storage-layer clone path only when the worker disk and the golden share a StorageClass, and falls back to a host-assisted copy over the pod network across classes, so the chart refuses a pool whose class differs from its golden's. Leaving it empty resolves to the cluster's default StorageClass, and the same comparison is made against that. On a `builtin` pool the resolved class is then written onto the worker disk rather than left for the cluster to fill in at bind time, so a pool that has already cloned keeps binding on the class its disks are on even after an admin moves the default annotation; on the HTTP path an empty class is still left to the cluster.
// StorageClass for the worker node system disk. When empty, CDI picks the class: the one annotated `storageclass.kubevirt.io/is-default-virt-class`, else the cluster default. Worker VMs live-migrate, so their disks need ReadWriteMany — the RWX access mode is supplied by the chosen StorageClass's CDI StorageProfile — and linstor-csi rejects RWX volumes that are not on a DRBD-backed StorageClass, so prefer a replicated/DRBD class. On an `osImage.builtin` pool this field also decides whether the pool renders at all: the chart refuses a pool whose class differs from its golden's, because across classes CDI either falls back to a host-assisted copy over the pod network (different CSI drivers or volume modes) or leaves a clone into the other class to the CSI driver. Leaving it empty makes the same comparison against the class CDI would pick. On a `builtin` pool the resolved class is then written onto the worker disk rather than left for the cluster to fill in at bind time, so a pool that has already cloned keeps binding on the class its disks are on even after an admin moves the default annotation; on the HTTP path an empty class is still left to the cluster. Has no effect on `substrate: proxmox`, where the worker disk is cloned from the VM template onto the template's storage or `proxmox.storage`.
// +kubebuilder:default:="replicated"
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="storageClass is immutable"
StorageClass string `json:"storageClass"`
@@ -32,26 +32,32 @@ type ConfigSpec struct {
// Maximum number of replicas in this pool. Used as the cluster-autoscaler ceiling.
// +kubebuilder:default:=10
MaxReplicas int `json:"maxReplicas"`
// Virtual machine instance type.
// KubeVirt instance type that sizes each worker VM when `resources` is not set. Ignored when `resources.cpu` and `resources.memory` are both set, and therefore on `substrate: proxmox`, which requires them.
// +kubebuilder:default:="u1.medium"
InstanceType string `json:"instanceType"`
// System disk size for the worker VM. Carries the Talos OS image, kubelet state, containerd image cache, and any local-path PVCs. How the OS image reaches the disk follows this pool's `osImage`: the default and `osImage.factory` stream the Image Factory raw artifact in over HTTP, while `osImage.builtin` makes the disk a storage-layer CDI clone of a shared golden image, with no HTTP fetch. A `builtin` pool must keep diskSize at or above the golden's storage size (6Gi in the shipped worker image catalog), because a CDI clone target cannot be smaller than its source -- the chart rejects a smaller value at render time rather than letting the clone stall. Sizing a `builtin` pool also has to allow for transient headroom the finished disk does not show: CDI populates a larger target by cloning the golden at the source size and then growing it, so a worker being provisioned occupies a temporary clone PVC at the golden's size on top of this diskSize, and both are multiplied by the replica count of a replicated StorageClass. The golden itself is a separate one-time cost for the whole cluster, not a per-worker one. So the peak is the golden, plus `diskSize + golden storage` for each worker cloning at that moment. A pool whose storage backend cannot spare that peak does not fail: the clone waits for space, the VM never boots, and the reason is visible only in the storage layer's own events.
// System disk size for the worker VM. Carries the Talos OS image, kubelet state, containerd image cache, and any local-path PVCs. How the OS image reaches the disk follows this pool's `osImage`: the default and `osImage.factory` stream the Image Factory raw artifact in over HTTP, while `osImage.builtin` makes the disk a storage-layer CDI clone of a shared golden image, with no HTTP fetch. A `builtin` pool must keep diskSize at or above the golden's storage size (6Gi in the shipped worker image catalog), because a CDI clone target cannot be smaller than its source -- the chart rejects a smaller value at render time rather than letting the clone stall. Sizing a `builtin` pool also has to allow for transient headroom the finished disk does not show: CDI populates a larger target by cloning the golden at the source size and then growing it, so a worker being provisioned occupies a temporary clone PVC at the golden's size on top of this diskSize, and both are multiplied by the replica count of a replicated StorageClass. The golden itself is a separate one-time cost for the whole cluster, not a per-worker one. So the peak is the golden, plus `diskSize + golden storage` for each worker cloning at that moment. A pool whose storage backend cannot spare that peak does not fail: the clone waits for space, the VM never boots, and the reason is visible only in the storage layer's own events. Has no effect on `substrate: proxmox`, where the worker disk is a clone of the VM template's disk and keeps its size.
// +kubebuilder:default:="20Gi"
DiskSize resource.Quantity `json:"diskSize"`
// List of node roles. Each role `r` labels nodes with `node-role.kubernetes.io/<r>`. Use `[ingress-nginx]` for a pool that hosts the tenant ingress-nginx controller.
// +kubebuilder:default:={}
Roles []string `json:"roles,omitempty"`
// Explicit CPU and memory for each worker node, as an alternative to `instanceType` sizing. Optional: when omitted, the node is sized by `instanceType`. When both `cpu` and `memory` are set, they take precedence and `instanceType` is ignored (the instancetype is omitted from the VM, since KubeVirt cannot override an instancetype's CPU/memory). Set both `cpu` and `memory` together or neither; setting only one is rejected at render time.
// Explicit CPU and memory for each worker node, as an alternative to `instanceType` sizing. Optional: when omitted, the node is sized by `instanceType`. When both `cpu` and `memory` are set, they take precedence and `instanceType` is ignored (the instancetype is omitted from the VM, since KubeVirt cannot override an instancetype's CPU/memory). Set both `cpu` and `memory` together or neither; setting only one is rejected at render time. On the kubevirt substrate `cpu` is written into the VM as spelled and decoded as YAML, so a leading zero is read as octal, as in any Kubernetes manifest: `"010"` is eight cores, and the autoscaler capacity counts eight. The kubelet reservations still read the value as a decimal, so `"010"` reserves what `"10"` does.
// +kubebuilder:default:={}
Resources Resources `json:"resources,omitempty"`
// CPU limit for the worker VM's virt-launcher `compute` container, which is the ceiling the guest vCPU threads, the QEMU emulator thread and the IO threads share. Distinct from `resources.cpu`, which sizes the guest itself. Cannot be combined with `instanceType` sizing: KubeVirt refuses a VM that references an instancetype and also sets `domain.resources.limits.cpu`, so the chart rejects that combination at render time. Sizing the pool by `resources` (both `cpu` and `memory`) is what drops the instancetype from the VM, which is where the limit is usable. When unset, KubeVirt derives the limit from the guest vCPU count in any namespace carrying a ResourceQuota that limits CPU, so a worker sized at N vCPUs runs under a ceiling of N with the emulation overhead taken out of the same N. Setting a value declares the limit on the VM directly, which is both what lands it on the container and what stops KubeVirt deriving one. It moves the CPU request with it: KubeVirt copies a declared CPU limit into the CPU request when the VM declares no request of its own, so a pool that sets only this field asks the scheduler for its whole ceiling instead of the fraction of the vCPU count it asked for before, and a ceiling the nodes cannot spare leaves the workers Pending on `Insufficient cpu`. Pair it with `podCpuRequest` to move the ceiling without moving the request. Zero means no ceiling at all rather than the tightest one, since the kubelet turns a zero CPU limit into no CFS quota while the declared key still stops KubeVirt deriving one — but it is only accepted together with `podCpuRequest: 0`, because KubeVirt keeps deriving a request from the vCPU count when the VM declares none and a request above a declared limit of zero is rejected when the worker's Pod is created. A negative value is refused at render time. Changing it rolls the pool, because the worker VM template is named by a hash of its content. Keep in sync with the parent kubernetes chart.
// CPU limit for the worker VM's virt-launcher `compute` container, which is the ceiling the guest vCPU threads, the QEMU emulator thread and the IO threads share. Distinct from `resources.cpu`, which sizes the guest itself. Cannot be combined with `instanceType` sizing: KubeVirt refuses a VM that references an instancetype and also sets `domain.resources.limits.cpu`, so the chart rejects that combination at render time. Sizing the pool by `resources` (both `cpu` and `memory`) is what drops the instancetype from the VM, which is where the limit is usable. When unset, KubeVirt derives the limit from the guest vCPU count in any namespace carrying a ResourceQuota that limits CPU, so a worker sized at N vCPUs runs under a ceiling of N with the emulation overhead taken out of the same N. Setting a value declares the limit on the VM directly, which is both what lands it on the container and what stops KubeVirt deriving one. It moves the CPU request with it: KubeVirt copies a declared CPU limit into the CPU request when the VM declares no request of its own, so a pool that sets only this field asks the scheduler for its whole ceiling instead of the fraction of the vCPU count it asked for before, and a ceiling the nodes cannot spare leaves the workers Pending on `Insufficient cpu`. Pair it with `podCpuRequest` to move the ceiling without moving the request. Zero means no ceiling at all rather than the tightest one, since the kubelet turns a zero CPU limit into no CFS quota while the declared key still stops KubeVirt deriving one — but it is only accepted together with `podCpuRequest: 0`, because KubeVirt keeps deriving a request from the vCPU count when the VM declares none and a request above a declared limit of zero is rejected when the worker's Pod is created. A negative value is refused at render time. Changing it rolls the pool, because the worker VM template is named by a hash of its content.
PodCpuLimit resource.Quantity `json:"podCpuLimit,omitempty"`
// CPU request for the worker VM's virt-launcher `compute` container, which is what the scheduler reserves for a worker on its host and what weights it against neighbours on a contended one. Distinct from `resources.cpu`, which sizes the guest itself. It exists to be paired with `podCpuLimit`: KubeVirt copies a declared CPU limit into the request when the VM declares no request, so raising the ceiling alone raises what every worker in the pool asks the scheduler for, and this field is what holds the request still while the ceiling moves. Cannot be combined with `instanceType` sizing, for the same reason as `podCpuLimit`: KubeVirt refuses a VM that references an instancetype and also sets `domain.resources.requests.cpu`, so the chart rejects that combination at render time, as it does a value above `podCpuLimit`. Usable without a limit, where it only changes the scheduler's weighting: KubeVirt still derives the ceiling from the guest vCPU count in any namespace carrying a ResourceQuota that limits CPU, so keep the request at or below that count. A request above that derived ceiling is refused only when the worker's Pod is created, and deliberately not at render time: the ceiling exists only where such a ResourceQuota does, so refusing here would take away a configuration that works in a namespace without one. Zero is accepted on its own and reserves nothing, but zero beside a `podCpuLimit` is refused, because KubeVirt cannot tell an explicit zero request from an absent one and replaces both with the limit — which is the outcome this field exists to avoid, arrived at silently. A negative value is refused as well. When unset, KubeVirt computes the request from the guest vCPU count and the cluster CPU allocation ratio. Changing it rolls the pool, because the worker VM template is named by a hash of its content. Keep in sync with the parent kubernetes chart.
// CPU request for the worker VM's virt-launcher `compute` container, which is what the scheduler reserves for a worker on its host and what weights it against neighbours on a contended one. Distinct from `resources.cpu`, which sizes the guest itself. It exists to be paired with `podCpuLimit`: KubeVirt copies a declared CPU limit into the request when the VM declares no request, so raising the ceiling alone raises what every worker in the pool asks the scheduler for, and this field is what holds the request still while the ceiling moves. Cannot be combined with `instanceType` sizing, for the same reason as `podCpuLimit`: KubeVirt refuses a VM that references an instancetype and also sets `domain.resources.requests.cpu`, so the chart rejects that combination at render time, as it does a value above `podCpuLimit`. Usable without a limit, where it only changes the scheduler's weighting: KubeVirt still derives the ceiling from the guest vCPU count in any namespace carrying a ResourceQuota that limits CPU, so keep the request at or below that count. A request above that derived ceiling is refused only when the worker's Pod is created, and deliberately not at render time: the ceiling exists only where such a ResourceQuota does, so refusing here would take away a configuration that works in a namespace without one. Zero is accepted on its own and reserves nothing, but zero beside a `podCpuLimit` is refused, because KubeVirt cannot tell an explicit zero request from an absent one and replaces both with the limit — which is the outcome this field exists to avoid, arrived at silently. A negative value is refused as well. When unset, KubeVirt computes the request from the guest vCPU count and the cluster CPU allocation ratio. Changing it rolls the pool, because the worker VM template is named by a hash of its content.
PodCpuRequest resource.Quantity `json:"podCpuRequest,omitempty"`
// List of GPUs to attach (NVIDIA driver requires at least 4 GiB RAM).
// +kubebuilder:default:={}
Gpus []GPU `json:"gpus,omitempty"`
// Kubelet resource reservations for this pool.
// Workers a rollout (instance type, image or version change) may remove before their replacement is up. Unset, it is 0, so each replacement joins before an old worker is drained, and 1 on a pool with `gpus`, whose replacement may need the very GPU the old worker holds. With 0, a rollout needs room for one extra VM: a pool short of quota or capacity for it stalls, with the new Machine Pending, until room is made or `maxUnavailable` is set to 1. Set 1 on a Proxmox pool whose template passes a GPU through: the chart cannot see that GPU, and with 0 the rollout would wait for it forever.
// +kubebuilder:validation:Minimum=0
// +kubebuilder:validation:Maximum=2.147483647e+09
MaxUnavailable *int `json:"maxUnavailable,omitempty"`
// Kernel modules loaded on every worker in this pool, emitted as Talos `machine.kernel.modules`. A Talos system extension installs a module but does not load it, so an extension-provided driver needs its modules declared here. Leave unset to let the chart decide: a pool holding at least one `nvidia.com/*` GPU gets `nvidia` (with `NVreg_NvLinkDisable=1`, which the gpu-operator driver container applies on non-Talos workers; on Talos that container has to be turned off or it clashes with the system extension, and nothing then mounts the ConfigMap carrying the parameter), `nvidia_uvm`, `nvidia_drm`, `nvidia_modeset` (that order — Talos loads the list in sequence and the last three depend on the first), and any other pool gets nothing. Set a non-empty list to replace the chart's choice entirely, or `[]` to opt out and emit no modules even on a GPU pool. The field carries no default, and unset is not the same value as `[]`: a generated parameter table that shows `[]` in its Default column is printing what it prints for any array with no default, not the effective value — leaving the field out selects the automatic set, writing `[]` disables it. The module still has to be in the image, and which extensions the image carries is the pool's schematic: a GPU pool points `osImage.factory.schematicID` (or `osImage.builtin.schematicID`) at a schematic with the NVIDIA extensions, and on Blackwell (GB202) that must be the open-kernel-modules extension. The automatic set keys on the `nvidia.com/` resource prefix alone and nothing cross-checks it against that schematic; on Talos v1.13 a declared module the image does not ship leaves its controller retrying rather than failing the boot, so the symptom is a missing driver, not a dead node. This value is part of the worker machine config, whose content hash names the `TalosConfigTemplate`, so changing it rolls every existing worker in the pool rather than only affecting nodes created later.
KernelModules []KernelModule `json:"kernelModules,omitempty"`
// Kubelet resource reservations for this pool. An empty reservation is computed from the worker's size: `resources` when set, otherwise the `instanceType`.
// +kubebuilder:default:={}
Kubelet Kubelet `json:"kubelet,omitempty"`
// Stream each worker VM's guest serial console into a `guest-console-log` container beside virt-launcher, readable with `kubectl logs`. The only view of a worker that stalls during boot before Talos apid answers, when neither a Node nor a certificate request exists to diagnose from. Two costs the field name does not show. Changing the value rolls the pool, because it is part of the worker VM template whose name is a hash of its content -- including the stuck VM whose console was wanted, so it buys visibility into the next boot rather than the current one. And it overrides the platform's cluster-wide `disableSerialConsoleLog`, set because that container has been seen holding virt-launcher in `PodInitializing` (kubevirt/kubevirt#15989), which would take the pool down rather than explain it -- so check that virt-launcher Pods reach Running after enabling it.
@@ -60,25 +66,25 @@ type ConfigSpec struct {
// Maximum number of unhealthy nodes tolerated in this pool before remediation is paused. The MachineHealthCheck admission webhook accepts either a bare integer ("0", "1", ...) or a percentage ("0%", "50%"); bare numeric strings are rejected, so the safer default is a percentage. Drop to "0%" once the pool is stable. Watch how a percentage behaves in a small group: the MachineHealthCheck controller scales it against the number of machines the check covers and rounds down, then remediates only while the unhealthy count is at or below that result. At "50%" a group of one therefore never remediates, because half of one rounds down to zero, and a group of two remediates one unhealthy machine but not two.
// +kubebuilder:default:="50%"
MaxUnhealthy string `json:"maxUnhealthy"`
// Maximum time a Machine is allowed to spend reaching the Ready condition before it is remediated. Raise for slow first boots (Talos image fetch from factory.talos.dev or a busy storage class on the kubevirt-csi PVC populator). The MachineHealthCheck measures it from the later of the Machine's creation and its InfrastructureReady transition, so the clock restarts when the infrastructure reports ready: a worker gets this long for the disk image import and the VM to come up, and then this long again for the guest to boot and its kubelet to register with the tenant apiserver. Either leg stretches on a host under load, and a Machine remediated here is deleted before it ever joins, so its replacement starts the same sequence from the beginning.
// Maximum time a Machine is allowed to spend reaching the Ready condition before it is remediated. Raise for slow first boots (the Talos image import from the Image Factory, or a storage class slow to provision or clone the worker disk). The MachineHealthCheck measures it from the later of the Machine's creation and its InfrastructureReady transition, so the clock restarts when the infrastructure reports ready: a worker gets this long for the disk image import and the VM to come up, and then this long again for the guest to boot and its kubelet to register with the tenant apiserver. Either leg stretches on a host under load, and a Machine remediated here is deleted before it ever joins, so its replacement starts the same sequence from the beginning.
// +kubebuilder:default:="20m"
NodeStartupTimeout string `json:"nodeStartupTimeout"`
// How long a worker Node may report `Ready=Unknown` before the MachineHealthCheck remediates the Machine, which for a KubeVirt worker means deleting the VM. `Ready=Unknown` is what the node lifecycle controller writes once it stops hearing from a kubelet, on a grace period of its own, so the wall clock from a guest going quiet to a deleted worker is this value plus that grace period. A guest starved of CPU stops answering long before it is dead, so a value of a few tens of seconds deletes workers that would have come back on their own. Validated at render time like maxNodeProvisionTime: the CAPI webhook does not check these timeouts, and a zero or negative value would remediate the moment the condition flips. Keep in sync with the parent kubernetes chart.
// How long a worker Node may report `Ready=Unknown` before the MachineHealthCheck remediates the Machine, which for a KubeVirt worker means deleting the VM. `Ready=Unknown` is what the node lifecycle controller writes once it stops hearing from a kubelet, on a grace period of its own, so the wall clock from a guest going quiet to a deleted worker is this value plus that grace period. A guest starved of CPU stops answering long before it is dead, so a value of a few tens of seconds deletes workers that would have come back on their own. Validated at render time like maxNodeProvisionTime: the CAPI webhook does not check these timeouts, and a zero or negative value would remediate the moment the condition flips.
// +kubebuilder:default:="5m"
ReadyUnknownTimeout string `json:"readyUnknownTimeout"`
// How long a worker Node may report `Ready=False` before the MachineHealthCheck remediates the Machine. A Node that has registered but has no working CNI yet reports `Ready=False`, so this value is the whole budget a first boot gets for the CNI rollout to reach that node, and a worker deleted mid-rollout takes the rollout with it while its replacement starts over. Raising it delays replacing a worker that is genuinely dead, but not rescheduling its workload: Pods leave an unreachable Node on the node lifecycle controller's taint-based eviction and the toleration that carries, not on this timer. Validated at render time like maxNodeProvisionTime: the CAPI webhook does not check these timeouts, and a zero or negative value would remediate the moment the condition flips. Keep in sync with the parent kubernetes chart.
// How long a worker Node may report `Ready=False` before the MachineHealthCheck remediates the Machine. A Node that has registered but has no working CNI yet reports `Ready=False`, so this value is the whole budget a first boot gets for the CNI rollout to reach that node, and a worker deleted mid-rollout takes the rollout with it while its replacement starts over. Raising it delays replacing a worker that is genuinely dead, but not rescheduling its workload: Pods leave an unreachable Node on the node lifecycle controller's taint-based eviction and the toleration that carries, not on this timer. Validated at render time like maxNodeProvisionTime: the CAPI webhook does not check these timeouts, and a zero or negative value would remediate the moment the condition flips.
// +kubebuilder:default:="10m"
ReadyFalseTimeout string `json:"readyFalseTimeout"`
// How long the cluster-autoscaler waits for a newly created worker to register as a Node before it treats that machine as long-unregistered. Rendered onto this pool's MachineDeployment as the `cluster.x-k8s.io/autoscaling-options-maxnodeprovisiontime` annotation, which overrides the autoscaler's built-in default for this pool only. Two things change when the timer fires, and both make a slow join worse rather than better: the machine stops counting towards the pool's upcoming capacity, so the autoscaler asks for a replacement for capacity that is already on its way, and the machine becomes eligible for removal. Size it above the slowest join a healthy worker can take, counting the Talos image import, the guest boot and the CNI rollout. Accepted as a whole number of seconds, minutes or hours ("30m", "1h30m"), which is narrower than Go's duration syntax on purpose: the autoscaler ignores a value it cannot parse and falls back to its own default without failing, and the narrower shape cannot express a value that overflows the parser or a fraction it rounds to zero. The canonical form a duration serializes back to ("20m0s", "1h0m0s") is accepted. Keep in sync with the parent kubernetes chart.
// How long the cluster-autoscaler waits for a newly created worker to register as a Node before it treats that machine as long-unregistered. Rendered onto this pool's MachineDeployment as the `cluster.x-k8s.io/autoscaling-options-maxnodeprovisiontime` annotation, which overrides the autoscaler's built-in default for this pool only. Two things change when the timer fires, and both make a slow join worse rather than better: the machine stops counting towards the pool's upcoming capacity, so the autoscaler asks for a replacement for capacity that is already on its way, and the machine becomes eligible for removal. Size it above the slowest join a healthy worker can take, counting the Talos image import, the guest boot and the CNI rollout. Accepted as a whole number of seconds, minutes or hours ("30m", "1h30m"), which is narrower than Go's duration syntax on purpose: the autoscaler ignores a value it cannot parse and falls back to its own default without failing, and the narrower shape cannot express a value that overflows the parser or a fraction it rounds to zero. The canonical form a duration serializes back to ("20m0s", "1h0m0s") is accepted.
// +kubebuilder:default:="30m"
MaxNodeProvisionTime string `json:"maxNodeProvisionTime"`
// Kubernetes major.minor version the pool joins. Must not be ahead of the parent cluster's minor (workers may not lead the apiserver); it may lag behind during a rolling upgrade -- bump the parent Kubernetes CR first, then each pool -- and must satisfy the Talos<->Kubernetes support matrix against `talos.version`.
// Kubernetes major.minor version the pool joins. Must not be ahead of the parent cluster's minor (workers may not lead the apiserver); it may lag behind during a rolling upgrade -- bump the parent Kubernetes CR first, then each pool. The render fails when it is ahead. Its pairing with the Talos release the pool resolves (`talos.version`, or the `osImage` override) is checked against the chart's Talos<->Kubernetes support matrix: for a Talos minor the matrix lists, a Kubernetes minor outside that minor's list is refused; a Talos minor the matrix does not list is not checked.
// +kubebuilder:default:="v1.35"
Version Version `json:"version"`
// Worker OS image source for this pool. Default (omitted): import over HTTP from the `talos.*` Image Factory. Set `osImage.builtin` to clone a golden from the opt-in worker image catalog instead. Editing this on an existing pool re-images that pool.
// +kubebuilder:default:={}
OsImage WorkerImage `json:"osImage,omitempty"`
// Talos worker image configuration. Keep in sync with the parent cluster's `talos`.
// Talos worker image configuration for this pool.
// +kubebuilder:default:={}
Talos Talos `json:"talos"`
// Which infrastructure provider backs this pool's worker VMs. `kubevirt` runs them inside this cluster on KubeVirt, sized by `instanceType` and booted from a Talos disk image CDI streams from the image factory. `proxmox` runs them on an external Proxmox VE cluster through capmox, sized by `resources`, and cloned from a Talos VM template that already exists on the hypervisor. The two substrates take different Talos platform images and different sizing inputs, so switching an existing pool is refused: the chart reads the live MachineDeployment's template kind and fails the render rather than rolling every worker to the other hypervisor and deleting the template the draining MachineSet still references. Create a new pool on the other substrate and scale this one down.
@@ -88,9 +94,6 @@ type ConfigSpec struct {
// Proxmox substrate settings.
// +kubebuilder:default:={}
Proxmox Proxmox `json:"proxmox"`
// Optional image overrides for air-gapped or rate-limited registries.
// +kubebuilder:default:={}
Images Images `json:"images"`
}
type GPU struct {
@@ -98,10 +101,11 @@ type GPU struct {
Name string `json:"name"`
}
type Images struct {
// Image used by the talos-reconcile and pre-delete unpin Jobs (kubectl). Empty falls back to images/kubectl.tag.
// +kubebuilder:default:=""
Kubectl string `json:"kubectl,omitempty"`
type KernelModule struct {
// Module name as `modprobe` takes it, e.g. `nvidia_uvm`.
Name string `json:"name"`
// Module parameters, each as a bare `key=value` string.
Parameters []string `json:"parameters,omitempty"`
}
type Kubelet struct {
@@ -111,13 +115,13 @@ type Kubelet struct {
// Soft eviction threshold for memory (absolute like 1Gi or percentage like 10%).
// +kubebuilder:default:="10%"
EvictionSoftMemory string `json:"evictionSoftMemory,omitempty"`
// CPU reserved for kubelet and container runtime. Auto-computed from instanceType if empty.
// CPU reserved for kubelet and container runtime. When empty, 5% of the worker's CPU, clamped to 50m..500m.
KubeReservedCpu string `json:"kubeReservedCpu,omitempty"`
// Memory reserved for kubelet and container runtime. Auto-computed from instanceType if empty.
// Memory reserved for kubelet and container runtime. When empty, 5% of the worker's memory, clamped to 256Mi..1Gi.
KubeReservedMemory string `json:"kubeReservedMemory,omitempty"`
// CPU reserved for host OS. Auto-computed from instanceType if empty.
// CPU reserved for host OS. When empty, 5% of the worker's CPU, clamped to 50m..500m.
SystemReservedCpu string `json:"systemReservedCpu,omitempty"`
// Memory reserved for host OS. Auto-computed from instanceType if empty.
// Memory reserved for host OS. When empty, 5% of the worker's memory, clamped to 256Mi..1Gi.
SystemReservedMemory string `json:"systemReservedMemory,omitempty"`
}
@@ -131,10 +135,13 @@ type Proxmox struct {
// NIC configuration.
// +kubebuilder:default:={}
Network ProxmoxNetwork `json:"network"`
// Proxmox resource pool the worker VMs are added to. Set the same pool on every node pool of a tenant cluster and grant the tenant's tokens their privileges on `/pool/<name>`: that is the one ACL path that follows every VM capmox creates, replacements included. The pool must exist on the hypervisor; capmox does not create it. Empty adds the workers to no pool.
// +kubebuilder:default:=""
Pool string `json:"pool,omitempty"`
// Proxmox storage for the cloned disk; needs `full: true`. A target storage is a full-clone parameter — a linked clone always lives on the template's storage, and Proxmox refuses the pair — so the render refuses it too. Empty keeps the template's storage.
// +kubebuilder:default:=""
Storage string `json:"storage,omitempty"`
// Tags identifying the Talos VM template to clone. capmox matches a template when its tag set is EQUAL to this list, not when it contains it, so every tag on the template must be listed here — a missing one yields `found 0 VM templates with tags ...` while the tags are plainly present. Required when `substrate` is `proxmox`.
// Tags identifying the Talos VM template to clone. capmox matches a template when its tag set is EQUAL to this list, not when it contains it, so every tag on the template must be listed here — a missing one yields `found 0 VM templates with tags ...` while the tags are plainly present. The template has to carry this pool's `talos.schematicID` at `talos.version` in the nocloud flavour, with the Proxmox guest agent enabled for the `qemu-guest-agent` extension of the default schematic; `hack/proxmox-talos-template.sh` builds it from these values and prints the tags to list here. Do not build it from the platform release's `nocloud-amd64.raw.xz`: that is the bare-metal node image, whose `zfs` extension keeps a VM from finishing its boot sequence and reboots it at the Talos boot timeout. Required when `substrate` is `proxmox`.
// +kubebuilder:default:={}
TemplateTags []string `json:"templateTags,omitempty"`
}
@@ -150,26 +157,32 @@ type ProxmoxNetwork struct {
}
type Resources struct {
// CPU available.
// Number of vCPU cores for each worker VM, as a whole number such as `2`. On the `kubevirt` substrate the value becomes the VM's integer `domain.cpu.cores`, so millicore, fractional and negative quantities, and counts above 4294967295, are rejected at render time; an unquoted `0` is treated as unset. On the `proxmox` substrate a millicore or fractional quantity is rounded up to whole cores.
Cpu resource.Quantity `json:"cpu,omitempty"`
// Memory (RAM) available.
Memory resource.Quantity `json:"memory,omitempty"`
}
type Talos struct {
// Default base URL of the Talos Image Factory that serves the worker OS disk image (the `openstack-amd64.raw.xz` raw artifact streamed in by CDI over HTTP). Applies only when this pool imports over HTTP — the default and `osImage.factory`, which overrides it via `osImage.factory.imageFactoryURL`. A pool on `osImage.builtin` clones a golden image from the worker image catalog and does not use this field at all. Defaults to the public factory. Point at a self-hosted Image Factory, a caching mirror, or an internal HTTP file server for air-gapped, rate-limited, or flaky-egress environments. No trailing slash. It is interpolated into the worker DataVolume source URL, so on those HTTP paths it must be a plain `http(s)` URL and the render refuses anything else; a pool on `osImage.builtin` builds no such URL and is not held to it, so blanking this field there is legal.
// Complete PEM certificate block(s) CDI must trust when importing this pool's worker OS disk image over HTTPS — the no-osImage default and `osImage.factory` path. Empty by default, so the importer uses only its system trust store, which is what the public factory needs. Set this when the factory in use (`imageFactoryURL` or `osImage.factory.imageFactoryURL`) is a self-hosted factory or mirror served by an internal CA, which the importer otherwise rejects with `x509: certificate signed by unknown authority`. The chart renders it into a ConfigMap in the release namespace — CDI requires certConfigMap to sit alongside the DataVolume — and references that from the worker DataVolume's `source.http.certConfigMap`; CDI appends it to the system pool rather than replacing it, so a publicly-trusted endpoint verifies either way. A pool on `osImage.builtin` clones a golden image and builds no HTTP source, so this field has no effect there. On `substrate: proxmox` it has no effect on the workers either: the ConfigMap is still rendered, but nothing references it.
// +kubebuilder:default:=""
ImageFactoryCA string `json:"imageFactoryCA,omitempty"`
// Default base URL of the Talos Image Factory that serves the worker OS disk image (the `openstack-amd64.raw.xz` raw artifact streamed in by CDI over HTTP). Applies only when this pool imports over HTTP — the default and `osImage.factory`, which overrides it via `osImage.factory.imageFactoryURL`. A pool on `osImage.builtin` clones a golden image from the worker image catalog and does not use this field at all. Defaults to the public factory. Point at a self-hosted Image Factory, a caching mirror, or an internal HTTP file server for air-gapped, rate-limited, or flaky-egress environments. No trailing slash. It is interpolated into the worker DataVolume source URL, so on those HTTP paths it must be a plain `http(s)` URL and the render refuses anything else; a pool on `osImage.builtin` builds no such URL and is not held to it, so blanking this field there is legal. On `substrate: proxmox` the workers clone a VM template that already carries the OS, so this field has no effect there beyond that format check.
// +kubebuilder:default:="https://factory.talos.dev"
ImageFactoryURL string `json:"imageFactoryURL"`
// OCI repository prefix for the Talos installer image used by the in-guest `talos-reconcile` upgrade Job. Resolved as `<installerRepository>/<schematicID>:<version>` against whatever this pool's `osImage` pins, falling back to `talos.schematicID` and `talos.version` — so the installer matches the OS the pool actually booted. The prefix itself has no `osImage.*` override, so an air-gapped pool needs it pointed at a reachable registry as well. Defaults to the public factory's installer path. Override for air-gapped or mirrored registries. No trailing slash.
// OCI repository prefix for the Talos installer image, written into the worker machine config as `machine.install.image`. Resolved as `<installerRepository>/<schematicID>:<version>` against whatever this pool's `osImage` pins, falling back to `talos.schematicID` and `talos.version` — so the installer matches the OS the pool actually booted. The prefix itself has no `osImage.*` override, so an air-gapped pool needs it pointed at a reachable registry as well. Defaults to the public factory's installer path. Override for air-gapped or mirrored registries. No trailing slash.
// +kubebuilder:default:="factory.talos.dev/installer"
InstallerRepository string `json:"installerRepository"`
// Talos `machine.registries.mirrors` passthrough for worker nodes: a map of upstream registry host to `{ endpoints: [ ... ] }`. Empty by default, so workers pull container images (the Talos `kubelet` image included) directly from the upstream registry. Point a host such as `ghcr.io` at an in-cluster pull-through mirror for air-gapped, rate-limited, or flaky-egress environments so a worker's boot does not depend on live public egress. Talos still falls back to the upstream registry unless a host also sets `skipFallback: true`, so a mirror alone does not enforce air-gap. Keep in sync with the parent kubernetes chart.
// Talos `machine.registries.mirrors` passthrough for worker nodes: a map of upstream registry host to `{ endpoints: [ ... ] }`. Empty by default, so workers pull container images (the Talos `kubelet` image included) directly from the upstream registry. Point a host such as `ghcr.io` at an in-cluster pull-through mirror for air-gapped, rate-limited, or flaky-egress environments so a worker's boot does not depend on live public egress. Talos still falls back to the upstream registry unless a host also sets `skipFallback: true`, so a mirror alone does not enforce air-gap. This value is part of the worker machine config, whose content hash names the TalosConfigTemplate, so changing it rolls every existing worker in the pool rather than only affecting nodes created later.
// +kubebuilder:default:={}
RegistryMirrors k8sRuntime.RawExtension `json:"registryMirrors"`
// Talos image-factory schematic ID. Defaults to the cozystack-tested vanilla schematic. Operators using custom schematics (system extensions, kernel args) override here. The pool can pin its own via `osImage.builtin.schematicID` or `osImage.factory.schematicID`; when `osImage` omits it, this value applies. Whichever of the two applies is interpolated into an image URL and a DataVolume name, so it must be a plain lowercase alphanumeric identifier -- the render refuses anything else. A custom schematic on `osImage.builtin` also needs its own catalog entry, since the golden is named from the schematic ID.
// +kubebuilder:default:="ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515"
SchematicID string `json:"schematicID"`
// Default Talos release for this pool's worker OS image and in-guest installer. The pool can pin its own release via `osImage.builtin.version` or `osImage.factory.version`; when `osImage` omits it, this value applies. Both ways in are checked against the chart's Talos<->Kubernetes support matrix, against whichever release the pool actually resolves to, so an override cannot slip past a check `talos.version` would have failed. The matrix rejects a pairing it lists as unsupported; it lists the Talos minors this chart ships and passes any other minor unchecked, so pointing either field at a Talos release the chart does not know about is the operator's call, not a checked one. Whichever release applies is interpolated into an image URL and a DataVolume name, so it must be a full `vMAJOR.MINOR.PATCH` release, optionally with a pre-release suffix -- the render refuses anything else, a minor-only `v1.13` included. The values schema types this as a bare string, so a malformed one is accepted by the CR and fails the pool's HelmRelease instead.
// Sysctl overrides rendered into Talos `machine.sysctls` on this pool's guest workers only. Values must be strings (quote numeric values); for example, `user.max_user_namespaces: "11255"` enables the user namespaces required by the Talos gVisor extension. An empty map preserves Talos defaults and the existing bootstrap hash. Adding, changing or removing an override changes the content-hashed TalosConfigTemplate and rolls the pool's workers. Supported names and values depend on the worker's Talos release and kernel; unsafe settings can weaken guest isolation or prevent workers from booting. This does not install gVisor or configure a RuntimeClass, and does not change the management hosts, control plane or other pools.
// +kubebuilder:default:={}
Sysctls map[string]string `json:"sysctls,omitempty"`
// Default Talos release for this pool's worker OS image and for the installer image written into the worker machine config. The pool can pin its own release via `osImage.builtin.version` or `osImage.factory.version`; when `osImage` omits it, this value applies. Both ways in are checked against the chart's Talos<->Kubernetes support matrix, against whichever release the pool actually resolves to, so an override cannot slip past a check `talos.version` would have failed. The matrix lists, for each Talos minor the chart knows, the Kubernetes minors it supports and refuses a pool `version` outside that list; a Talos minor it does not list passes unchecked, so pointing either field at a Talos release the chart does not know about is the operator's call, not a checked one. Whichever release applies is interpolated into an image URL and a DataVolume name, so it must be a full `vMAJOR.MINOR.PATCH` release, optionally with a pre-release suffix -- the render refuses anything else, a minor-only `v1.13` included. The values schema types this as a bare string, so a malformed one is accepted by the CR and fails the pool's HelmRelease instead.
// +kubebuilder:default:="v1.13.6"
Version string `json:"version"`
}
@@ -189,7 +202,7 @@ type WorkerImageBuiltin struct {
}
type WorkerImageFactory struct {
// Base URL of the Image Factory serving the boot raw image. Defaults to `talos.imageFactoryURL`. No trailing slash. NOTE: this redirects only the worker boot-disk import; the in-guest upgrade installer image is always sourced from `talos.installerRepository`, so an air-gapped pool must also have `talos.installerRepository` pointed at a reachable registry.
// Base URL of the Image Factory serving the boot raw image. Defaults to `talos.imageFactoryURL`. No trailing slash. This redirects only the worker boot-disk import; the installer image in the worker machine config is always sourced from `talos.installerRepository`, so an air-gapped pool must also have `talos.installerRepository` pointed at a reachable registry.
ImageFactoryURL string `json:"imageFactoryURL,omitempty"`
// Talos schematic ID. Defaults to `talos.schematicID`.
SchematicID string `json:"schematicID,omitempty"`
+28 -5
View File
@@ -67,11 +67,22 @@ func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) {
*out = make([]GPU, len(*in))
copy(*out, *in)
}
if in.MaxUnavailable != nil {
in, out := &in.MaxUnavailable, &out.MaxUnavailable
*out = new(int)
**out = **in
}
if in.KernelModules != nil {
in, out := &in.KernelModules, &out.KernelModules
*out = make([]KernelModule, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
out.Kubelet = in.Kubelet
in.OsImage.DeepCopyInto(&out.OsImage)
in.Talos.DeepCopyInto(&out.Talos)
in.Proxmox.DeepCopyInto(&out.Proxmox)
out.Images = in.Images
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSpec.
@@ -100,16 +111,21 @@ func (in *GPU) DeepCopy() *GPU {
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Images) DeepCopyInto(out *Images) {
func (in *KernelModule) DeepCopyInto(out *KernelModule) {
*out = *in
if in.Parameters != nil {
in, out := &in.Parameters, &out.Parameters
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Images.
func (in *Images) DeepCopy() *Images {
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KernelModule.
func (in *KernelModule) DeepCopy() *KernelModule {
if in == nil {
return nil
}
out := new(Images)
out := new(KernelModule)
in.DeepCopyInto(out)
return out
}
@@ -191,6 +207,13 @@ func (in *Resources) DeepCopy() *Resources {
func (in *Talos) DeepCopyInto(out *Talos) {
*out = *in
in.RegistryMirrors.DeepCopyInto(&out.RegistryMirrors)
if in.Sysctls != nil {
in, out := &in.Sysctls, &out.Sysctls
*out = make(map[string]string, len(*in))
for key, val := range *in {
(*out)[key] = val
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Talos.
+10 -7
View File
@@ -60,30 +60,33 @@ type ConfigSpec struct {
}
type Backup struct {
// Destination path for backups (e.g. s3://bucket/path/).
// Destination path for backups (e.g. s3://bucket/path/). Ignored when useSystemBucket is true (the driver injects the platform bucket).
// +kubebuilder:default:="s3://bucket/path/to/folder/"
DestinationPath string `json:"destinationPath,omitempty"`
// Enable regular backups.
// +kubebuilder:default:=false
Enabled bool `json:"enabled"`
// S3 endpoint URL for uploads.
// S3 endpoint URL for uploads. Ignored when useSystemBucket is true (the strategy supplies the platform endpoint).
// +kubebuilder:default:="http://minio-gateway-service:9000"
EndpointURL string `json:"endpointURL,omitempty"`
// Skip TLS verification for the S3 endpoint (self-signed, e.g. in-cluster seaweedfs).
// Skip TLS verification for the S3 endpoint (self-signed, e.g. in-cluster seaweedfs). Ignored when useSystemBucket is true (the platform backupStorage knob applies instead).
// +kubebuilder:default:=false
InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty"`
// Retention policy (e.g. "30d").
// Retention policy (e.g. "30d"). Ignored when useSystemBucket is true (no engine-side retention on that flow).
// +kubebuilder:default:="30d"
RetentionPolicy string `json:"retentionPolicy,omitempty"`
// Access key for S3 authentication.
// Access key for S3 authentication. Ignored when useSystemBucket is true (credentials come from the projected cozy-backups-creds).
// +kubebuilder:default:=""
S3AccessKey string `json:"s3AccessKey,omitempty"`
// Secret key for S3 authentication.
// Secret key for S3 authentication. Ignored when useSystemBucket is true (credentials come from the projected cozy-backups-creds).
// +kubebuilder:default:=""
S3SecretKey string `json:"s3SecretKey,omitempty"`
// Cron schedule for automated backups.
// Cron schedule for automated backups. Ignored when useSystemBucket is true (scheduling moves to the BackupClass Plan).
// +kubebuilder:default:="0 2 * * *"
Schedule string `json:"schedule,omitempty"`
// Opt-in: back up to the platform system bucket without supplying S3 credentials. The cozy-default MongoDB BackupClass injects the storage at BackupJob time; tenants do not set s3AccessKey/s3SecretKey/destinationPath/endpointURL, and backups scope to `<namespace>/<application>`. Scheduling moves to a BackupClass Plan; `schedule`, `retentionPolicy` and PITR are ignored while this is on, and this flow has no retention yet (see https://cozystack.io/docs/v1/operations/services/backup-classes/). Requires `backup.enabled: true` (the pbm agents run on that flag); the chart refuses the combination with `enabled: false` at render time; the schema carries the same rule as a marker for the UI and for the day the apiserver enforces CEL on application schemas (cozystack/cozystack#2657), which it does not yet. A release that has not yet rendered this flag (its cluster still carries the chart's scheduled tasks and PITR) holds a BackupJob until it does, so the tenant's own storage is never injected over.
// +kubebuilder:default:=false
UseSystemBucket bool `json:"useSystemBucket,omitempty"`
}
type Bootstrap struct {
+33
View File
@@ -39,6 +39,9 @@ type ConfigSpec struct {
// Enable the OpenBAO web UI.
// +kubebuilder:default:=true
Ui bool `json:"ui"`
// Seal configuration. The default is Shamir key shares. Set `type: static` for auto-unseal.
// +kubebuilder:default:={}
Seal Seal `json:"seal"`
}
type Resources struct {
@@ -48,5 +51,35 @@ type Resources struct {
Memory resource.Quantity `json:"memory,omitempty"`
}
type Seal struct {
// Acknowledge a seal migration. The chart refuses to change `type` on an existing instance unless this is `true`. Set it only while running `bao operator unseal -migrate`, then remove it.
// +kubebuilder:default:=false
AllowMigration bool `json:"allowMigration,omitempty"`
// Permanent identifier of the current key. OpenBAO stores it with the data the key wraps and picks the key by it, so change it whenever the key material changes. Lowercase alphanumerics, `-`, `.` and `_`, starting and ending with an alphanumeric, because the upstream chart evaluates the server config as a template and rewrites upper case placeholders such as `HOSTNAME` in it. Required when `type` is `static`.
// +kubebuilder:default:=""
// +kubebuilder:validation:Pattern="^([a-z0-9]([-a-z0-9._]*[a-z0-9])?)?$"
KeyId string `json:"keyId"`
// Identifier of the previous key, with the same character constraints as `keyId`. Required when `previousSecretName` is set.
// +kubebuilder:default:=""
// +kubebuilder:validation:Pattern="^([a-z0-9]([-a-z0-9._]*[a-z0-9])?)?$"
PreviousKeyId string `json:"previousKeyId,omitempty"`
// Secret holding the previous key during an n-1 key rotation, with the same name constraints as `secretName`. Keep it until the pods have been replaced and the active node has logged `upgrading stored keys`, see the README.
// +kubebuilder:default:=""
// +kubebuilder:validation:MaxLength=52
// +kubebuilder:validation:Pattern="^([a-z0-9]([-a-z0-9]*[a-z0-9])?)?$"
PreviousSecretName string `json:"previousSecretName,omitempty"`
// Existing Secret in the tenant namespace whose key `key` holds the base64 text of 32 random bytes (for example `openssl rand -base64 32`). A cluster administrator creates it, because tenant roles cannot create Secrets. Lowercase alphanumerics and hyphens, at most 52 characters, because the pod volume is named `userconfig-<name>` and a volume name is a DNS label. Required when `type` is `static`.
// +kubebuilder:default:=""
// +kubebuilder:validation:MaxLength=52
// +kubebuilder:validation:Pattern="^([a-z0-9]([-a-z0-9]*[a-z0-9])?)?$"
SecretName string `json:"secretName"`
// Seal type. `shamir` keeps the current behaviour, `static` enables auto-unseal from `secretName`.
// +kubebuilder:default:="shamir"
Type SealType `json:"type"`
}
// +kubebuilder:validation:Enum="t1.nano";"t1.micro";"t1.small";"t1.medium";"t1.large";"t1.xlarge";"t1.2xlarge";"t1.4xlarge";"c1.nano";"c1.micro";"c1.small";"c1.medium";"c1.large";"c1.xlarge";"c1.2xlarge";"c1.4xlarge";"s1.nano";"s1.micro";"s1.small";"s1.medium";"s1.large";"s1.xlarge";"s1.2xlarge";"s1.4xlarge";"u1.nano";"u1.micro";"u1.small";"u1.medium";"u1.large";"u1.xlarge";"u1.2xlarge";"u1.4xlarge";"m1.nano";"m1.micro";"m1.small";"m1.medium";"m1.large";"m1.xlarge";"m1.2xlarge";"m1.4xlarge";"nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
type ResourcesPreset string
// +kubebuilder:validation:Enum="shamir";"static"
type SealType string
+16
View File
@@ -55,6 +55,7 @@ func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) {
*out = *in
in.Resources.DeepCopyInto(&out.Resources)
out.Size = in.Size.DeepCopy()
out.Seal = in.Seal
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSpec.
@@ -83,3 +84,18 @@ func (in *Resources) DeepCopy() *Resources {
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Seal) DeepCopyInto(out *Seal) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Seal.
func (in *Seal) DeepCopy() *Seal {
if in == nil {
return nil
}
out := new(Seal)
in.DeepCopyInto(out)
return out
}
-9
View File
@@ -45,9 +45,6 @@ type ConfigSpec struct {
// HTTP-layer TLS configuration. Selects who issues the HTTP server certificate; TLS itself is always served.
// +kubebuilder:default:={}
Tls TLS `json:"tls"`
// Container images used by the operator.
// +kubebuilder:default:={}
Images Images `json:"images"`
// Node roles configuration.
// +kubebuilder:default:={}
NodeRoles NodeRoles `json:"nodeRoles"`
@@ -74,12 +71,6 @@ type Dashboards struct {
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
}
type Images struct {
// OpenSearch image.
// +kubebuilder:default:=""
Opensearch string `json:"opensearch"`
}
type NodeRoles struct {
// Enable data role.
// +kubebuilder:default:=true
-16
View File
@@ -56,7 +56,6 @@ func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) {
in.Resources.DeepCopyInto(&out.Resources)
out.Size = in.Size.DeepCopy()
out.Tls = in.Tls
out.Images = in.Images
out.NodeRoles = in.NodeRoles
if in.Users != nil {
in, out := &in.Users, &out.Users
@@ -94,21 +93,6 @@ func (in *Dashboards) DeepCopy() *Dashboards {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Images) DeepCopyInto(out *Images) {
*out = *in
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Images.
func (in *Images) DeepCopy() *Images {
if in == nil {
return nil
}
out := new(Images)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NodeRoles) DeepCopyInto(out *NodeRoles) {
*out = *in
+23 -3
View File
@@ -40,6 +40,9 @@ type ConfigSpec struct {
// PostgreSQL major version to deploy
// +kubebuilder:default:="v18"
Version Version `json:"version"`
// PostgreSQL image flavor, fixed when the cluster is created. `postgresql` uses the CloudNativePG PostgreSQL image. `postgis` uses the CloudNativePG PostGIS image, which adds postgis, postgis_raster, postgis_topology, postgis_sfcgal, postgis_tiger_geocoder and address_standardizer; enable them per database in `databases.<name>.extensions`. Changing the flavor of an existing cluster is refused, and a backup restores only into a cluster of the flavor it was taken from: to change flavor, create a new cluster and move the data with a logical dump (pg_dump / pg_restore).
// +kubebuilder:default:="postgresql"
Flavor Flavor `json:"flavor"`
// TLS configuration for server connections.
// +kubebuilder:default:={}
Tls TLS `json:"tls"`
@@ -55,7 +58,7 @@ type ConfigSpec struct {
// Users configuration map. Passwords are always auto-generated and stored in the `<release>-credentials` Secret; they cannot be set from values — read a user's password from that Secret. A `password` left over in values from before the field was removed is ignored by the render and draws an admission warning, but it is not inert on an upgraded release: the chart preserves whatever password is already in the Secret, which on the first upgrade is the value that was set before removal, so that value stays the live credential until it is rotated (dedicated rotation is tracked in cozystack/community#72). The live password lives only in the Secret.
// +kubebuilder:default:={}
Users map[string]User `json:"users,omitempty"`
// Databases configuration map.
// Databases configuration map. The PostgreSQL system databases `postgres`, `template0` and `template1` are refused.
// +kubebuilder:default:={}
Databases map[string]Database `json:"databases,omitempty"`
// Backup configuration.
@@ -121,7 +124,7 @@ type Backup struct {
// DEPRECATED. See `s3AccessKey`.
// +kubebuilder:default:=""
S3SecretKey string `json:"s3SecretKey,omitempty"`
// Legacy. Cron schedule (CNPG 6-field format) for the chart-emitted ScheduledBackup. Empty means no chart-managed schedule, which is the recommended setup when a `BackupClass` from `backups.cozystack.io` already drives backup orchestration. In the legacy chart-managed flow `spec.plugins` plus the barman-cloud ObjectStore is rendered when `backup.enabled=true` AND `useSystemBucket=false` AND `destinationPath` is non-empty AND inline-or-external creds are supplied; in the platform `useSystemBucket=true` flow the chart skips emitting `spec.plugins` and the CNPG driver SSA-applies the ObjectStore and patches `spec.plugins` onto the live Cluster at first BackupJob time.
// Legacy. Cron schedule for the chart-emitted ScheduledBackup, either a standard five-field cron such as `0 2 * * *` for every day at 02:00, or six fields with leading seconds such as `0 0 2 * * *` for the same time. Empty means no chart-managed schedule, which is the recommended setup when a `BackupClass` from `backups.cozystack.io` already drives backup orchestration. In the legacy chart-managed flow `spec.plugins` plus the barman-cloud ObjectStore is rendered when `backup.enabled=true` AND `useSystemBucket=false` AND `destinationPath` is non-empty AND inline-or-external creds are supplied; in the platform `useSystemBucket=true` flow the chart skips emitting `spec.plugins` and the CNPG driver SSA-applies the ObjectStore and patches `spec.plugins` onto the live Cluster at first BackupJob time.
// +kubebuilder:default:=""
Schedule string `json:"schedule,omitempty"`
// Opt-in: when true, the chart-emitted `<release>-s3-creds` Secret is skipped AND `spec.plugins` (plus the barman-cloud ObjectStore) is left UNSET in the chart-rendered Cluster — the cozy-default BackupClass driver SSA-applies an ObjectStore (carrying destinationPath/endpointURL/credentials) and patches `spec.plugins` on the live Cluster when the first BackupJob runs. Consequence: plugin WAL archiving is NOT active until that first BackupJob fires; WAL accumulates on the PVC in the meantime, so fire an ad-hoc BackupJob immediately after enabling the flag on existing releases. Use together with the platform `cozy-default` BackupClass — tenants do not need to fill `s3AccessKey`/`s3SecretKey` or `destinationPath`/`endpointURL`. The destination path automatically scopes to `s3://cozy-backups/<namespace>/<release>/`.
@@ -130,6 +133,9 @@ type Backup struct {
}
type Bootstrap struct {
// Barman ID of the base backup to recover from, passed as `recoveryTarget.backupID`. Empty lets the barman-cloud plugin pick one: the newest backup when `recoveryTime` is empty, otherwise the newest one ending at or before it, on any timeline. The CNPG backup driver sets this on restore.
// +kubebuilder:default:=""
BackupID string `json:"backupID,omitempty"`
// Whether to restore from a backup.
// +kubebuilder:default:=false
Enabled bool `json:"enabled"`
@@ -174,6 +180,8 @@ type PostgreSQL struct {
// PostgreSQL server parameters. Values may be strings or integers; integers are coerced to strings by the template (e.g. both `max_connections: 100` and `max_connections: "100"` are accepted). BLOCKED (enable arbitrary code execution): archive_command, restore_command, ssl_passphrase_command, archive_cleanup_command, recovery_end_command, dynamic_library_path, local_preload_libraries, session_preload_libraries, shared_preload_libraries. Do NOT override CloudNativePG-managed parameters: archive_mode, primary_conninfo, wal_level, max_replication_slots.
// +kubebuilder:default:={"max_connections":"100"}
Parameters map[string]intstr.IntOrString `json:"parameters,omitempty"`
// Libraries loaded at server start, restricted to an allowlist of modules already shipped in the PostgreSQL image. CloudNativePG also preloads `pg_stat_statements`, `auto_explain` and `pgaudit` by itself whenever `parameters` sets a key under their prefix (e.g. `pg_stat_statements.track`), so removing one of them from this list does not unload it while such a key is set; `pg_prewarm` is preloaded only through this list. Changing the list restarts PostgreSQL on every instance, the primary included, so writes pause briefly.
SharedPreloadLibraries []PreloadLibrary `json:"sharedPreloadLibraries,omitempty"`
}
type Quorum struct {
@@ -205,15 +213,27 @@ type S3CredentialsSecret struct {
}
type TLS struct {
// Tri-state switch controlling whether the chart injects the external hostname into the operator-managed CNPG cert via spec.certificates.serverAltDNSNames. When omitted, the chart injects the SAN if `external: true` and skips it otherwise. Set explicitly to `true` to inject regardless of `external` (no-op when `external: false` since there is no external hostname to add). Set to `false` to skip injection. Note that CNPG keeps its built-in TLS on the wire regardless of this flag — this toggle only controls the chart-side SAN injection; to disable PostgreSQL TLS entirely set `postgresql.parameters.ssl = "off"` at the CNPG layer.
// Tri-state switch controlling whether the chart injects the external hostnames into the operator-managed CNPG cert via spec.certificates.serverAltDNSNames. When omitted, the chart injects them if `external: true` and skips them otherwise. Set explicitly to `true` to inject regardless of `external` (no-op when `external: false` since there is no external hostname to add). Set to `false` to skip injection. Note that CNPG keeps its built-in TLS on the wire regardless of this flag — this toggle only controls the chart-side SAN injection; to disable PostgreSQL TLS entirely set `postgresql.parameters.ssl = "off"` at the CNPG layer.
Enabled *bool `json:"enabled,omitempty"`
// Tri-state switch controlling whether the server refuses sessions that are not encrypted. When omitted, it is on if `external: true` and off otherwise. When on, the chart renders `spec.postgresql.pg_hba` with `hostssl all all all scram-sha-256` (`md5` on PostgreSQL 13, matching CloudNativePG's default rule) followed by `host all all all reject`, so a client that connects with `sslmode=disable` is refused instead of getting a plaintext session; in-cluster clients are held to the same rule, since the pod network cannot be told apart from an external client. Set to `false` to keep accepting plaintext sessions on an external instance, or to `true` to require TLS on an in-cluster one. Rendering fails if `postgresql.parameters.ssl` is off while this is in effect.
Required *bool `json:"required,omitempty"`
}
type User struct {
// Whether the user can bypass row-level security policies (BYPASSRLS). A role can only create other roles carrying BYPASSRLS if it holds the attribute itself, so this is required alongside `createRole` to provision a privileged service role.
BypassRls bool `json:"bypassRls,omitempty"`
// Whether the user can create and manage roles (CREATEROLE). Requires PostgreSQL 16 or newer. Setting it back to `false` withdraws the attribute only: the roles the user created, and its ADMIN and SET memberships in them, stay. Once any user has held it, the chart no longer adopts an existing role it did not create, so a user or database declared later under the name of such a role fails the init job until a platform administrator drops that role.
CreateRole bool `json:"createRole,omitempty"`
// Whether the user has replication privileges.
Replication bool `json:"replication,omitempty"`
}
// +kubebuilder:validation:Enum="postgresql";"postgis"
type Flavor string
// +kubebuilder:validation:Enum="pg_stat_statements";"auto_explain";"pgaudit";"pg_prewarm"
type PreloadLibrary string
// +kubebuilder:validation:Enum="ReadConnections";"ReadCPUUtilization"
type ReadMetric string
+10
View File
@@ -206,6 +206,11 @@ func (in *PostgreSQL) DeepCopyInto(out *PostgreSQL) {
(*out)[key] = val
}
}
if in.SharedPreloadLibraries != nil {
in, out := &in.SharedPreloadLibraries, &out.SharedPreloadLibraries
*out = make([]PreloadLibrary, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostgreSQL.
@@ -273,6 +278,11 @@ func (in *TLS) DeepCopyInto(out *TLS) {
*out = new(bool)
**out = **in
}
if in.Required != nil {
in, out := &in.Required, &out.Required
*out = new(bool)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TLS.
+4
View File
@@ -7,6 +7,7 @@ package rabbitmq
import (
resource "k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/apis/meta/v1"
k8sRuntime "k8s.io/apimachinery/pkg/runtime"
)
// +kubebuilder:object:root=true
@@ -36,6 +37,9 @@ type ConfigSpec struct {
// Enable external access from outside the cluster.
// +kubebuilder:default:=false
External bool `json:"external"`
// Pod affinity applied to RabbitMQ pods (standard Kubernetes corev1.Affinity). Use podAntiAffinity with topologyKey `kubernetes.io/hostname` to spread RabbitMQ pods across nodes.
// +kubebuilder:default:={}
Affinity *k8sRuntime.RawExtension `json:"affinity,omitempty"`
// TLS configuration. TLS is off unless `tls.enabled` is set to true.
// +kubebuilder:default:={}
Tls TLS `json:"tls,omitempty"`
+6 -1
View File
@@ -21,7 +21,7 @@ limitations under the License.
package rabbitmq
import (
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
@@ -55,6 +55,11 @@ func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) {
*out = *in
in.Resources.DeepCopyInto(&out.Resources)
out.Size = in.Size.DeepCopy()
if in.Affinity != nil {
in, out := &in.Affinity, &out.Affinity
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
out.Tls = in.Tls
if in.Users != nil {
in, out := &in.Users, &out.Users
+43 -3
View File
@@ -7,6 +7,7 @@ package redis
import (
resource "k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/apis/meta/v1"
k8sRuntime "k8s.io/apimachinery/pkg/runtime"
)
// +kubebuilder:object:root=true
@@ -17,7 +18,7 @@ type Config struct {
}
type ConfigSpec struct {
// Number of Redis replicas.
// Number of Redis replicas. Three Sentinels watch them, or a single one when `replicas` is 1, since a lone pod has no replica to fail over to.
// +kubebuilder:default:=2
Replicas int `json:"replicas"`
// Explicit CPU and memory configuration for each Redis replica. When omitted, the preset defined in `resourcesPreset` is applied.
@@ -26,6 +27,9 @@ type ConfigSpec struct {
// Default sizing preset used when `resources` is omitted.
// +kubebuilder:default:="t1.nano"
ResourcesPreset ResourcesPreset `json:"resourcesPreset"`
// Kubernetes affinity configuration for Redis and Sentinel pods.
// +kubebuilder:default:={}
Affinity AffinitySpec `json:"affinity,omitempty"`
// Persistent Volume Claim size available for application data.
// +kubebuilder:default:="1Gi"
Size resource.Quantity `json:"size"`
@@ -33,10 +37,10 @@ type ConfigSpec struct {
// +kubebuilder:default:=""
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="storageClass is immutable"
StorageClass string `json:"storageClass"`
// Enable external access from outside the cluster.
// Enable external access from outside the cluster. Can be enabled only when the instance is created, together with `tls.enabled: true`; turning it on for an existing instance, or changing `tls.enabled` while it is on, is refused at admission.
// +kubebuilder:default:=false
External bool `json:"external"`
// Redis major version to deploy
// Redis major version to deploy. The Redis and Sentinel pods run the same image.
// +kubebuilder:default:="v8"
Version Version `json:"version"`
// TLS configuration. TLS is opt-in and is not inferred from `external`.
@@ -45,6 +49,32 @@ type ConfigSpec struct {
// Enable password generation.
// +kubebuilder:default:=true
AuthEnabled bool `json:"authEnabled"`
// Redis `min-replicas-to-write`: the master refuses writes unless at least this many replicas are connected and within `minReplicasMaxLag`. Unset by default, which leaves the Redis default (disabled). With `replicas: 2` and a value of 1 the master rejects writes while its only replica is down, trading availability for a bound on the writes lost if an isolated master is failed over. Replication stays asynchronous, so this bounds the loss, it does not remove it. Must be 0 or more and below `replicas` (a master with `replicas` pods has `replicas - 1` replicas), otherwise every write is refused; the chart refuses such a value.
// +kubebuilder:validation:Minimum=0
MinReplicasToWrite *int `json:"minReplicasToWrite,omitempty"`
// Redis `min-replicas-max-lag`, in seconds: a replica whose last acknowledgement is older than this does not count towards `minReplicasToWrite`. Unset by default, which leaves the Redis default (10). Has no effect unless `minReplicasToWrite` is set. Must be at least 1 when `minReplicasToWrite` is set: Redis treats 0 as disabling the check, so the chart refuses it.
// +kubebuilder:validation:Minimum=0
MinReplicasMaxLag *int `json:"minReplicasMaxLag,omitempty"`
// Redis `maxmemory`: the dataset size at which Redis applies `maxmemoryPolicy`. Unset by default, which renders `maxmemory 0` (no limit, the Redis default), so a value set by hand with `CONFIG SET` is reset on the next reconcile. Must be at most 90% of the memory request of each Redis pod (from `resources` or `resourcesPreset`): the operator silently drops a larger value, so the chart refuses it. Leave headroom below that for replication and snapshot buffers.
Maxmemory resource.Quantity `json:"maxmemory,omitempty"`
// Redis `maxmemory-policy`: what Redis does once `maxmemory` is reached. `noeviction` refuses writes; `allkeys-lru` evicts the least recently used keys, which suits an instance used purely as a cache. Has no effect while `maxmemory` is unset.
// +kubebuilder:default:="noeviction"
MaxmemoryPolicy MaxmemoryPolicy `json:"maxmemoryPolicy"`
// Write RDB snapshots to the persistent volume (the Redis `save` directive, with the Redis default schedule). Set to `false` for an instance used purely as a cache: `save ""` is rendered and the volume is kept, so no further scheduled snapshot is written while replicas still have room for the full-sync RDB they write to disk. An RDB file already on the volume is not removed, and Redis loads it on restart, so turning snapshots off does not by itself empty the dataset. Always off when `size` is empty.
// +kubebuilder:default:=true
Snapshots bool `json:"snapshots"`
// Sentinel configuration. When `sentinel.resources` is empty and `sentinel.resourcesPreset` is unset, the Sentinel pods are sized like the Redis pods (`resources` and `resourcesPreset`). An empty `sentinel.resources` map counts as unset, as an empty top-level `resources` does.
// +kubebuilder:default:={}
Sentinel Sentinel `json:"sentinel,omitempty"`
}
type AffinitySpec struct {
// Kubernetes Affinity for Redis pods. When set, redis-operator uses it verbatim and does not add its default soft podAntiAffinity; include podAntiAffinity unless replica co-location is intended.
// +kubebuilder:default:={}
Redis *k8sRuntime.RawExtension `json:"redis,omitempty"`
// Kubernetes Affinity for Sentinel pods. When set, redis-operator uses it verbatim and does not add its default soft podAntiAffinity; include podAntiAffinity unless replica co-location is intended.
// +kubebuilder:default:={}
Sentinel *k8sRuntime.RawExtension `json:"sentinel,omitempty"`
}
type Resources struct {
@@ -54,6 +84,13 @@ type Resources struct {
Memory resource.Quantity `json:"memory,omitempty"`
}
type Sentinel struct {
// Explicit CPU and memory configuration for each Sentinel pod. Keys left out are filled from the preset in `sentinel.resourcesPreset`.
Resources Resources `json:"resources,omitempty"`
// Sizing preset for the Sentinel pods. Defaults to `resourcesPreset`.
ResourcesPreset ResourcesPreset `json:"resourcesPreset,omitempty"`
}
type TLS struct {
// Maps to the Redis `tls-auth-clients` directive. Defaults to `no` — the server certificate is presented but client certificates are not validated. `yes` requires a client certificate signed by this release's CA, which the platform does not issue. Changing it restarts the Redis and Sentinel pods, because the directive is read from the config file once at startup.
AuthClients AuthClients `json:"authClients,omitempty"`
@@ -64,6 +101,9 @@ type TLS struct {
// +kubebuilder:validation:Enum="no";"optional";"yes"
type AuthClients string
// +kubebuilder:validation:Enum="noeviction";"allkeys-lru";"allkeys-lfu";"allkeys-random";"volatile-lru";"volatile-lfu";"volatile-random";"volatile-ttl"
type MaxmemoryPolicy string
// +kubebuilder:validation:Enum="t1.nano";"t1.micro";"t1.small";"t1.medium";"t1.large";"t1.xlarge";"t1.2xlarge";"t1.4xlarge";"c1.nano";"c1.micro";"c1.small";"c1.medium";"c1.large";"c1.xlarge";"c1.2xlarge";"c1.4xlarge";"s1.nano";"s1.micro";"s1.small";"s1.medium";"s1.large";"s1.xlarge";"s1.2xlarge";"s1.4xlarge";"u1.nano";"u1.micro";"u1.small";"u1.medium";"u1.large";"u1.xlarge";"u1.2xlarge";"u1.4xlarge";"m1.nano";"m1.micro";"m1.small";"m1.medium";"m1.large";"m1.xlarge";"m1.2xlarge";"m1.4xlarge";"nano";"micro";"small";"medium";"large";"xlarge";"2xlarge"
type ResourcesPreset string
+55 -1
View File
@@ -21,9 +21,34 @@ limitations under the License.
package redis
import (
runtime "k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
)
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AffinitySpec) DeepCopyInto(out *AffinitySpec) {
*out = *in
if in.Redis != nil {
in, out := &in.Redis, &out.Redis
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
if in.Sentinel != nil {
in, out := &in.Sentinel, &out.Sentinel
*out = new(runtime.RawExtension)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AffinitySpec.
func (in *AffinitySpec) DeepCopy() *AffinitySpec {
if in == nil {
return nil
}
out := new(AffinitySpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Config) DeepCopyInto(out *Config) {
*out = *in
@@ -54,8 +79,21 @@ func (in *Config) DeepCopyObject() runtime.Object {
func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) {
*out = *in
in.Resources.DeepCopyInto(&out.Resources)
in.Affinity.DeepCopyInto(&out.Affinity)
out.Size = in.Size.DeepCopy()
in.Tls.DeepCopyInto(&out.Tls)
if in.MinReplicasToWrite != nil {
in, out := &in.MinReplicasToWrite, &out.MinReplicasToWrite
*out = new(int)
**out = **in
}
if in.MinReplicasMaxLag != nil {
in, out := &in.MinReplicasMaxLag, &out.MinReplicasMaxLag
*out = new(int)
**out = **in
}
out.Maxmemory = in.Maxmemory.DeepCopy()
in.Sentinel.DeepCopyInto(&out.Sentinel)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigSpec.
@@ -85,6 +123,22 @@ func (in *Resources) DeepCopy() *Resources {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Sentinel) DeepCopyInto(out *Sentinel) {
*out = *in
in.Resources.DeepCopyInto(&out.Resources)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Sentinel.
func (in *Sentinel) DeepCopy() *Sentinel {
if in == nil {
return nil
}
out := new(Sentinel)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TLS) DeepCopyInto(out *TLS) {
*out = *in
+4 -1
View File
@@ -26,10 +26,13 @@ type ConfigSpec struct {
// Deploy own Monitoring Stack.
// +kubebuilder:default:=false
Monitoring bool `json:"monitoring"`
// Send this tenant's traces to the shared VictoriaTraces store in tenant-root instead of a per-tenant backend; its Grafana reads them through a vmauth there that pins the tenant's own account, so tenants sharing the store cannot read each other's traces. It needs the tenant's own Monitoring (`monitoring: true`) and tenant-root hosting the store (`tracingCentralHost: true` on its Monitoring, with a `cluster`-mode tracingStorages entry named `generic`); without that the tenant's monitoring render fails rather than dropping spans. tenant-root, and whoever it admits to its Grafana, are inside the store's trust boundary. Applications should export over OTLP/HTTP, in requests below 3 MiB: spans above the platform's per-tenant write rate are retried over HTTP but dropped over gRPC, and a larger request is refused and not retried.
// +kubebuilder:default:=false
TracingCentral bool `json:"tracingCentral"`
// Deploy own Ingress Controller.
// +kubebuilder:default:=false
Ingress bool `json:"ingress"`
// Deploy own Gateway API Gateway (backed by Cilium Gateway API controller). When unset (the default), the chart auto-enables the Gateway for tenants whose apex is derived from the parent (i.e. `host` is empty), and leaves it off for tenants with a custom non-derived apex. Set to `true` or `false` explicitly to override that auto-behaviour. Note: leave the key absent (do not write `gateway: null`) — the chart distinguishes "unset" via missing-key, not via null value, to satisfy the JSON schema generated from this comment.
// Deploy own Gateway API Gateway (backed by Cilium Gateway API controller). When unset (the default) or set to `false`, the tenant does not own a Gateway and instead publishes through the nearest ancestor tenant that owns one, regardless of whether `host` is empty or custom (`false` currently behaves the same as unset and does not opt out of that inheritance). Set to `true` to give the tenant its own Gateway with its own LoadBalancer IP and Certificate. A tenant with a custom (non-derived) `host` that needs its apex publicly reachable must set `true` explicitly, because an ancestor's TLS certificate does not cover a custom apex. Note: leave the key absent (do not write `gateway: null`): the chart distinguishes "unset" via missing-key, not via null value, to satisfy the JSON schema generated from this comment.
Gateway bool `json:"gateway,omitempty"`
// GatewayClass for this tenant's own Gateway. Empty uses the platform default (`gateway.className`). Only the classes the operator lists in the platform's `gateway.tenantSelectableClasses`, plus that default, may be named here — anything else fails this tenant's own gateway release and reaches no other tenant. Read only when this tenant owns a Gateway; an inheriting tenant uses its ancestor's. Whether a class terminates TLS itself or at its provider's edge is declared once per class on the platform, not here.
// +kubebuilder:default:=""
+10 -4
View File
@@ -65,12 +65,18 @@ type ConfigSpec struct {
// Cloud-init user data.
// +kubebuilder:default:=""
CloudInit string `json:"cloudInit"`
// Supply cloud-init network-data that requests DHCP on every `en*` and `eth*` interface and keeps the DNS search domains DHCP offers. Needed for a netplan guest (Ubuntu, Debian) to address a secondary network such as a VPC subnet. Leave it off for a guest rendered by anything other than netplan, which would lose DHCP on every interface, and for a guest that configures an interface statically through netplan, which this configuration would shadow. Turning it on for a VM that has neither `cloudInit` nor `sshKeys` adds a cloud-init disk, and the guest's next boot is then treated as a first boot.
// +kubebuilder:default:=false
NetplanDhcp bool `json:"netplanDhcp"`
// Seed string to generate SMBIOS UUID for the VM.
// +kubebuilder:default:=""
CloudInitSeed string `json:"cloudInitSeed"`
}
type Disk struct {
// Boot priority of the disk, 1 being tried first. Unset falls back to the disk's position in `disks` (the first disk gets 1), so set it to boot from a disk other than the first, such as an attached installer or rescue ISO, without reordering the list. Effective boot orders must be unique across disks: when one disk is given a value that another takes from its position, set both.
// +kubebuilder:validation:Minimum=1
BootOrder *int `json:"bootOrder,omitempty"`
// Disk bus type (e.g. "sata").
Bus string `json:"bus,omitempty"`
// Disk name.
@@ -80,7 +86,7 @@ type Disk struct {
type Firmware struct {
// Bootloader to boot the VM with: "uefi" (OVMF) or "bios" (SeaBIOS). Empty inherits the instanceProfile default.
Bootloader string `json:"bootloader,omitempty"`
// Persist EFI NVRAM (e.g. enrolled Secure Boot keys, such as an updated Microsoft UEFI CA) across reboots. Only applies when bootloader is "uefi". On default RWO storage the VM is node-pinned (no live-migration).
// Persist EFI NVRAM (e.g. enrolled Secure Boot keys, such as an updated Microsoft UEFI CA) across reboots. Only applies when bootloader is "uefi".
EfiPersistent bool `json:"efiPersistent,omitempty"`
// Enable UEFI Secure Boot. Only applies when bootloader is "uefi".
SecureBoot bool `json:"secureBoot,omitempty"`
@@ -97,11 +103,11 @@ type Network struct {
}
type Resources struct {
// Number of CPU cores allocated, as a positive whole number such as `2`. Millicore and fractional quantities are rejected at render time, because the value becomes the VM's integer `domain.cpu.cores`.
// Number of CPU cores allocated, as a positive whole number such as `2`. Millicore or other unit-suffixed, fractional, zero, negative, above 4294967295 and quoted leading-zero values are rejected at render time, because the value becomes the VM's unsigned integer `domain.cpu.cores`.
Cpu resource.Quantity `json:"cpu,omitempty"`
// Amount of memory allocated, as a positive quantity such as `8Gi`.
// Amount of memory allocated, as a quantity of at least `1M` such as `8Gi`. Less than 1M is rejected at render time, because KubeVirt refuses a non-zero amount below 1M and a zero or negative amount sizes nothing.
Memory resource.Quantity `json:"memory,omitempty"`
// Number of CPU sockets (vCPU topology), as a positive whole number such as `1`. Millicore and fractional quantities are rejected at render time, because the value becomes the VM's integer `domain.cpu.sockets`.
// Number of CPU sockets (vCPU topology), as a positive whole number such as `1`. Millicore or other unit-suffixed, fractional, zero, negative, above 4294967295 and quoted leading-zero values are rejected at render time, because the value becomes the VM's unsigned integer `domain.cpu.sockets`.
Sockets resource.Quantity `json:"sockets,omitempty"`
}
+8 -1
View File
@@ -61,7 +61,9 @@ func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) {
if in.Disks != nil {
in, out := &in.Disks, &out.Disks
*out = make([]Disk, len(*in))
copy(*out, *in)
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Networks != nil {
in, out := &in.Networks, &out.Networks
@@ -100,6 +102,11 @@ func (in *ConfigSpec) DeepCopy() *ConfigSpec {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Disk) DeepCopyInto(out *Disk) {
*out = *in
if in.BootOrder != nil {
in, out := &in.BootOrder, &out.BootOrder
*out = new(int)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Disk.
+2
View File
@@ -42,6 +42,8 @@ type Route struct {
}
type Subnet struct {
// Additional source CIDRs admitted into this private subnet, such as remote networks routed in through a gateway VM
AllowSubnets []string `json:"allowSubnets,omitempty"`
// IP address range
Cidr string `json:"cidr,omitempty"`
// Subnet name
+8 -1
View File
@@ -56,7 +56,9 @@ func (in *ConfigSpec) DeepCopyInto(out *ConfigSpec) {
if in.Subnets != nil {
in, out := &in.Subnets, &out.Subnets
*out = make([]Subnet, len(*in))
copy(*out, *in)
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
if in.Peers != nil {
in, out := &in.Peers, &out.Peers
@@ -113,6 +115,11 @@ func (in *Route) DeepCopy() *Route {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Subnet) DeepCopyInto(out *Subnet) {
*out = *in
if in.AllowSubnets != nil {
in, out := &in.AllowSubnets, &out.AllowSubnets
*out = make([]string, len(*in))
copy(*out, *in)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Subnet.
@@ -66,6 +66,13 @@ type AltinitySpec struct {
// exposes .Name, .Namespace, and
// .ApplicationRef.{APIGroup,Kind,Name} so to-copy
// restores can address the source release.
//
// Stored schemaless: the apiserver keeps it as written rather than
// checking it against the pod schema, and it is validated when the
// driver creates the workload from it.
//
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
Template corev1.PodTemplateSpec `json:"template"`
}
+5 -2
View File
@@ -79,8 +79,11 @@ type CNPGTemplate struct {
BarmanObjectStore BarmanObjectStoreTemplate `json:"barmanObjectStore"`
// ServerName overrides the Barman server name used as the storage path
// prefix. When empty, the driver defaults it to the application name.
// Templating is supported.
// prefix. When empty, the driver defaults it to the Cluster name suffixed
// with the application UID, so a recreated application never archives
// into its predecessor's prefix. A Cluster that already has the
// barman-cloud plugin attached keeps its serverName. Templating is
// supported.
// +optional
ServerName string `json:"serverName,omitempty"`
}
+2 -2
View File
@@ -107,8 +107,8 @@ type EtcdTemplate struct {
// Until the upstream gains symmetric semantics (or surfaces the final
// file path via the equivalent of BackupSnapshot.URI for PVC), this
// driver intentionally narrows the API contract to S3 only. The S3
// path is fully exercised end-to-end on dev7 and covered by unit +
// e2e tests.
// path is fully exercised end-to-end on a test cluster and covered by
// unit + e2e tests.
// +kubebuilder:validation:XValidation:rule="has(self.s3)",message="s3 destination is required (PVC is intentionally not supported by this strategy until upstream restore-agent reads the same path the backup-agent writes; see the strategy comments)"
type EtcdDestinationTemplate struct {
// S3 configures an S3-compatible storage target. Templating is
@@ -108,7 +108,14 @@ type FoundationDBTemplate struct {
// Admins use it to mount credentials, CA bundles, or any other
// per-tenant secrets the backup_agent needs. Templating is supported
// on every string field.
//
// Stored schemaless: the apiserver keeps it as written rather than
// checking it against the pod schema, and it is validated when the
// driver creates the workload from it.
//
// +optional
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
BackupDeploymentPodTemplateSpec *corev1.PodTemplateSpec `json:"backupDeploymentPodTemplateSpec,omitempty"`
}
@@ -15,6 +15,17 @@ limitations under the License.
*/
// Package v1alpha1 contains API Schema definitions for the v1alpha1 API group.
//
// Fields that embed a large upstream struct, a PodTemplateSpec above all, are
// marked Schemaless with PreserveUnknownFields. backupstrategy-controller
// renders these CRDs from templates, so Helm stores each one twice in every
// release revision, and a revision is one Secret capped at 1 MiB; with the
// upstream schemas inlined the revision that renders the default strategies
// no longer fits and that upgrade fails. The Go types stay typed, and the
// apiserver validates the content when a driver creates the workload from it.
// hack/strategy-crd-schemaless.bats fails on a strategy CRD that inlines a
// pod template schema.
//
// +kubebuilder:object:generate=true
// +groupName=strategy.backups.cozystack.io
package v1alpha1
@@ -61,6 +61,13 @@ type JobSpec struct {
// - `.Parameters` — the resolved BackupClass strategy parameters.
// - `.Backup` — only on restore runs: `.Backup.Name`, `.Backup.Namespace`
// and `.Backup.ApplicationRef` describing the source backup.
//
// Stored schemaless: the apiserver keeps it as written rather than
// checking it against the pod schema, and it is validated when the
// driver creates the workload from it.
//
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
Template corev1.PodTemplateSpec `json:"template"`
}
+4 -5
View File
@@ -71,11 +71,10 @@ type KafkaSpec struct {
// - `.Backup` — only on restore: `.Backup.Name`, `.Backup.Namespace` and
// `.Backup.ApplicationRef` describing the source backup.
//
// Stored schemaless deliberately: the full PodTemplateSpec OpenAPI schema is
// ~590 KB, and inlining it here (after Altinity/Job/FoundationDB) would push
// the chart's Helm state Secret over the 1 MiB cap. See job_types.go for the
// same field carried with its schema, and strategy-kafka-default.yaml for
// the rendered pod.
// Stored schemaless: the apiserver keeps it as written rather than
// checking it against the pod schema, and it is validated when the
// driver creates the workload from it. See
// strategy-kafka-default.yaml for the rendered pod.
//
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
@@ -0,0 +1,95 @@
// SPDX-License-Identifier: Apache-2.0
// Package v1alpha1 defines strategy.backups.cozystack.io API types.
//
// Group: strategy.backups.cozystack.io
// Version: v1alpha1
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
)
func init() {
SchemeBuilder.Register(func(s *runtime.Scheme) error {
s.AddKnownTypes(GroupVersion,
&Kubernetes{},
&KubernetesList{},
)
return nil
})
}
const (
KubernetesStrategyKind = "Kubernetes"
)
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// Kubernetes defines a backup strategy for a tenant Kubernetes application.
// A tenant cluster keeps its state in two places the platform can reach: the
// cluster's key prefix in the tenant's shared etcd DataStore, and host-side
// objects (control-plane PKI Secrets, the application HelmReleases, and the
// DataVolumes that back the tenant's PersistentVolumes). The strategy captures
// the first with a one-shot Job and the second with Velero. The two are taken
// one after another, so a backup is crash-consistent at best.
type Kubernetes struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec KubernetesSpec `json:"spec,omitempty"`
Status KubernetesStatus `json:"status,omitempty"`
}
// +kubebuilder:object:root=true
// KubernetesList contains a list of Kubernetes backup strategies.
type KubernetesList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Kubernetes `json:"items"`
}
// KubernetesSpec specifies the desired behavior of a Kubernetes backup strategy.
type KubernetesSpec struct {
// Template holds a PodTemplateSpec for the Job that dumps the cluster's
// key prefix from its etcd DataStore to object storage, writes it back on
// restore, and deletes the object on cleanup. The Job runs in the
// application namespace. Helm-like Go templates are supported in every
// string field and are rendered against:
// - `.Release.Name` and `.Release.Namespace` — the application's name and
// namespace; `.Release.Prefix` is `kubernetes-`.
// - `.Mode` — `"backup"`, `"restore"` or `"cleanup"`.
// - `.ObjectKey` — the object-storage key of this backup's dump.
// - `.Datastore.Prefix` — the cluster's key prefix, without slashes.
// - `.Datastore.Endpoints` — comma-separated etcd client URLs.
// - `.Datastore.CertificateSecret` — the Secret holding the cluster's
// etcd client certificate (`ca.crt`, `server.crt`, `server.key`).
// - `.Parameters` — the resolved BackupClass strategy parameters.
//
// Stored schemaless for the same CRD-size reason as redis_types.go.
//
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
Template corev1.PodTemplateSpec `json:"template"`
// Velero holds the Velero Backup and Restore specs for the host-side
// objects and volumes. Rendered against `.Application` and `.Parameters`,
// like the Velero strategy.
//
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
Velero VeleroTemplate `json:"velero"`
// CertificateWarningThreshold is how close to expiry a control-plane
// certificate may be before a backup records a warning. Defaults to 720h.
// +optional
CertificateWarningThreshold *metav1.Duration `json:"certificateWarningThreshold,omitempty"`
}
type KubernetesStatus struct {
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
+52 -8
View File
@@ -37,11 +37,14 @@ const (
// carrying the S3 destination read back from the source backup, so the same
// artifact restores in-place or into a differently-named instance.
//
// Unlike the MariaDB strategy, the storage config is NOT inlined here: psmdb
// resolves spec.storageName against the source cluster's spec.backup.storages,
// so the S3/credentials live on the PerconaServerMongoDB CR (the mongodb chart
// declares them when backup.enabled=true) and the strategy only names the
// storage to use.
// The strategy always names the storage (spec.template.storageName) psmdb
// resolves against the source cluster's spec.backup.storages. On the legacy
// flow the S3/credentials for that storage live on the PerconaServerMongoDB CR
// (the mongodb chart declares them when backup.enabled=true and
// useSystemBucket=false). On the useSystemBucket flow the chart cannot know the
// platform bucket at render time, so the strategy also carries the storage's S3
// coordinates (spec.template.s3) and the driver SSA-injects them onto the
// cluster at BackupJob time.
type MongoDB struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -75,9 +78,11 @@ type MongoDBSpec struct {
// MongoDBTemplate describes the templated PerconaServerMongoDBBackup shape the
// driver renders per BackupJob.
type MongoDBTemplate struct {
// StorageName names a storage entry declared in the source cluster's
// spec.backup.storages. The mongodb chart declares "s3-storage" when
// backup.enabled=true; leave empty to use that default. Templating is
// StorageName names a storage entry in the source cluster's
// spec.backup.storages. On the legacy flow the mongodb chart declares
// "s3-storage" when backup.enabled=true and useSystemBucket=false; on the
// useSystemBucket flow the driver injects an entry under this same name from
// the S3 coordinates below. Leave empty to use "s3-storage". Templating is
// supported.
// +optional
StorageName string `json:"storageName,omitempty"`
@@ -100,6 +105,45 @@ type MongoDBTemplate struct {
// Left unset the operator picks its default.
// +optional
CompressionLevel *int `json:"compressionLevel,omitempty"`
// S3 carries the system-bucket storage coordinates the driver SSA-patches
// onto the source PerconaServerMongoDB's spec.backup.storages[StorageName]
// on the useSystemBucket flow. PBM takes these as static CR fields (not
// secret refs), and the platform bucket name / endpoint are only known at
// BackupJob time, so the cozy-default strategy carries them (endpointUrl
// already scheme'd by the endpoint helper) and the driver injects them. Nil
// means the legacy flow: rely on the storage the app chart rendered
// statically, and patch nothing.
// +optional
S3 *MongoDBStorageS3 `json:"s3,omitempty"`
}
// MongoDBStorageS3 mirrors the psmdb spec.backup.storages[<name>].s3 block the
// driver injects. String fields support templating (e.g. Prefix uses
// {{ .Application.metadata.namespace }}/{{ .Application.metadata.name }}).
type MongoDBStorageS3 struct {
// Bucket is the S3 bucket name (the COSI-assigned system bucket).
// +optional
Bucket string `json:"bucket,omitempty"`
// EndpointURL is the full S3 endpoint URL including scheme.
// +optional
EndpointURL string `json:"endpointUrl,omitempty"`
// Region is the S3 region.
// +optional
Region string `json:"region,omitempty"`
// Prefix scopes this release's backups under the bucket.
// +optional
Prefix string `json:"prefix,omitempty"`
// CredentialsSecret names the Secret carrying AWS_ACCESS_KEY_ID /
// AWS_SECRET_ACCESS_KEY. Defaults to cozy-backups-creds when empty.
// +optional
CredentialsSecret string `json:"credentialsSecret,omitempty"`
// ForcePathStyle selects path-style S3 addressing.
// +optional
ForcePathStyle *bool `json:"forcePathStyle,omitempty"`
// InsecureSkipTLSVerify disables S3 endpoint certificate verification.
// +optional
InsecureSkipTLSVerify bool `json:"insecureSkipTLSVerify,omitempty"`
}
// MongoDBStatus reports observed state for the strategy CR. Driver controllers
@@ -83,13 +83,9 @@ type RabbitmqSpec struct {
// .ApplicationRef.{APIGroup,Kind,Name} so a to-copy
// restore can address the source release's object key.
//
// The template is stored schemaless (its content is preserved but not
// validated by the apiserver): the driver renders and validates the pod
// spec, and generating the full PodTemplateSpec OpenAPI schema here would
// add ~590 KB to this CRD. The backupstrategy-controller chart inlines
// every definitions/*.yaml into one Helm release, whose state Secret is
// capped at 1 MiB - a fourth full PodTemplateSpec schema (after Altinity,
// Job and FoundationDB) pushes that Secret over the cap and fails install.
// Stored schemaless: the apiserver keeps it as written rather than
// checking it against the pod schema, and it is validated when the
// driver creates the workload from it.
//
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
+12 -13
View File
@@ -29,11 +29,11 @@ const (
// +kubebuilder:subresource:status
// +kubebuilder:resource:scope=Cluster
// Redis defines a backup strategy for a spotahome RedisFailover app. The
// spotahome operator ships no backup CRD, so the strategy runs a one-shot Job
// that dumps an RDB snapshot to object storage (and replays it on restore) -
// the same PodTemplateSpec model as the Job/Altinity strategies rather than an
// operator-CR delegation.
// Redis defines a backup strategy for a spotahome RedisFailover app, Redis or
// Valkey. The spotahome operator ships no backup CRD, so the strategy runs a
// one-shot Job that dumps an RDB snapshot to object storage (and replays it on
// restore) - the same PodTemplateSpec model as the Job/Altinity strategies
// rather than an operator-CR delegation.
type Redis struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -61,6 +61,10 @@ type RedisSpec struct {
// `.Application.spec.replicas`).
// - `.Release.Name` and `.Release.Namespace` — the application's name
// and namespace.
// - `.Release.Prefix` — the prefix the application's chart puts before
// the name of every resource it creates: `redis-` for a Redis
// application, `valkey-` for a Valkey one. Both run on the same
// RedisFailover operator, so one strategy serves either kind.
// - `.Mode` — `"backup"`, `"restore"`, or `"cleanup"` (delete the object
// of a removed Backup), identifying the run.
// - `.ObjectKey` — the object-storage key for this run: unique per backup,
@@ -72,14 +76,9 @@ type RedisSpec struct {
// and `.Backup.ApplicationRef` describing the source backup, so a
// to-copy restore reads the SOURCE release's object-storage prefix.
//
// Stored schemaless (content preserved, not validated by the apiserver): the
// driver renders and validates the pod spec, and generating the full
// PodTemplateSpec OpenAPI schema here would add ~590 KB to this CRD. The
// backupstrategy-controller chart inlines every definitions/*.yaml into one
// Helm release whose state Secret is capped at 1 MiB, so a full
// PodTemplateSpec schema here (a fifth after Altinity, Job, FoundationDB and
// Redis's own siblings) pushes that Secret over the cap and fails install.
// Same reason as rabbitmq_types.go.
// Stored schemaless: the apiserver keeps it as written rather than
// checking it against the pod schema, and it is validated when the
// driver creates the workload from it.
//
// +kubebuilder:validation:Schemaless
// +kubebuilder:pruning:PreserveUnknownFields
+128
View File
@@ -839,6 +839,109 @@ func (in *KafkaStatus) DeepCopy() *KafkaStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Kubernetes) DeepCopyInto(out *Kubernetes) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ObjectMeta.DeepCopyInto(&out.ObjectMeta)
in.Spec.DeepCopyInto(&out.Spec)
in.Status.DeepCopyInto(&out.Status)
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kubernetes.
func (in *Kubernetes) DeepCopy() *Kubernetes {
if in == nil {
return nil
}
out := new(Kubernetes)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *Kubernetes) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubernetesList) DeepCopyInto(out *KubernetesList) {
*out = *in
out.TypeMeta = in.TypeMeta
in.ListMeta.DeepCopyInto(&out.ListMeta)
if in.Items != nil {
in, out := &in.Items, &out.Items
*out = make([]Kubernetes, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesList.
func (in *KubernetesList) DeepCopy() *KubernetesList {
if in == nil {
return nil
}
out := new(KubernetesList)
in.DeepCopyInto(out)
return out
}
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KubernetesList) DeepCopyObject() runtime.Object {
if c := in.DeepCopy(); c != nil {
return c
}
return nil
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubernetesSpec) DeepCopyInto(out *KubernetesSpec) {
*out = *in
in.Template.DeepCopyInto(&out.Template)
in.Velero.DeepCopyInto(&out.Velero)
if in.CertificateWarningThreshold != nil {
in, out := &in.CertificateWarningThreshold, &out.CertificateWarningThreshold
*out = new(v1.Duration)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesSpec.
func (in *KubernetesSpec) DeepCopy() *KubernetesSpec {
if in == nil {
return nil
}
out := new(KubernetesSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KubernetesStatus) DeepCopyInto(out *KubernetesStatus) {
*out = *in
if in.Conditions != nil {
in, out := &in.Conditions, &out.Conditions
*out = make([]v1.Condition, len(*in))
for i := range *in {
(*in)[i].DeepCopyInto(&(*out)[i])
}
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesStatus.
func (in *KubernetesStatus) DeepCopy() *KubernetesStatus {
if in == nil {
return nil
}
out := new(KubernetesStatus)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MariaDB) DeepCopyInto(out *MariaDB) {
*out = *in
@@ -1151,6 +1254,26 @@ func (in *MongoDBStatus) DeepCopy() *MongoDBStatus {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MongoDBStorageS3) DeepCopyInto(out *MongoDBStorageS3) {
*out = *in
if in.ForcePathStyle != nil {
in, out := &in.ForcePathStyle, &out.ForcePathStyle
*out = new(bool)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDBStorageS3.
func (in *MongoDBStorageS3) DeepCopy() *MongoDBStorageS3 {
if in == nil {
return nil
}
out := new(MongoDBStorageS3)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MongoDBTemplate) DeepCopyInto(out *MongoDBTemplate) {
*out = *in
@@ -1159,6 +1282,11 @@ func (in *MongoDBTemplate) DeepCopyInto(out *MongoDBTemplate) {
*out = new(int)
**out = **in
}
if in.S3 != nil {
in, out := &in.S3, &out.S3
*out = new(MongoDBStorageS3)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MongoDBTemplate.
+1 -1
View File
@@ -31,7 +31,7 @@ Tenants reference `cozy-default` from `BackupJob`/`Plan`/`RestoreJob`; they neve
The platform-managed flow is layered *on top of* — not in place of — the core API. Custom `BackupClass`/Strategy CRs targeting other buckets continue to work; tenants picking `cozy-default` simply opt into the platform's pre-wired stack.
**Open gap (FoundationDB):** the `cozy-default-foundationdb` Strategy CR is shipped but **not** bound by `cozy-default`. Restore for FoundationDB runs `fdbrestore` from inside the `cozy-foundationdb-operator` deployment, which does not yet mount `cozy-backups-creds` with the blob credentials file. Admins who want platform-default FDB backups today must either wire the operator deployment manually or use a custom BackupClass — see [Backup Classes](../../../docs/operations/backup-classes.md) for the follow-up plan.
**Open gap (FoundationDB):** the `cozy-default-foundationdb` Strategy CR is shipped but **not** bound by `cozy-default`. Restore for FoundationDB runs `fdbrestore` from inside the `cozy-foundationdb-operator` deployment, which does not yet mount `cozy-backups-creds` with the blob credentials file. Admins who want platform-default FDB backups today must either wire the operator deployment manually or use a custom BackupClass — see [Backup Classes](https://cozystack.io/docs/v1/operations/services/backup-classes/) for the follow-up plan.
**Tenant visibility:** projected Secrets carry no `internal.cozystack.io/tenantresource` label, so the lineage-controller webhook does not promote them to a `TenantSecret` view. Combined with the default RBAC (no core/v1.Secret verbs on tenant ServiceAccounts), the projected credentials are unreadable from a tenant kubeconfig even when they sit in the tenant's own namespace; the operator Pods mount the Secret via kubelet, which bypasses tenant RBAC.
+8 -1
View File
@@ -37,7 +37,14 @@ type BackupArtifact struct {
// For example: s3://bucket/prefix/file.tar.gz
URI string `json:"uri"`
// SizeBytes is the size of the artifact in bytes, if known.
// SizeBytes is the stored size in bytes of the files this backup owns,
// if known: the dump of a MariaDB backup, for example, or the base backup
// of a CNPG one, which leaves out the WAL archive the server's backups
// share and a point-in-time restore also reads. Strategies that cannot
// attribute stored bytes to a single backup, such as Velero's, whose
// repository deduplicates across backups, leave it unset. Drivers never
// write 0 for a size they cannot measure, so an absent value means
// "unknown", not "empty".
// +optional
SizeBytes int64 `json:"sizeBytes,omitempty"`
+9 -8
View File
@@ -184,9 +184,10 @@ type TLSPassthroughListener struct {
// native port (e.g. 5432 for PostgreSQL). Must be 1..65535, unique
// across the list, and neither 80 nor 443 — the Gateway's own http
// (80) and TLS-terminate (443) listeners already own those ports.
// It is not an access boundary: on the Cilium version this
// platform pins, the backend answers this listener's SNI on every
// port the Gateway exposes, so the hostname is what gates reach.
// It is not an access boundary: an implementation may serve every
// port of the Gateway from one proxy listener matched by SNI alone,
// and Cilium does so until the Gateway carries a configuration that
// splits it per port, so the hostname is what gates reach.
// +kubebuilder:validation:Minimum=1
// +kubebuilder:validation:Maximum=65535
// +required
@@ -246,7 +247,7 @@ type TLSPassthroughListener struct {
// +kubebuilder:validation:XValidation:rule="!has(self.tlsPassthroughListeners) || self.tlsPassthroughListeners.all(l, self.tlsPassthroughListeners.filter(o, o.port == l.port).size() == 1)",message="tlsPassthroughListeners: each listener must occupy a distinct port"
// +kubebuilder:validation:XValidation:rule="!has(self.tlsPassthroughListeners) || self.tlsPassthroughListeners.all(l, l.hostname == self.apex || l.hostname.endsWith('.' + self.apex))",message="tlsPassthroughListeners: hostname must equal the tenant apex or be a subdomain of it"
// +kubebuilder:validation:XValidation:rule="!has(self.tlsPassthroughListeners) || !has(self.tlsPassthroughServices) || self.tlsPassthroughListeners.all(l, !(l.name in self.tlsPassthroughServices))",message="tlsPassthroughListeners: name collides with a tlsPassthroughServices entry; both render a tls-<name> Gateway listener"
// +kubebuilder:validation:XValidation:rule="!has(self.tlsPassthroughListeners) || size(self.tlsPassthroughListeners) == 0 || !has(self.certMode) || self.certMode == 'http01'",message="tlsPassthroughListeners: supported with certMode http01 only; dns01 and existingSecret serve the tenant from one wildcard terminate listener that the pinned Cilium cannot keep apart from a passthrough listener under the same apex, and edge terminates TLS upstream and renders no TLS listener to sit beside"
// +kubebuilder:validation:XValidation:rule="!has(self.tlsPassthroughListeners) || size(self.tlsPassthroughListeners) == 0 || !has(self.certMode) || self.certMode != 'edge'",message="tlsPassthroughListeners: unsupported with certMode edge, which terminates TLS upstream and renders no TLS listener to sit beside"
type TenantGatewaySpec struct {
// MaxLength is the DNS ceiling, so it rejects nothing resolvable,
// and it is not cosmetic: it is one of the three bounds the
@@ -376,10 +377,10 @@ type TenantGatewaySpec struct {
// for the listener's Hostname — a passthrough listener never
// terminates TLS, so the Gateway neither holds nor issues that
// certificate. Until such a route attaches and its backend
// resolves, the entry publishes the port and answers nothing on it:
// a passthrough listener carrying no forwarding route contributes
// no filter chain, so a hostname an HTTPS-terminate listener
// already serves goes on being served there.
// resolves, the entry publishes the port and answers nothing on it.
// Under certMode http01 its hostname is reserved from the moment it
// is declared: no HTTPS-terminate listener or certificate is
// rendered for it on 443, route or no route.
// +optional
// +listType=map
// +listMapKey=name
+19
View File
@@ -8,6 +8,7 @@ import (
type WorkloadMonitorSpec struct {
// Selector is a label selector to find workloads to monitor
// +required
// +kubebuilder:validation:MinProperties=1
Selector map[string]string `json:"selector"`
// Kind specifies the kind of the workload
@@ -34,6 +35,14 @@ type WorkloadMonitorSpec struct {
Replicas *int32 `json:"replicas,omitempty"`
}
// WorkloadMonitorReasonDataVolumeNotReady is the status Reason of a monitor
// that is not operational because a DataVolume it selects is not ready.
const WorkloadMonitorReasonDataVolumeNotReady = "DataVolumeNotReady"
// WorkloadMonitorReasonBucketClaimNotReady is the status Reason of a monitor
// that is not operational because a BucketClaim it selects is not provisioned.
const WorkloadMonitorReasonBucketClaimNotReady = "BucketClaimNotReady"
// WorkloadMonitorStatus defines the observed state of WorkloadMonitor
type WorkloadMonitorStatus struct {
// Operational indicates if the workload meets all operational requirements
@@ -47,6 +56,16 @@ type WorkloadMonitorStatus struct {
// ObservedReplicas is the total number of pods observed
// +optional
ObservedReplicas int32 `json:"observedReplicas"`
// Message names what keeps the workload from being operational, when the
// controller can tell.
// +optional
Message string `json:"message,omitempty"`
// Reason is a machine-readable cause for Message, such as
// DataVolumeNotReady.
// +optional
Reason string `json:"reason,omitempty"`
}
// +kubebuilder:object:root=true