mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-04 06:03:05 +09:00
feat(apps): per-app schedulingClass field for selective workload placement (#2622)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Add the label `kind/backport` if it's a bugfix that needs to be
backported to a previous version.
-->
## What this PR does
Closes the per-application gap of the SchedulingClass system. Today a
SchedulingClass can only be attached to a `Tenant`, which propagates it
to every workload in the namespace through the namespace label. The
lineage webhook already prefers the owner Application's class over the
namespace label ("owner Application field takes priority, then fall back
to namespace label" in `applySchedulingClass`), but
`Application.SchedulingClass()` was a `TODO` that always returned `""`,
so that path was unreachable.
### Changes
1. `feat(api)`: `Application.SchedulingClass()` reads the top-level
`schedulingClass` key from `Spec.Raw`. A nil spec, an empty or missing
field, and invalid JSON all return `""`, so the webhook falls back to
the namespace class.
2. `feat(apps)`: every managed application whose pods go through the
webhook gets an optional `schedulingClass` field. Under
`packages/apps/`: bucket, clickhouse, foundationdb, harbor, kafka,
kubernetes, mariadb, mongodb, nats, openbao, opensearch, postgres,
qdrant, rabbitmq, redis, tcp-balancer, valkey, vm-disk, vm-instance,
vpn. Under `packages/extra/`: bootbox, etcd, external-dns, ingress,
monitoring, seaweedfs. Skipped: `tenant` (already has the field), `vpc`
and `info` (no pods), `gateway` (not an Application), `computeplane` (it
only wraps `kubernetes` and `kubernetes-nodes` releases), and
`kubernetes-nodes` itself, whose worker pods resolve to the parent
Kubernetes application, so a class set on a pool would be ignored.
3. `fix(apps)`: the field is capped at 63 characters (`maxLength: 63` in
the schemas, `+kubebuilder:validation:MaxLength=63` in the Go types),
because its value becomes a Pod label value while a SchedulingClass name
may be up to 253 characters. As defence in depth, `applySchedulingClass`
skips only the label when the resolved name is not a valid label value,
keeping `schedulerName` and the annotation, so a long-named class
degrades to annotation-only injection instead of having the apiserver
reject every Pod.
4. `test(lineage-webhook)`: covers the owner-Application path, which the
existing tests never exercised (they all pass a nil owner): the app
class overriding the namespace class, the fallback when the field is
absent, empty or the spec is missing, and the label guard for an
over-long name.
5. `feat(tenant)`: the tenant chart gains `allowedSchedulingClasses`,
empty by default, written to the
`namespace.cozystack.io/allowed-scheduling-classes` namespace
annotation. A parent tenant with a class or a non-empty list passes its
list down unchanged, so a child tenant cannot widen it.
6. `fix(lineage-webhook)`: an application class applies only when the
namespace allows it and the SchedulingClass exists. Otherwise the pod
keeps the tenant class, where it previously got no scheduler at all when
the named class did not exist.
7. `feat(api)`: a ValidatingAdmissionPolicy on `apps.cozystack.io`
(tenants excluded) refuses a `spec.schedulingClass` that is neither the
tenant's own class nor in its allowed list. An update that keeps the
class is not refused, so an application whose class was later removed
from the list stays editable; the webhook keeps its pods on the tenant
class.
8. `docs(apps)`: the field description names the tenant setting that
decides which classes are accepted.
### Precedence
The tenant class is the administrator's placement constraint, so an
application may replace it only with a class the tenant allows. The
administrator lists those classes in the tenant's
`allowedSchedulingClasses`, which is empty by default: per-application
placement stays off until it is enabled, and every application runs
under the tenant class. Naming the tenant's own class is accepted
without an entry, since it is the same as leaving the field empty. Any
other value is refused at admission, and the webhook enforces the same
rule at pod admission, falling back to the tenant class rather than
dropping it.
### Use case
The tenant administrator allows the class (`allowedSchedulingClasses:
[co-region-prod]` on the Tenant). Combined with the
`scheduler.cozystack.io/scheduling-class` Pod label added in #2621, a
class name can double as a co-affinity group:
```yaml
apiVersion: cozystack.io/v1alpha1
kind: SchedulingClass
metadata: { name: co-region-prod }
spec:
podAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
scheduler.cozystack.io/scheduling-class: co-region-prod
topologyKey: topology.kubernetes.io/region
---
apiVersion: apps.cozystack.io/v1alpha1
kind: Postgres
metadata: { name: db, namespace: tenant-acme }
spec:
schedulingClass: co-region-prod
---
apiVersion: apps.cozystack.io/v1alpha1
kind: VMInstance
metadata: { name: app, namespace: tenant-acme }
spec:
schedulingClass: co-region-prod
```
The Postgres pods and the virtual machine land in the same region,
without pinning a specific one.
### Out of scope
Placement per replica role (primary or standby of a clustered database).
The role is assigned by the operator after election, while the webhook
acts at pod creation, so the future primary is unknown at that point.
### Verification
- `go test ./pkg/apis/... ./pkg/registry/... ./pkg/cmd/server/...
./internal/lineagecontrollerwebhook/...` passes. The behavioural webhook
tests were checked against the reverted code: without the label guard,
with `SchedulingClass()` returning `""`, and with the previous
resolution that skipped injection for an unknown application class, each
fails.
- The admission policy's decisions are evaluated against the chart
template with the apiserver's CEL compiler
(`pkg/registry/apps/application/scheduling_class_policy_test.go`), and
on a lab cluster through the aggregated cozystack-api: a class outside
the list is refused, a listed class or the tenant's own class is
accepted, and an update that keeps a class removed from the list is
accepted while one that changes it is refused
(https://github.com/cozystack/cozystack/pull/2622#issuecomment-7042784997).
- The tenant chart's inheritance of the list is covered by
`packages/apps/tenant/tests/namespace_allowed_scheduling_classes_test.yaml`,
which fails when a child tenant may widen its parent's list.
- `make generate` at the root and in every touched package
(cozyvalues-gen v1.7.0, the CI pin) leaves no diff.
- `make helm-unit-tests` passes; `hack/check-rd-presets.sh` and
`hack/check-commit-trailers.sh` pass.
### Screenshots
<!-- REQUIRED for UI changes: attach screenshots or screen recordings
demonstrating
the visual impact of your changes. PRs with UI changes without
screenshots will not be merged. -->
No UI change.
### Downstream repositories
<!--
Cozystack is upstream for repositories that are NOT kept in sync with it
automatically, and nothing in CI compares the two sides, so a change
here can break them silently.
Which change forces what, and which file to touch, is the trigger map in
docs/agents/contributing.md under "Downstream Repositories". Walk it
before you tick anything.
IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM
TO FILL IN:
1. Walk the trigger map against the actual diff of this PR, file by
file. Do not decide from the PR title or from your memory of what you
changed.
2. For every repository you tick, open the follow-up PR there and link
it on the same line. A ticked box with no link claims work that does not
exist, which is worse than an empty box. Search that repository for an
open PR or issue covering it first, and link that instead of filing a
duplicate.
3. When the follow-up is out of scope, or needs a decision that is not
yours to make, open an issue in that repository instead, link that, and
say so in the PR body.
4. Do not tick "No downstream repository is affected" to make the
checklist go away. If you are unsure, leave every box empty and say so
in the PR body, so a human decides.
-->
Two repositories are reached by this diff. Both follow-ups are issues
rather than PRs, because each one only applies once this PR is merged:
`terraform-provider-cozystack` needs the field on every application it
models and `allowedSchedulingClasses` on the tenant, and `website` needs
the hand-written SchedulingClass guide to cover the per-application
field, the tenant's allowed list that gates it, and the Pod label.
- [ ] No downstream repository is affected by this change
- [x] [cozystack/website](https://github.com/cozystack/website) -
follow-up: cozystack/website#749
- [x]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up: cozystack/terraform-provider-cozystack#69
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:
### Release note
```release-note
feat(apps): managed applications (bucket, clickhouse, foundationdb, harbor, kafka, kubernetes, mariadb, mongodb, nats, openbao, opensearch, postgres, qdrant, rabbitmq, redis, tcp-balancer, valkey, vm-disk, vm-instance, vpn, plus the bootbox, etcd, external-dns, ingress, monitoring and seaweedfs extras) accept a top-level `spec.schedulingClass` field, capped at 63 characters, which applies the named SchedulingClass to that application's pods in place of the tenant-level class. Only the tenant's own class or one listed in the tenant's new `allowedSchedulingClasses` (empty by default) is accepted; any other value is refused. This lets applications in the same tenant be co-located through a SchedulingClass podAffinity on the `scheduler.cozystack.io/scheduling-class` Pod label. An application whose class does not exist now keeps the tenant class instead of losing it.
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Added `schedulingClass` configuration across applications to select an
eligible scheduling class for newly created pods. Empty settings inherit
the tenant’s class; existing pods keep their assigned class until
recreated.
* Added tenant-level controls for which scheduling classes applications
may select. Invalid selections are rejected, and new pods fall back to
the tenant’s class if permission is removed.
* Added scheduling-class settings to application configuration displays.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
142 files changed
+1621
-181
No files matched your search
Generated
+4
@@ -31,6 +31,10 @@ type ConfigSpec struct {
|
||||
// Users configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Users map[string]User `json:"users,omitempty"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type User struct {
|
||||
|
||||
Generated
+4
@@ -54,6 +54,10 @@ type ConfigSpec struct {
|
||||
// ClickHouse Keeper configuration.
|
||||
// +kubebuilder:default:={}
|
||||
ClickhouseKeeper ClickHouseKeeper `json:"clickhouseKeeper"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Backup struct {
|
||||
|
||||
Generated
+4
@@ -50,6 +50,10 @@ type ConfigSpec struct {
|
||||
// Enable automatic pod replacements.
|
||||
// +kubebuilder:default:=true
|
||||
AutomaticReplacements bool `json:"automaticReplacements"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Backup struct {
|
||||
|
||||
Generated
+4
@@ -45,6 +45,10 @@ type ConfigSpec struct {
|
||||
// Redis cache configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Redis Redis `json:"redis"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Core struct {
|
||||
|
||||
Generated
+4
@@ -33,6 +33,10 @@ type ConfigSpec struct {
|
||||
// Kafka configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Kafka Kafka `json:"kafka"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Kafka struct {
|
||||
|
||||
Generated
+4
@@ -44,6 +44,10 @@ type ConfigSpec struct {
|
||||
// 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"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type APIServer struct {
|
||||
|
||||
Generated
+4
@@ -51,6 +51,10 @@ type ConfigSpec struct {
|
||||
// DEPRECATED: Backup configuration. Prefer the BackupClass / Plan flow under examples/backups/mariadb/.
|
||||
// +kubebuilder:default:={}
|
||||
Backup Backup `json:"backup"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Backup struct {
|
||||
|
||||
Generated
+4
@@ -57,6 +57,10 @@ type ConfigSpec struct {
|
||||
// Bootstrap configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Bootstrap Bootstrap `json:"bootstrap"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Backup struct {
|
||||
|
||||
Generated
+4
@@ -46,6 +46,10 @@ type ConfigSpec struct {
|
||||
// NATS configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Config ValuesConfig `json:"config"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type ValuesConfig struct {
|
||||
|
||||
Generated
+4
@@ -42,6 +42,10 @@ type ConfigSpec struct {
|
||||
// Seal configuration. The default is Shamir key shares. Set `type: static` for auto-unseal.
|
||||
// +kubebuilder:default:={}
|
||||
Seal Seal `json:"seal"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
|
||||
Generated
+4
@@ -54,6 +54,10 @@ type ConfigSpec struct {
|
||||
// OpenSearch Dashboards configuration.
|
||||
// +kubebuilder:default:={}
|
||||
Dashboards Dashboards `json:"dashboards"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Dashboards struct {
|
||||
|
||||
Generated
+4
@@ -37,6 +37,10 @@ type ConfigSpec struct {
|
||||
// Enable external access from outside the cluster.
|
||||
// +kubebuilder:default:=false
|
||||
External bool `json:"external"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
// PostgreSQL major version to deploy
|
||||
// +kubebuilder:default:="v18"
|
||||
Version Version `json:"version"`
|
||||
|
||||
Generated
+4
@@ -39,6 +39,10 @@ type ConfigSpec struct {
|
||||
// TLS configuration. When omitted, the effective TLS state follows the value of `external`.
|
||||
// +kubebuilder:default:={}
|
||||
Tls TLS `json:"tls,omitempty"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
|
||||
Generated
+4
@@ -52,6 +52,10 @@ type ConfigSpec struct {
|
||||
// Virtual hosts configuration map.
|
||||
// +kubebuilder:default:={}
|
||||
Vhosts map[string]Vhost `json:"vhosts,omitempty"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
|
||||
Generated
+4
@@ -66,6 +66,10 @@ type ConfigSpec struct {
|
||||
// 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"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type AffinitySpec struct {
|
||||
|
||||
Generated
+4
@@ -38,6 +38,10 @@ type ConfigSpec struct {
|
||||
// List of allowed client networks.
|
||||
// +kubebuilder:default:={}
|
||||
Whitelist []string `json:"whitelist,omitempty"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type HttpAndHttps struct {
|
||||
|
||||
Generated
+3
@@ -46,6 +46,9 @@ type ConfigSpec struct {
|
||||
// The name of a SchedulingClass CR to apply scheduling constraints for this tenant's workloads.
|
||||
// +kubebuilder:default:=""
|
||||
SchedulingClass string `json:"schedulingClass,omitempty"`
|
||||
// SchedulingClasses an application in this tenant may select through its own `schedulingClass`, in place of the tenant's. Empty allows none, so every application runs under the tenant's class. Inherited from the parent tenant, and not settable here, when the parent has a `schedulingClass` or a non-empty list.
|
||||
// +kubebuilder:default:={}
|
||||
AllowedSchedulingClasses []string `json:"allowedSchedulingClasses,omitempty"`
|
||||
// Define resource quotas for the tenant.
|
||||
// +kubebuilder:default:={}
|
||||
ResourceQuotas map[string]resource.Quantity `json:"resourceQuotas,omitempty"`
|
||||
|
||||
@@ -54,6 +54,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.AllowedSchedulingClasses != nil {
|
||||
in, out := &in.AllowedSchedulingClasses, &out.AllowedSchedulingClasses
|
||||
*out = make([]string, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
if in.ResourceQuotas != nil {
|
||||
in, out := &in.ResourceQuotas, &out.ResourceQuotas
|
||||
*out = make(map[string]resource.Quantity, len(*in))
|
||||
|
||||
Generated
+4
@@ -42,6 +42,10 @@ type ConfigSpec struct {
|
||||
// Enable password generation.
|
||||
// +kubebuilder:default:=true
|
||||
AuthEnabled bool `json:"authEnabled"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
|
||||
Generated
+4
@@ -34,6 +34,10 @@ type ConfigSpec struct {
|
||||
// Provision the volume at disk creation instead of waiting for a consumer.
|
||||
// +kubebuilder:default:=true
|
||||
BindImmediately bool `json:"bindImmediately"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Source struct {
|
||||
|
||||
Generated
+4
@@ -71,6 +71,10 @@ type ConfigSpec struct {
|
||||
// Seed string to generate SMBIOS UUID for the VM.
|
||||
// +kubebuilder:default:=""
|
||||
CloudInitSeed string `json:"cloudInitSeed"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Disk struct {
|
||||
|
||||
Generated
+4
@@ -38,6 +38,10 @@ type ConfigSpec struct {
|
||||
// List of externalIPs for service. Optional. If not specified, will use LoadBalancer service by default.
|
||||
// +kubebuilder:default:={}
|
||||
ExternalIPs []string `json:"externalIPs,omitempty"`
|
||||
// Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
// +kubebuilder:default:=""
|
||||
// +kubebuilder:validation:MaxLength=63
|
||||
SchedulingClass string `json:"schedulingClass"`
|
||||
}
|
||||
|
||||
type Resources struct {
|
||||
|
||||
@@ -6,16 +6,20 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"maps"
|
||||
"slices"
|
||||
"strings"
|
||||
|
||||
"github.com/cozystack/cozystack/pkg/lineage"
|
||||
admissionv1 "k8s.io/api/admission/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
utiljson "k8s.io/apimachinery/pkg/util/json"
|
||||
"k8s.io/apimachinery/pkg/util/validation"
|
||||
"k8s.io/client-go/dynamic"
|
||||
"k8s.io/client-go/rest"
|
||||
ctrl "sigs.k8s.io/controller-runtime"
|
||||
@@ -108,7 +112,7 @@ func (h *LineageControllerWebhook) Handle(ctx context.Context, req admission.Req
|
||||
|
||||
// The objectSelector skips objects carrying the managed label, but on UPDATE
|
||||
// it matches if either the old or the new object does. Pods go on, since
|
||||
// every Pod admission also needs applySchedulingClass.
|
||||
// a Pod's creation also needs applySchedulingClass.
|
||||
if obj.GetKind() != "Pod" && hasAllLineageLabels(obj) {
|
||||
logger.V(1).Info("object already carries lineage labels, skipping owner walk")
|
||||
return admission.Allowed("lineage labels already present")
|
||||
@@ -132,9 +136,14 @@ func (h *LineageControllerWebhook) Handle(ctx context.Context, req admission.Req
|
||||
|
||||
h.applyLabels(obj, labels)
|
||||
|
||||
if err := h.applySchedulingClass(ctx, obj, owner, req.Namespace); err != nil {
|
||||
logger.Error(err, "error applying scheduling class")
|
||||
return admission.Errored(500, fmt.Errorf("error applying scheduling class: %w", err))
|
||||
// spec.schedulerName is immutable once the Pod exists, so a class only
|
||||
// takes effect at creation: setting it on an UPDATE, after the tenant or
|
||||
// application class changed, would get every update of the Pod refused.
|
||||
if req.Operation == admissionv1.Create {
|
||||
if err := h.applySchedulingClass(ctx, obj, owner, req.Namespace); err != nil {
|
||||
logger.Error(err, "error applying scheduling class")
|
||||
return admission.Errored(500, fmt.Errorf("error applying scheduling class: %w", err))
|
||||
}
|
||||
}
|
||||
|
||||
mutated, err := json.Marshal(obj)
|
||||
@@ -239,52 +248,62 @@ func hasAllLineageLabels(o *unstructured.Unstructured) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// AllowedSchedulingClassesAnnotation lists, comma-separated, the
|
||||
// SchedulingClasses an application in the namespace may select through
|
||||
// spec.schedulingClass. The tenant chart writes it from the tenant's
|
||||
// allowedSchedulingClasses; an absent or empty annotation allows none.
|
||||
const AllowedSchedulingClassesAnnotation = "namespace.cozystack.io/allowed-scheduling-classes"
|
||||
|
||||
// applySchedulingClass injects schedulerName, scheduling-class annotation, and
|
||||
// scheduling-class label into Pods whose namespace carries the
|
||||
// scheduler.cozystack.io/scheduling-class label.
|
||||
// scheduling-class label into Pods whose application or namespace selects a
|
||||
// SchedulingClass.
|
||||
//
|
||||
// The label (in addition to the annotation) lets SchedulingClass authors write
|
||||
// podAffinity rules whose labelSelector matches pods across applications that
|
||||
// share the same class.
|
||||
//
|
||||
// If the referenced SchedulingClass CR does not exist (e.g. the scheduler
|
||||
// The tenant class comes from the namespace label and is set by whoever
|
||||
// administers the tenant, so an application may replace it only with a class
|
||||
// the namespace allows and that exists. Anything else falls back to the tenant
|
||||
// class rather than dropping the injection, which would let a typo in an
|
||||
// application lift the tenant's placement constraint. Admission of the
|
||||
// application already refuses a class outside the allowed list; checking it
|
||||
// again here covers a class removed from the list after the application was
|
||||
// admitted.
|
||||
//
|
||||
// If the resolved SchedulingClass CR does not exist (e.g. the scheduler
|
||||
// package is not installed), the injection is silently skipped so that pods
|
||||
// are not left Pending.
|
||||
func (h *LineageControllerWebhook) applySchedulingClass(ctx context.Context, obj, owner *unstructured.Unstructured, namespace string) error {
|
||||
if obj.GetKind() != "Pod" {
|
||||
return nil
|
||||
}
|
||||
logger := log.FromContext(ctx)
|
||||
|
||||
// Determine scheduling class: owner Application field takes priority,
|
||||
// then fall back to namespace label.
|
||||
var schedulingClass string
|
||||
if owner != nil {
|
||||
var app appsv1alpha1.Application
|
||||
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(owner.Object, &app); err == nil {
|
||||
schedulingClass = app.SchedulingClass()
|
||||
}
|
||||
}
|
||||
if schedulingClass == "" {
|
||||
ns := &corev1.Namespace{}
|
||||
if err := h.Get(ctx, client.ObjectKey{Name: namespace}, ns); err != nil {
|
||||
return fmt.Errorf("getting namespace %s: %w", namespace, err)
|
||||
}
|
||||
schedulingClass = ns.Labels[schedulerapi.SchedulingClassLabel]
|
||||
ns := &corev1.Namespace{}
|
||||
if err := h.Get(ctx, client.ObjectKey{Name: namespace}, ns); err != nil {
|
||||
return fmt.Errorf("getting namespace %s: %w", namespace, err)
|
||||
}
|
||||
tenantClass := ns.Labels[schedulerapi.SchedulingClassLabel]
|
||||
|
||||
if schedulingClass == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Verify that the referenced SchedulingClass CR exists.
|
||||
// If the CRD is not installed or the CR is missing, skip injection
|
||||
// so that pods are not stuck Pending on a non-existent scheduler.
|
||||
_, err := h.dynClient.Resource(schedulingClassGVR).Get(ctx, schedulingClass, metav1.GetOptions{})
|
||||
schedulingClass, err := h.resolveApplicationClass(ctx, ownerSchedulingClass(owner), tenantClass, ns)
|
||||
if err != nil {
|
||||
logger := log.FromContext(ctx)
|
||||
logger.Info("SchedulingClass not found, skipping scheduler injection",
|
||||
"schedulingClass", schedulingClass, "namespace", namespace)
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
if schedulingClass == "" {
|
||||
if tenantClass == "" {
|
||||
return nil
|
||||
}
|
||||
exists, err := h.schedulingClassExists(ctx, tenantClass)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !exists {
|
||||
logger.Info("SchedulingClass not found, skipping scheduler injection",
|
||||
"schedulingClass", tenantClass, "namespace", namespace)
|
||||
return nil
|
||||
}
|
||||
schedulingClass = tenantClass
|
||||
}
|
||||
|
||||
if err := unstructured.SetNestedField(obj.Object, schedulerapi.SchedulerName, "spec", "schedulerName"); err != nil {
|
||||
@@ -298,6 +317,16 @@ func (h *LineageControllerWebhook) applySchedulingClass(ctx context.Context, obj
|
||||
annotations[schedulerapi.SchedulingClassAnnotation] = schedulingClass
|
||||
obj.SetAnnotations(annotations)
|
||||
|
||||
// Defence in depth: a SchedulingClass name is a DNS-1123 subdomain (up to
|
||||
// 253 chars) while a label value is capped at 63. spec.schedulingClass is
|
||||
// schema-capped at 63, but a pre-existing long-named class must degrade to
|
||||
// annotation-only injection rather than have the apiserver reject the Pod.
|
||||
if errs := validation.IsValidLabelValue(schedulingClass); len(errs) > 0 {
|
||||
logger.Info("SchedulingClass name is not a valid label value, skipping co-affinity label",
|
||||
"schedulingClass", schedulingClass, "namespace", namespace)
|
||||
return nil
|
||||
}
|
||||
|
||||
podLabels := obj.GetLabels()
|
||||
if podLabels == nil {
|
||||
podLabels = make(map[string]string)
|
||||
@@ -308,6 +337,71 @@ func (h *LineageControllerWebhook) applySchedulingClass(ctx context.Context, obj
|
||||
return nil
|
||||
}
|
||||
|
||||
// resolveApplicationClass returns the application's class when it may replace
|
||||
// the tenant class: it differs from it, the namespace allows it and it exists.
|
||||
// It returns "" otherwise, so that the caller falls back to the tenant class.
|
||||
// The existence check runs once and its answer is final, since a second
|
||||
// lookup that found the class gone would leave the pod with no class at all.
|
||||
func (h *LineageControllerWebhook) resolveApplicationClass(ctx context.Context, appClass, tenantClass string, ns *corev1.Namespace) (string, error) {
|
||||
if appClass == "" || appClass == tenantClass {
|
||||
return "", nil
|
||||
}
|
||||
logger := log.FromContext(ctx)
|
||||
if !slices.Contains(allowedSchedulingClasses(ns), appClass) {
|
||||
logger.Info("application SchedulingClass is not allowed in this namespace, keeping the tenant class",
|
||||
"schedulingClass", appClass, "tenantSchedulingClass", tenantClass, "namespace", ns.Name)
|
||||
return "", nil
|
||||
}
|
||||
exists, err := h.schedulingClassExists(ctx, appClass)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if !exists {
|
||||
logger.Info("application SchedulingClass not found, keeping the tenant class",
|
||||
"schedulingClass", appClass, "tenantSchedulingClass", tenantClass, "namespace", ns.Name)
|
||||
return "", nil
|
||||
}
|
||||
return appClass, nil
|
||||
}
|
||||
|
||||
func ownerSchedulingClass(owner *unstructured.Unstructured) string {
|
||||
if owner == nil {
|
||||
return ""
|
||||
}
|
||||
var app appsv1alpha1.Application
|
||||
if err := runtime.DefaultUnstructuredConverter.FromUnstructured(owner.Object, &app); err != nil {
|
||||
return ""
|
||||
}
|
||||
return app.SchedulingClass()
|
||||
}
|
||||
|
||||
func allowedSchedulingClasses(ns *corev1.Namespace) []string {
|
||||
var allowed []string
|
||||
for _, name := range strings.Split(ns.Annotations[AllowedSchedulingClassesAnnotation], ",") {
|
||||
if name = strings.TrimSpace(name); name != "" {
|
||||
allowed = append(allowed, name)
|
||||
}
|
||||
}
|
||||
return allowed
|
||||
}
|
||||
|
||||
// schedulingClassExists reports a missing class, or a missing SchedulingClass
|
||||
// CRD, as absence. Any other lookup error is returned: treating a timeout or a
|
||||
// 5xx as absence would admit the Pod without the tenant's placement constraint,
|
||||
// which it then keeps until it is recreated. Failing the admission lets the
|
||||
// Pod's controller retry instead.
|
||||
func (h *LineageControllerWebhook) schedulingClassExists(ctx context.Context, name string) (bool, error) {
|
||||
_, err := h.dynClient.Resource(schedulingClassGVR).Get(ctx, name, metav1.GetOptions{})
|
||||
switch {
|
||||
case err == nil:
|
||||
return true, nil
|
||||
case apierrors.IsNotFound(err) || meta.IsNoMatchError(err):
|
||||
return false, nil
|
||||
default:
|
||||
return false, fmt.Errorf("getting SchedulingClass %s: %w", name, err)
|
||||
}
|
||||
}
|
||||
|
||||
var schedulingClassGVR = schema.GroupVersionResource{
|
||||
Group: schedulerapi.Group,
|
||||
Version: schedulerapi.Version,
|
||||
|
||||
@@ -3,6 +3,7 @@ package lineagecontrollerwebhook
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"sort"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -12,6 +13,7 @@ import (
|
||||
corev1alpha1 "github.com/cozystack/cozystack/pkg/apis/core/v1alpha1"
|
||||
admissionv1 "k8s.io/api/admission/v1"
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
apierrors "k8s.io/apimachinery/pkg/api/errors"
|
||||
"k8s.io/apimachinery/pkg/api/meta"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
|
||||
@@ -19,6 +21,8 @@ import (
|
||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
||||
dynamicfake "k8s.io/client-go/dynamic/fake"
|
||||
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
k8stesting "k8s.io/client-go/testing"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client"
|
||||
"sigs.k8s.io/controller-runtime/pkg/client/fake"
|
||||
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"
|
||||
)
|
||||
@@ -180,10 +184,10 @@ func TestHandle_ReadmissionShortCircuit(t *testing.T) {
|
||||
labels: fullLabels,
|
||||
},
|
||||
{
|
||||
name: "pod with every lineage label still gets the scheduling fields",
|
||||
name: "pod with every lineage label still goes through the walk",
|
||||
kind: "Pod",
|
||||
labels: fullLabels,
|
||||
wantPatches: []string{"add /spec/schedulerName", "replace " + escape(ManagerNameKey)},
|
||||
wantPatches: []string{"replace " + escape(ManagerNameKey)},
|
||||
},
|
||||
{
|
||||
name: "secret marked unmanaged goes through the walk",
|
||||
@@ -460,3 +464,302 @@ func TestApplySchedulingClass_MissingClassCRSkipsInjection(t *testing.T) {
|
||||
t.Errorf("pod spec.schedulerName should not be set when SchedulingClass CR is missing, got %q", sched)
|
||||
}
|
||||
}
|
||||
|
||||
// newOwnerApplication returns the unstructured Application a Pod's lineage
|
||||
// walk resolves to, with the given top-level spec.
|
||||
func newOwnerApplication(namespace, name string, spec map[string]interface{}) *unstructured.Unstructured {
|
||||
u := &unstructured.Unstructured{}
|
||||
u.SetGroupVersionKind(schema.GroupVersionKind{Group: "apps.cozystack.io", Version: "v1alpha1", Kind: "Postgres"})
|
||||
u.SetNamespace(namespace)
|
||||
u.SetName(name)
|
||||
if spec != nil {
|
||||
u.Object["spec"] = spec
|
||||
}
|
||||
return u
|
||||
}
|
||||
|
||||
func addSchedulingClassCR(t *testing.T, h *LineageControllerWebhook, name string) {
|
||||
t.Helper()
|
||||
if _, err := h.dynClient.Resource(schedulingClassGVR).Create(context.Background(), newSchedulingClassCR(name), metav1.CreateOptions{}); err != nil {
|
||||
t.Fatalf("creating SchedulingClass %s: %v", name, err)
|
||||
}
|
||||
}
|
||||
|
||||
func allowSchedulingClasses(t *testing.T, h *LineageControllerWebhook, namespace, allowed string) {
|
||||
t.Helper()
|
||||
ns := &corev1.Namespace{}
|
||||
if err := h.Get(context.Background(), client.ObjectKey{Name: namespace}, ns); err != nil {
|
||||
t.Fatalf("getting namespace %s: %v", namespace, err)
|
||||
}
|
||||
ns.Annotations = map[string]string{AllowedSchedulingClassesAnnotation: allowed}
|
||||
if err := h.Update(context.Background(), ns); err != nil {
|
||||
t.Fatalf("updating namespace %s: %v", namespace, err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplySchedulingClass_OwnerApplicationClassOverridesNamespace(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
h := newWebhookTestEnv(t, "tenant-acme", testSchedulingClass, true)
|
||||
addSchedulingClassCR(t, h, "app-class")
|
||||
allowSchedulingClasses(t, h, "tenant-acme", "other-class, app-class")
|
||||
owner := newOwnerApplication("tenant-acme", "db", map[string]interface{}{
|
||||
"replicas": int64(2),
|
||||
"schedulingClass": "app-class",
|
||||
})
|
||||
pod := newPod("tenant-acme", "db-0")
|
||||
|
||||
if err := h.applySchedulingClass(ctx, pod, owner, "tenant-acme"); err != nil {
|
||||
t.Fatalf("applySchedulingClass returned error: %v", err)
|
||||
}
|
||||
|
||||
if got := pod.GetLabels()[schedulerapi.SchedulingClassLabel]; got != "app-class" {
|
||||
t.Errorf("expected pod label %s=app-class, got %q", schedulerapi.SchedulingClassLabel, got)
|
||||
}
|
||||
if got := pod.GetAnnotations()[schedulerapi.SchedulingClassAnnotation]; got != "app-class" {
|
||||
t.Errorf("expected pod annotation %s=app-class, got %q", schedulerapi.SchedulingClassAnnotation, got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplySchedulingClass_OwnerApplicationWithoutClassFallsBackToNamespace(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
spec map[string]interface{}
|
||||
}{
|
||||
{name: "field absent", spec: map[string]interface{}{"replicas": int64(2)}},
|
||||
{name: "field empty", spec: map[string]interface{}{"schedulingClass": ""}},
|
||||
{name: "no spec", spec: nil},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
h := newWebhookTestEnv(t, "tenant-acme", testSchedulingClass, true)
|
||||
pod := newPod("tenant-acme", "db-0")
|
||||
|
||||
if err := h.applySchedulingClass(ctx, pod, newOwnerApplication("tenant-acme", "db", tc.spec), "tenant-acme"); err != nil {
|
||||
t.Fatalf("applySchedulingClass returned error: %v", err)
|
||||
}
|
||||
|
||||
if got := pod.GetLabels()[schedulerapi.SchedulingClassLabel]; got != testSchedulingClass {
|
||||
t.Errorf("expected the namespace class %q, got %q", testSchedulingClass, got)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// A SchedulingClass name may be up to 253 characters, a label value only 63.
|
||||
// A Pod carrying the longer value would be rejected by the apiserver, so the
|
||||
// class must still apply through the annotation, without the label.
|
||||
func TestApplySchedulingClass_ClassNameTooLongForLabelSkipsOnlyLabel(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
longClass := strings.Repeat("a", 64)
|
||||
h := newWebhookTestEnv(t, "tenant-acme", "", false)
|
||||
addSchedulingClassCR(t, h, longClass)
|
||||
allowSchedulingClasses(t, h, "tenant-acme", longClass)
|
||||
owner := newOwnerApplication("tenant-acme", "db", map[string]interface{}{"schedulingClass": longClass})
|
||||
pod := newPod("tenant-acme", "db-0")
|
||||
|
||||
if err := h.applySchedulingClass(ctx, pod, owner, "tenant-acme"); err != nil {
|
||||
t.Fatalf("applySchedulingClass returned error: %v", err)
|
||||
}
|
||||
|
||||
if _, ok := pod.GetLabels()[schedulerapi.SchedulingClassLabel]; ok {
|
||||
t.Errorf("pod label should not be set for a class name longer than 63 characters")
|
||||
}
|
||||
if got := pod.GetAnnotations()[schedulerapi.SchedulingClassAnnotation]; got != longClass {
|
||||
t.Errorf("expected pod annotation %s=%s, got %q", schedulerapi.SchedulingClassAnnotation, longClass, got)
|
||||
}
|
||||
if sched, _, _ := unstructured.NestedString(pod.Object, "spec", "schedulerName"); sched != schedulerapi.SchedulerName {
|
||||
t.Errorf("expected pod spec.schedulerName=%s, got %q", schedulerapi.SchedulerName, sched)
|
||||
}
|
||||
}
|
||||
|
||||
// The tenant class is the administrator's placement constraint. An application
|
||||
// class that the namespace does not allow, or that does not exist, must leave
|
||||
// it in force instead of dropping the injection altogether.
|
||||
func TestApplySchedulingClass_RejectedOwnerApplicationClassKeepsTenantClass(t *testing.T) {
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
appClass string
|
||||
allowed string
|
||||
existing []string
|
||||
}{
|
||||
{name: "class does not exist", appClass: "does-not-exist", allowed: "does-not-exist"},
|
||||
{name: "class not in the allowed list", appClass: "app-class", allowed: "other-class", existing: []string{"app-class"}},
|
||||
{name: "no allowed list", appClass: "app-class", existing: []string{"app-class"}},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
h := newWebhookTestEnv(t, "tenant-acme", testSchedulingClass, true)
|
||||
for _, name := range tc.existing {
|
||||
addSchedulingClassCR(t, h, name)
|
||||
}
|
||||
if tc.allowed != "" {
|
||||
allowSchedulingClasses(t, h, "tenant-acme", tc.allowed)
|
||||
}
|
||||
owner := newOwnerApplication("tenant-acme", "db", map[string]interface{}{"schedulingClass": tc.appClass})
|
||||
pod := newPod("tenant-acme", "db-0")
|
||||
|
||||
if err := h.applySchedulingClass(ctx, pod, owner, "tenant-acme"); err != nil {
|
||||
t.Fatalf("applySchedulingClass returned error: %v", err)
|
||||
}
|
||||
|
||||
if got := pod.GetLabels()[schedulerapi.SchedulingClassLabel]; got != testSchedulingClass {
|
||||
t.Errorf("expected pod label %s=%s, got %q", schedulerapi.SchedulingClassLabel, testSchedulingClass, got)
|
||||
}
|
||||
if got := pod.GetAnnotations()[schedulerapi.SchedulingClassAnnotation]; got != testSchedulingClass {
|
||||
t.Errorf("expected pod annotation %s=%s, got %q", schedulerapi.SchedulingClassAnnotation, testSchedulingClass, got)
|
||||
}
|
||||
if sched, _, _ := unstructured.NestedString(pod.Object, "spec", "schedulerName"); sched != schedulerapi.SchedulerName {
|
||||
t.Errorf("expected pod spec.schedulerName=%s, got %q", schedulerapi.SchedulerName, sched)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Naming the tenant's own class is the same as leaving the field empty, so it
|
||||
// needs no entry in the allowed list.
|
||||
func TestApplySchedulingClass_OwnerApplicationNamingTenantClassNeedsNoAllowedList(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
h := newWebhookTestEnv(t, "tenant-acme", testSchedulingClass, true)
|
||||
owner := newOwnerApplication("tenant-acme", "db", map[string]interface{}{"schedulingClass": testSchedulingClass})
|
||||
pod := newPod("tenant-acme", "db-0")
|
||||
|
||||
if err := h.applySchedulingClass(ctx, pod, owner, "tenant-acme"); err != nil {
|
||||
t.Fatalf("applySchedulingClass returned error: %v", err)
|
||||
}
|
||||
|
||||
if got := pod.GetLabels()[schedulerapi.SchedulingClassLabel]; got != testSchedulingClass {
|
||||
t.Errorf("expected pod label %s=%s, got %q", schedulerapi.SchedulingClassLabel, testSchedulingClass, got)
|
||||
}
|
||||
}
|
||||
|
||||
// Without a tenant class there is nothing to fall back to: a rejected
|
||||
// application class leaves the pod on the default scheduler.
|
||||
func TestApplySchedulingClass_RejectedOwnerApplicationClassWithoutTenantClassIsNoOp(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
h := newWebhookTestEnv(t, "tenant-acme", "", false)
|
||||
addSchedulingClassCR(t, h, "app-class")
|
||||
owner := newOwnerApplication("tenant-acme", "db", map[string]interface{}{"schedulingClass": "app-class"})
|
||||
pod := newPod("tenant-acme", "db-0")
|
||||
|
||||
if err := h.applySchedulingClass(ctx, pod, owner, "tenant-acme"); err != nil {
|
||||
t.Fatalf("applySchedulingClass returned error: %v", err)
|
||||
}
|
||||
|
||||
if _, ok := pod.GetAnnotations()[schedulerapi.SchedulingClassAnnotation]; ok {
|
||||
t.Errorf("pod annotation should not be set for a class the namespace does not allow")
|
||||
}
|
||||
if sched, _, _ := unstructured.NestedString(pod.Object, "spec", "schedulerName"); sched != "" {
|
||||
t.Errorf("pod spec.schedulerName should not be set, got %q", sched)
|
||||
}
|
||||
}
|
||||
|
||||
// failSchedulingClassGet makes every SchedulingClass lookup return err.
|
||||
func failSchedulingClassGet(h *LineageControllerWebhook, err error) {
|
||||
h.dynClient.(*dynamicfake.FakeDynamicClient).PrependReactor("get", schedulerapi.Resource,
|
||||
func(k8stesting.Action) (bool, runtime.Object, error) { return true, nil, err })
|
||||
}
|
||||
|
||||
// A lookup that fails for any reason other than absence must fail the
|
||||
// admission, so the Pod's controller retries it. Admitting the Pod without
|
||||
// the tenant class would leave it on the default scheduler until recreated.
|
||||
func TestApplySchedulingClass_TransientLookupErrorFailsAdmission(t *testing.T) {
|
||||
transient := apierrors.NewInternalError(errors.New("etcdserver: request timed out"))
|
||||
for _, tc := range []struct {
|
||||
name string
|
||||
owner *unstructured.Unstructured
|
||||
}{
|
||||
{name: "tenant class", owner: nil},
|
||||
{name: "application class", owner: newOwnerApplication("tenant-acme", "db", map[string]interface{}{"schedulingClass": "app-class"})},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
h := newWebhookTestEnv(t, "tenant-acme", testSchedulingClass, true)
|
||||
allowSchedulingClasses(t, h, "tenant-acme", "app-class")
|
||||
failSchedulingClassGet(h, transient)
|
||||
pod := newPod("tenant-acme", "db-0")
|
||||
|
||||
err := h.applySchedulingClass(ctx, pod, tc.owner, "tenant-acme")
|
||||
if !apierrors.IsInternalError(err) {
|
||||
t.Fatalf("expected the lookup error to be returned, got %v", err)
|
||||
}
|
||||
if _, ok := pod.GetAnnotations()[schedulerapi.SchedulingClassAnnotation]; ok {
|
||||
t.Errorf("pod must not be mutated when the lookup fails")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Without the SchedulingClass CRD there is no scheduler to send the Pod to, so
|
||||
// a NoMatch error is absence, like NotFound, and the injection is skipped.
|
||||
func TestApplySchedulingClass_MissingCRDSkipsInjection(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
h := newWebhookTestEnv(t, "tenant-acme", testSchedulingClass, true)
|
||||
failSchedulingClassGet(h, &meta.NoKindMatchError{GroupKind: schema.GroupKind{Group: schedulerapi.Group, Kind: "SchedulingClass"}})
|
||||
pod := newPod("tenant-acme", "db-0")
|
||||
|
||||
if err := h.applySchedulingClass(ctx, pod, nil, "tenant-acme"); err != nil {
|
||||
t.Fatalf("applySchedulingClass returned error: %v", err)
|
||||
}
|
||||
if sched, _, _ := unstructured.NestedString(pod.Object, "spec", "schedulerName"); sched != "" {
|
||||
t.Errorf("pod spec.schedulerName should not be set without the CRD, got %q", sched)
|
||||
}
|
||||
}
|
||||
|
||||
// The application class is looked up once. If it were looked up again before
|
||||
// injecting, a class deleted between the two lookups would leave the pod with
|
||||
// neither the application class nor the tenant class.
|
||||
func TestApplySchedulingClass_ApplicationClassDeletedDuringAdmissionKeepsAClass(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
h := newWebhookTestEnv(t, "tenant-acme", testSchedulingClass, true)
|
||||
addSchedulingClassCR(t, h, "app-class")
|
||||
allowSchedulingClasses(t, h, "tenant-acme", "app-class")
|
||||
lookups := 0
|
||||
h.dynClient.(*dynamicfake.FakeDynamicClient).PrependReactor("get", schedulerapi.Resource,
|
||||
func(action k8stesting.Action) (bool, runtime.Object, error) {
|
||||
if action.(k8stesting.GetAction).GetName() != "app-class" {
|
||||
return false, nil, nil
|
||||
}
|
||||
lookups++
|
||||
if lookups == 1 {
|
||||
return false, nil, nil
|
||||
}
|
||||
return true, nil, apierrors.NewNotFound(schema.GroupResource{Group: schedulerapi.Group, Resource: schedulerapi.Resource}, "app-class")
|
||||
})
|
||||
owner := newOwnerApplication("tenant-acme", "db", map[string]interface{}{"schedulingClass": "app-class"})
|
||||
pod := newPod("tenant-acme", "db-0")
|
||||
|
||||
if err := h.applySchedulingClass(ctx, pod, owner, "tenant-acme"); err != nil {
|
||||
t.Fatalf("applySchedulingClass returned error: %v", err)
|
||||
}
|
||||
|
||||
if sched, _, _ := unstructured.NestedString(pod.Object, "spec", "schedulerName"); sched != schedulerapi.SchedulerName {
|
||||
t.Errorf("expected pod spec.schedulerName=%s, got %q", schedulerapi.SchedulerName, sched)
|
||||
}
|
||||
if got := pod.GetAnnotations()[schedulerapi.SchedulingClassAnnotation]; got != "app-class" {
|
||||
t.Errorf("expected pod annotation %s=app-class, got %q", schedulerapi.SchedulingClassAnnotation, got)
|
||||
}
|
||||
}
|
||||
|
||||
// spec.schedulerName cannot change once a Pod exists. Setting it on an
|
||||
// UPDATE, after the tenant or application class changed, would get every
|
||||
// later update of the Pod refused by the apiserver.
|
||||
func TestHandle_PodUpdateLeavesSchedulingAlone(t *testing.T) {
|
||||
w := newHandleTestWebhook(t)
|
||||
|
||||
resp := w.Handle(context.Background(), admission.Request{AdmissionRequest: admissionv1.AdmissionRequest{
|
||||
Kind: metav1.GroupVersionKind{Version: "v1", Kind: "Pod"},
|
||||
Namespace: "tenant-demo",
|
||||
Name: "harbor-demo-core-0",
|
||||
Operation: admissionv1.Update,
|
||||
Object: runtime.RawExtension{Raw: []byte(podWithNumericFields)},
|
||||
OldObject: runtime.RawExtension{Raw: []byte(podWithNumericFields)},
|
||||
}})
|
||||
if !resp.Allowed {
|
||||
t.Fatalf("expected allowed response, got %+v", resp.Result)
|
||||
}
|
||||
for _, p := range resp.Patches {
|
||||
if p.Path == "/spec/schedulerName" || strings.Contains(p.Path, "scheduling-class") {
|
||||
t.Errorf("UPDATE must not touch scheduling, got %s %s", p.Operation, p.Path)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,12 +4,13 @@
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------- |
|
||||
| `locking` | Provisions bucket from the `-lock` BucketClass (with object lock enabled). | `bool` | `false` |
|
||||
| `storagePool` | Selects a specific BucketClass by storage pool name. | `string` | `""` |
|
||||
| `ui` | 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. | `bool` | `true` |
|
||||
| `publicRead` | 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. | `bool` | `false` |
|
||||
| `users` | Users configuration map. | `map[string]object` | `{}` |
|
||||
| `users[name].readonly` | Whether the user has read-only access. | `bool` | `false` |
|
||||
| Name | Description | Type | Value |
|
||||
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------- |
|
||||
| `locking` | Provisions bucket from the `-lock` BucketClass (with object lock enabled). | `bool` | `false` |
|
||||
| `storagePool` | Selects a specific BucketClass by storage pool name. | `string` | `""` |
|
||||
| `ui` | 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. | `bool` | `true` |
|
||||
| `publicRead` | 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. | `bool` | `false` |
|
||||
| `users` | Users configuration map. | `map[string]object` | `{}` |
|
||||
| `users[name].readonly` | Whether the user has read-only access. | `bool` | `false` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
@@ -38,6 +38,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,3 +16,7 @@ publicRead: false
|
||||
|
||||
## @param {map[string]User} users - Users configuration map.
|
||||
users: {}
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -171,6 +171,13 @@ chart-emitted CronJob renders only when `backup.schedule` is non-empty.
|
||||
| `clickhouseKeeper.replicas` | Number of Keeper replicas. | `int` | `3` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## Parameter examples and reference
|
||||
|
||||
### resources and resourcesPreset
|
||||
|
||||
@@ -377,6 +377,12 @@
|
||||
"x-kubernetes-int-or-string": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,3 +179,9 @@ clickhouseKeeper:
|
||||
size: 1Gi
|
||||
resourcesPreset: "t1.micro"
|
||||
replicas: 3
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -202,3 +202,10 @@ For Cozystack-specific issues, consult the Cozystack documentation or support ch
|
||||
| `securityContext.runAsGroup` | Group ID to run the container. | `int` | `4059` |
|
||||
| `automaticReplacements` | Enable automatic pod replacements. | `bool` | `true` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
@@ -336,6 +336,12 @@
|
||||
"description": "Enable automatic pod replacements.",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -172,3 +172,9 @@ securityContext:
|
||||
|
||||
## @param {bool} automaticReplacements - Enable automatic pod replacements.
|
||||
automaticReplacements: true
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -60,3 +60,10 @@ Without object storage in the tenant chain, Harbor cannot provision its registry
|
||||
| `redis.size` | Persistent Volume size for cache storage. | `quantity` | `1Gi` |
|
||||
| `redis.replicas` | Number of Redis replicas. | `int` | `2` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
@@ -487,6 +487,12 @@
|
||||
"x-kubernetes-int-or-string": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -127,3 +127,9 @@ database:
|
||||
redis:
|
||||
size: 1Gi
|
||||
replicas: 2
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -60,6 +60,13 @@ Neither lowering the `version` field on a running cluster nor rolling the app ba
|
||||
| `kafka.controllerStorageSize` | Persistent Volume size for KRaft controller metadata. | `quantity` | `5Gi` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## Parameter examples and reference
|
||||
|
||||
### resources and resourcesPreset
|
||||
|
||||
@@ -99,6 +99,12 @@ spec:
|
||||
labels:
|
||||
strimzi.io/cluster: ${name}
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
# Flux puts these on everything it renders, and the lineage
|
||||
# walk follows them to the application. A pool created here
|
||||
# has neither them nor an ownerReference, so without them its
|
||||
# broker and controller pods resolve to no application at all.
|
||||
helm.toolkit.fluxcd.io/name: ${name}
|
||||
helm.toolkit.fluxcd.io/namespace: ${ns}
|
||||
annotations:
|
||||
meta.helm.sh/release-name: ${name}
|
||||
meta.helm.sh/release-namespace: ${ns}
|
||||
@@ -134,6 +140,8 @@ spec:
|
||||
labels:
|
||||
strimzi.io/cluster: ${name}
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
helm.toolkit.fluxcd.io/name: ${name}
|
||||
helm.toolkit.fluxcd.io/namespace: ${ns}
|
||||
annotations:
|
||||
meta.helm.sh/release-name: ${name}
|
||||
meta.helm.sh/release-namespace: ${ns}
|
||||
|
||||
@@ -279,3 +279,24 @@ tests:
|
||||
- matchRegex:
|
||||
path: spec.template.spec.containers[0].args[0]
|
||||
pattern: 'brokerPool="b-[0-9a-f]{8}"'
|
||||
|
||||
# The pools are created by the hook, outside Flux, so they carry the
|
||||
# HelmRelease labels themselves: the lineage walk needs them to resolve
|
||||
# broker and controller pods to the Kafka application.
|
||||
- it: labels both node pools with their HelmRelease
|
||||
release:
|
||||
name: test-kafka
|
||||
namespace: tenant-test
|
||||
asserts:
|
||||
- matchRegex:
|
||||
path: spec.template.spec.containers[0].args[0]
|
||||
pattern: 'name: \$\{brokerPool\}\s+namespace: \$\{ns\}\s+labels:\s+strimzi\.io/cluster: \$\{name\}\s+app\.kubernetes\.io/managed-by: Helm\s+(#[^\n]*\s+)*helm\.toolkit\.fluxcd\.io/name: \$\{name\}\s+helm\.toolkit\.fluxcd\.io/namespace: \$\{ns\}\s+annotations:'
|
||||
documentSelector:
|
||||
path: kind
|
||||
value: Job
|
||||
- matchRegex:
|
||||
path: spec.template.spec.containers[0].args[0]
|
||||
pattern: 'name: [-a-z0-9]+\s+namespace: \$\{ns\}\s+labels:\s+strimzi\.io/cluster: \$\{name\}\s+app\.kubernetes\.io/managed-by: Helm\s+helm\.toolkit\.fluxcd\.io/name: \$\{name\}\s+helm\.toolkit\.fluxcd\.io/namespace: \$\{ns\}\s+annotations:\s+meta\.helm\.sh/release-name: \$\{name\}\s+meta\.helm\.sh/release-namespace: \$\{ns\}\s+# Controller node IDs'
|
||||
documentSelector:
|
||||
path: kind
|
||||
value: Job
|
||||
@@ -210,6 +210,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -124,3 +124,9 @@ kafka:
|
||||
size: 10Gi
|
||||
storageClass: ""
|
||||
controllerStorageSize: 5Gi
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -234,6 +234,13 @@ A storage shared between tenants cannot be scoped: `Datastore.Allocate` on it is
|
||||
| `oidc.users[i].role` | Role to bind: `admin` maps to `ClusterRole/cluster-admin`, `view` maps to `ClusterRole/view`. | `string` | `{}` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## Parameter examples and reference
|
||||
|
||||
### resources and resourcesPreset
|
||||
|
||||
@@ -1022,6 +1022,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -379,3 +379,9 @@ oidc:
|
||||
secretRef:
|
||||
name: ""
|
||||
users: []
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -228,6 +228,13 @@ Uninstalling the instance does this for you; only the turn-it-off-and-keep-runni
|
||||
| `backup.resticPassword` | DEPRECATED: Password for Restic backup encryption. | `string` | `<password>` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## Parameter examples and reference
|
||||
|
||||
### resources and resourcesPreset
|
||||
|
||||
@@ -261,6 +261,12 @@
|
||||
"default": "0 2 * * *"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,3 +170,9 @@ backup:
|
||||
s3AccessKey: "<your-access-key>"
|
||||
s3SecretKey: "<your-secret-key>"
|
||||
resticPassword: "<password>"
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -270,3 +270,10 @@ Releases with `external: false`, and sharded releases in any configuration, are
|
||||
| `bootstrap.recoveryTime` | Timestamp for point-in-time recovery; empty means latest. | `string` | `""` |
|
||||
| `bootstrap.backupName` | Name of backup to restore from. | `string` | `""` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
@@ -350,6 +350,12 @@
|
||||
"default": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,3 +191,9 @@ bootstrap:
|
||||
enabled: false
|
||||
recoveryTime: ""
|
||||
backupName: ""
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -24,16 +24,17 @@ It provides a data layer for cloud native applications, IoT messaging, and micro
|
||||
|
||||
### Application-specific parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ---------------------- | ------------------------------------------------------------- | ------------------- | ------ |
|
||||
| `users` | Users configuration map. | `map[string]object` | `{}` |
|
||||
| `users[name].password` | Password for the user. | `string` | `""` |
|
||||
| `jetstream` | Jetstream configuration. | `object` | `{}` |
|
||||
| `jetstream.enabled` | Enable or disable Jetstream for persistent messaging in NATS. | `bool` | `true` |
|
||||
| `jetstream.size` | Jetstream persistent storage size. | `quantity` | `10Gi` |
|
||||
| `config` | NATS configuration. | `object` | `{}` |
|
||||
| `config.merge` | Additional configuration to merge into NATS config. | `*object` | `{}` |
|
||||
| `config.resolver` | Additional resolver configuration to merge into NATS config. | `*object` | `{}` |
|
||||
| Name | Description | Type | Value |
|
||||
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------ |
|
||||
| `users` | Users configuration map. | `map[string]object` | `{}` |
|
||||
| `users[name].password` | Password for the user. | `string` | `""` |
|
||||
| `jetstream` | Jetstream configuration. | `object` | `{}` |
|
||||
| `jetstream.enabled` | Enable or disable Jetstream for persistent messaging in NATS. | `bool` | `true` |
|
||||
| `jetstream.size` | Jetstream persistent storage size. | `quantity` | `10Gi` |
|
||||
| `config` | NATS configuration. | `object` | `{}` |
|
||||
| `config.merge` | Additional configuration to merge into NATS config. | `*object` | `{}` |
|
||||
| `config.resolver` | Additional resolver configuration to merge into NATS config. | `*object` | `{}` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## Parameter examples and reference
|
||||
|
||||
@@ -186,6 +186,12 @@
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -110,3 +110,7 @@ jetstream:
|
||||
config:
|
||||
merge: {}
|
||||
resolver: {}
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -104,3 +104,10 @@ Keep a copy of the key outside the cluster. A Raft snapshot or a data PVC is unr
|
||||
| `seal.previousKeyId` | Identifier of the previous key, with the same character constraints as `keyId`. Required when `previousSecretName` is set. | `string` | `""` |
|
||||
| `seal.allowMigration` | 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. | `bool` | `false` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
@@ -183,6 +183,12 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,3 +112,9 @@ seal:
|
||||
previousSecretName: ""
|
||||
previousKeyId: ""
|
||||
allowMigration: false
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -126,3 +126,10 @@ Every release listed with `EXTERNAL` true was annotated for `opensearch-<name>.<
|
||||
| `dashboards.resources.memory` | Memory (RAM) available to each node. | `quantity` | `""` |
|
||||
| `dashboards.resourcesPreset` | Default sizing preset for Dashboards. | `string` | `c1.small` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
@@ -323,6 +323,12 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -228,3 +228,9 @@ dashboards:
|
||||
replicas: 1
|
||||
resources: {}
|
||||
resourcesPreset: "c1.small"
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -217,6 +217,7 @@ For `sslmode=verify-full` to work, the CA bundle retrieved above must be saved t
|
||||
| `size` | Persistent Volume Claim size available for application data. | `quantity` | `10Gi` |
|
||||
| `storageClass` | StorageClass used to store the data. | `string` | `""` |
|
||||
| `external` | Enable external access from outside the cluster. | `bool` | `false` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
| `version` | PostgreSQL major version to deploy | `string` | `v18` |
|
||||
| `flavor` | 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). | `string` | `postgresql` |
|
||||
|
||||
|
||||
@@ -127,6 +127,12 @@
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
},
|
||||
"version": {
|
||||
"description": "PostgreSQL major version to deploy",
|
||||
"type": "string",
|
||||
|
||||
@@ -75,6 +75,10 @@ storageClass: ""
|
||||
## @param {bool} external - Enable external access from outside the cluster.
|
||||
external: false
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
|
||||
##
|
||||
## @enum {string} Version
|
||||
## @value v18
|
||||
|
||||
@@ -35,6 +35,13 @@ Service deploys Qdrant as a StatefulSet with automatic cluster mode when multipl
|
||||
| `tls.enabled` | Enable TLS. When unset, inherits the value of `external` (TLS is on when external access is enabled). Set explicitly to `true` or `false` to override. | `*bool` | `null` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## Parameter examples and reference
|
||||
|
||||
### resources and resourcesPreset
|
||||
|
||||
@@ -137,6 +137,12 @@
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -84,3 +84,9 @@ external: false
|
||||
|
||||
## @param {TLS} [tls] - TLS configuration. When omitted, the effective TLS state follows the value of `external`.
|
||||
tls: {}
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -40,14 +40,15 @@ The scope is **definitions only** — vhosts, users, permissions, queues, exchan
|
||||
|
||||
### Application-specific parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------------------- | -------------------------------- | ------------------- | ----- |
|
||||
| `users` | Users configuration map. | `map[string]object` | `{}` |
|
||||
| `users[name].password` | Password for the user. | `string` | `""` |
|
||||
| `vhosts` | Virtual hosts configuration map. | `map[string]object` | `{}` |
|
||||
| `vhosts[name].roles` | Virtual host roles list. | `object` | `{}` |
|
||||
| `vhosts[name].roles.admin` | List of admin users. | `[]string` | `[]` |
|
||||
| `vhosts[name].roles.readonly` | List of readonly users. | `[]string` | `[]` |
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ----- |
|
||||
| `users` | Users configuration map. | `map[string]object` | `{}` |
|
||||
| `users[name].password` | Password for the user. | `string` | `""` |
|
||||
| `vhosts` | Virtual hosts configuration map. | `map[string]object` | `{}` |
|
||||
| `vhosts[name].roles` | Virtual host roles list. | `object` | `{}` |
|
||||
| `vhosts[name].roles.admin` | List of admin users. | `[]string` | `[]` |
|
||||
| `vhosts[name].roles.readonly` | List of readonly users. | `[]string` | `[]` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## TLS scope
|
||||
|
||||
@@ -205,6 +205,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -137,3 +137,7 @@ vhosts: {}
|
||||
## roles:
|
||||
## admin:
|
||||
## - user3
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -63,6 +63,13 @@ Service utilizes the freshworks-oss Redis Operator (a maintained fork of the arc
|
||||
| `sentinel.resourcesPreset` | Sizing preset for the Sentinel pods. Defaults to `resourcesPreset`. | `string` | `{}` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## Parameter examples and reference
|
||||
|
||||
### resources and resourcesPreset
|
||||
|
||||
@@ -314,6 +314,12 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,3 +156,9 @@ snapshots: true
|
||||
|
||||
## @param {Sentinel} [sentinel] - 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.
|
||||
sentinel: {}
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -24,16 +24,17 @@ Managed TCP Load Balancer Service efficiently utilizes HAProxy for load balancin
|
||||
|
||||
### Application-specific parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| -------------------------------- | --------------------------------------------------------------------------------------------------------- | ---------- | ------- |
|
||||
| `httpAndHttps` | HTTP and HTTPS configuration. | `object` | `{}` |
|
||||
| `httpAndHttps.mode` | Mode for balancer. | `string` | `tcp` |
|
||||
| `httpAndHttps.targetPorts` | Target ports configuration. | `object` | `{}` |
|
||||
| `httpAndHttps.targetPorts.http` | HTTP port number. | `int` | `80` |
|
||||
| `httpAndHttps.targetPorts.https` | HTTPS port number. | `int` | `443` |
|
||||
| `httpAndHttps.endpoints` | Endpoint addresses list. | `[]string` | `[]` |
|
||||
| `whitelistHTTP` | Secure HTTP and HTTPS by whitelisting client networks. Requires a non-empty `whitelist` (default: false). | `bool` | `false` |
|
||||
| `whitelist` | List of allowed client networks. | `[]string` | `[]` |
|
||||
| Name | Description | Type | Value |
|
||||
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------- |
|
||||
| `httpAndHttps` | HTTP and HTTPS configuration. | `object` | `{}` |
|
||||
| `httpAndHttps.mode` | Mode for balancer. | `string` | `tcp` |
|
||||
| `httpAndHttps.targetPorts` | Target ports configuration. | `object` | `{}` |
|
||||
| `httpAndHttps.targetPorts.http` | HTTP port number. | `int` | `80` |
|
||||
| `httpAndHttps.targetPorts.https` | HTTPS port number. | `int` | `443` |
|
||||
| `httpAndHttps.endpoints` | Endpoint addresses list. | `[]string` | `[]` |
|
||||
| `whitelistHTTP` | Secure HTTP and HTTPS by whitelisting client networks. Requires a non-empty `whitelist` (default: false). | `bool` | `false` |
|
||||
| `whitelist` | List of allowed client networks. | `[]string` | `[]` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## Parameter examples and reference
|
||||
|
||||
@@ -160,6 +160,12 @@
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,3 +103,7 @@ whitelistHTTP: false
|
||||
|
||||
## @param {[]string} whitelist - List of allowed client networks.
|
||||
whitelist: []
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -78,19 +78,20 @@ Tenant network isolation is enforced with Cilium network policies. On the `isp-h
|
||||
|
||||
### Common parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------- |
|
||||
| `host` | The hostname used to access tenant services (defaults to using the tenant name as a subdomain for its parent tenant host). | `string` | `""` |
|
||||
| `etcd` | Deploy own Etcd cluster. | `bool` | `false` |
|
||||
| `monitoring` | Deploy own Monitoring Stack. | `bool` | `false` |
|
||||
| `tracingCentral` | 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. | `bool` | `false` |
|
||||
| `ingress` | Deploy own Ingress Controller. | `bool` | `false` |
|
||||
| `gateway` | 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. | `bool` | `false` |
|
||||
| `gatewayClass` | 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. | `string` | `""` |
|
||||
| `seaweedfs` | Deploy own SeaweedFS. | `bool` | `false` |
|
||||
| `computeplane` | Deploy own ComputePlane — a single-tenant, Cozystack-managed cluster for untrusted-code applications. The tenant receives no admin kubeconfig for it. Automatic routing of catalog applications onto it (placement: ComputePlane) is a planned follow-up and is not available yet; until it lands, external catalogs target the cluster via its computeplane-cluster-admin-kubeconfig Secret. See design-proposals/compute-plane in cozystack/community. | `bool` | `false` |
|
||||
| `schedulingClass` | The name of a SchedulingClass CR to apply scheduling constraints for this tenant's workloads. | `string` | `""` |
|
||||
| `resourceQuotas` | Define resource quotas for the tenant. | `map[string]quantity` | `{}` |
|
||||
| Name | Description | Type | Value |
|
||||
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | ------- |
|
||||
| `host` | The hostname used to access tenant services (defaults to using the tenant name as a subdomain for its parent tenant host). | `string` | `""` |
|
||||
| `etcd` | Deploy own Etcd cluster. | `bool` | `false` |
|
||||
| `monitoring` | Deploy own Monitoring Stack. | `bool` | `false` |
|
||||
| `tracingCentral` | 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. | `bool` | `false` |
|
||||
| `ingress` | Deploy own Ingress Controller. | `bool` | `false` |
|
||||
| `gateway` | 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. | `bool` | `false` |
|
||||
| `gatewayClass` | 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. | `string` | `""` |
|
||||
| `seaweedfs` | Deploy own SeaweedFS. | `bool` | `false` |
|
||||
| `computeplane` | Deploy own ComputePlane — a single-tenant, Cozystack-managed cluster for untrusted-code applications. The tenant receives no admin kubeconfig for it. Automatic routing of catalog applications onto it (placement: ComputePlane) is a planned follow-up and is not available yet; until it lands, external catalogs target the cluster via its computeplane-cluster-admin-kubeconfig Secret. See design-proposals/compute-plane in cozystack/community. | `bool` | `false` |
|
||||
| `schedulingClass` | The name of a SchedulingClass CR to apply scheduling constraints for this tenant's workloads. | `string` | `""` |
|
||||
| `allowedSchedulingClasses` | SchedulingClasses an application in this tenant may select through its own `schedulingClass`, in place of the tenant's. Empty allows none, so every application runs under the tenant's class. Inherited from the parent tenant, and not settable here, when the parent has a `schedulingClass` or a non-empty list. | `[]string` | `[]` |
|
||||
| `resourceQuotas` | Define resource quotas for the tenant. | `map[string]quantity` | `{}` |
|
||||
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -76,6 +76,16 @@
|
||||
{{- if and (not $schedulingClass) .Values.schedulingClass }}
|
||||
{{- $schedulingClass = .Values.schedulingClass }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Classes an application may pick in place of the tenant class. A parent that
|
||||
constrains placement passes its list down unchanged, so a child tenant
|
||||
cannot allow what its parent does not.
|
||||
*/}}
|
||||
{{- $allowedSchedulingClasses := .Values.allowedSchedulingClasses | default list }}
|
||||
{{- if or $parentNamespace.schedulingClass $parentNamespace.allowedSchedulingClasses }}
|
||||
{{- $allowedSchedulingClasses = $parentNamespace.allowedSchedulingClasses | default list }}
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
@@ -95,6 +105,10 @@ metadata:
|
||||
scheduler.cozystack.io/scheduling-class: {{ . | quote }}
|
||||
{{- end }}
|
||||
alpha.kubevirt.io/auto-memory-limits-ratio: "1.0"
|
||||
{{- with $allowedSchedulingClasses }}
|
||||
annotations:
|
||||
namespace.cozystack.io/allowed-scheduling-classes: {{ join "," . | quote }}
|
||||
{{- end }}
|
||||
{{- if $existingNS }}
|
||||
ownerReferences:
|
||||
- apiVersion: v1
|
||||
@@ -131,4 +145,7 @@ stringData:
|
||||
{{- with $schedulingClass }}
|
||||
schedulingClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- with $allowedSchedulingClasses }}
|
||||
allowedSchedulingClasses: {{ toJson . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,102 @@
|
||||
suite: tenant allowed scheduling classes
|
||||
# The namespace annotation is what the scheduling-class admission policy and
|
||||
# the lineage webhook read to decide which SchedulingClass an application may
|
||||
# select instead of the tenant's own. A parent that constrains placement must
|
||||
# pass its list down unchanged, or a child tenant could allow a class its
|
||||
# parent does not.
|
||||
templates:
|
||||
- templates/namespace.yaml
|
||||
set:
|
||||
_cluster:
|
||||
root-host: example.com
|
||||
release:
|
||||
name: tenant-child
|
||||
namespace: tenant-parent
|
||||
tests:
|
||||
- it: allows no class by default
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: kind
|
||||
value: Namespace
|
||||
notExists:
|
||||
path: metadata.annotations["namespace.cozystack.io/allowed-scheduling-classes"]
|
||||
- documentSelector:
|
||||
path: kind
|
||||
value: Secret
|
||||
notMatchRegex:
|
||||
path: stringData["values.yaml"]
|
||||
pattern: allowedSchedulingClasses
|
||||
|
||||
- it: writes the tenant's own list when the parent constrains nothing
|
||||
set:
|
||||
allowedSchedulingClasses: [co-region-a, co-region-b]
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: kind
|
||||
value: Namespace
|
||||
equal:
|
||||
path: metadata.annotations["namespace.cozystack.io/allowed-scheduling-classes"]
|
||||
value: co-region-a,co-region-b
|
||||
- documentSelector:
|
||||
path: kind
|
||||
value: Secret
|
||||
matchRegex:
|
||||
path: stringData["values.yaml"]
|
||||
pattern: 'allowedSchedulingClasses: \["co-region-a","co-region-b"\]'
|
||||
|
||||
- it: ignores the tenant's own list under a parent class with no list
|
||||
set:
|
||||
_namespace:
|
||||
schedulingClass: parent-class
|
||||
allowedSchedulingClasses: [co-region-a]
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: kind
|
||||
value: Namespace
|
||||
equal:
|
||||
path: metadata.labels["scheduler.cozystack.io/scheduling-class"]
|
||||
value: parent-class
|
||||
- documentSelector:
|
||||
path: kind
|
||||
value: Namespace
|
||||
notExists:
|
||||
path: metadata.annotations["namespace.cozystack.io/allowed-scheduling-classes"]
|
||||
- documentSelector:
|
||||
path: kind
|
||||
value: Secret
|
||||
notMatchRegex:
|
||||
path: stringData["values.yaml"]
|
||||
pattern: allowedSchedulingClasses
|
||||
|
||||
- it: inherits the parent's list in place of its own
|
||||
set:
|
||||
_namespace:
|
||||
schedulingClass: parent-class
|
||||
allowedSchedulingClasses: [co-region-a]
|
||||
allowedSchedulingClasses: [co-region-a, co-region-b]
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: kind
|
||||
value: Namespace
|
||||
equal:
|
||||
path: metadata.annotations["namespace.cozystack.io/allowed-scheduling-classes"]
|
||||
value: co-region-a
|
||||
- documentSelector:
|
||||
path: kind
|
||||
value: Secret
|
||||
matchRegex:
|
||||
path: stringData["values.yaml"]
|
||||
pattern: 'allowedSchedulingClasses: \["co-region-a"\]'
|
||||
|
||||
- it: inherits the parent's list when the parent has a list but no class
|
||||
set:
|
||||
_namespace:
|
||||
allowedSchedulingClasses: [co-region-a]
|
||||
allowedSchedulingClasses: [co-region-b]
|
||||
asserts:
|
||||
- documentSelector:
|
||||
path: kind
|
||||
value: Namespace
|
||||
equal:
|
||||
path: metadata.annotations["namespace.cozystack.io/allowed-scheduling-classes"]
|
||||
value: co-region-a
|
||||
@@ -51,6 +51,14 @@
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"allowedSchedulingClasses": {
|
||||
"description": "SchedulingClasses an application in this tenant may select through its own `schedulingClass`, in place of the tenant's. Empty allows none, so every application runs under the tenant's class. Inherited from the parent tenant, and not settable here, when the parent has a `schedulingClass` or a non-empty list.",
|
||||
"type": "array",
|
||||
"default": [],
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"resourceQuotas": {
|
||||
"description": "Define resource quotas for the tenant.",
|
||||
"type": "object",
|
||||
|
||||
@@ -31,5 +31,8 @@ computeplane: false
|
||||
## @param {string} [schedulingClass] - The name of a SchedulingClass CR to apply scheduling constraints for this tenant's workloads.
|
||||
schedulingClass: ""
|
||||
|
||||
## @param {[]string} allowedSchedulingClasses - SchedulingClasses an application in this tenant may select through its own `schedulingClass`, in place of the tenant's. Empty allows none, so every application runs under the tenant's class. Inherited from the parent tenant, and not settable here, when the parent has a `schedulingClass` or a non-empty list.
|
||||
allowedSchedulingClasses: []
|
||||
|
||||
## @param {map[string]quantity} resourceQuotas - Define resource quotas for the tenant.
|
||||
resourceQuotas: {}
|
||||
@@ -31,9 +31,10 @@ Service runs Valkey on the freshworks-oss redis-operator, which manages Sentinel
|
||||
|
||||
### Application-specific parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ------------- | --------------------------- | ------ | ------ |
|
||||
| `authEnabled` | Enable password generation. | `bool` | `true` |
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------ |
|
||||
| `authEnabled` | Enable password generation. | `bool` | `true` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## Parameter examples and reference
|
||||
|
||||
@@ -140,6 +140,12 @@
|
||||
"description": "Enable password generation.",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -88,3 +88,7 @@ version: v8
|
||||
|
||||
## @param {bool} authEnabled - Enable password generation.
|
||||
authEnabled: true
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -14,18 +14,19 @@ A Virtual Machine Disk
|
||||
|
||||
### Common parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ------------------- | ------------------------------------------------------------------------ | ---------- | ------------ |
|
||||
| `source` | The source image location used to create a disk. | `object` | `{}` |
|
||||
| `source.image` | Use image by name from default collection. | `*object` | `null` |
|
||||
| `source.image.name` | Name of the image to use. | `string` | `""` |
|
||||
| `source.upload` | Upload local image. | `*object` | `null` |
|
||||
| `source.http` | Download image from an HTTP source. | `*object` | `null` |
|
||||
| `source.http.url` | URL to download the image. | `string` | `""` |
|
||||
| `source.disk` | Clone an existing vm-disk. | `*object` | `null` |
|
||||
| `source.disk.name` | Name of the vm-disk to clone. | `string` | `""` |
|
||||
| `optical` | Defines if disk should be considered optical. | `bool` | `false` |
|
||||
| `storage` | The size of the disk allocated for the virtual machine. | `quantity` | `5Gi` |
|
||||
| `storageClass` | StorageClass used to store the data. | `string` | `replicated` |
|
||||
| `bindImmediately` | Provision the volume at disk creation instead of waiting for a consumer. | `bool` | `true` |
|
||||
| Name | Description | Type | Value |
|
||||
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------------ |
|
||||
| `source` | The source image location used to create a disk. | `object` | `{}` |
|
||||
| `source.image` | Use image by name from default collection. | `*object` | `null` |
|
||||
| `source.image.name` | Name of the image to use. | `string` | `""` |
|
||||
| `source.upload` | Upload local image. | `*object` | `null` |
|
||||
| `source.http` | Download image from an HTTP source. | `*object` | `null` |
|
||||
| `source.http.url` | URL to download the image. | `string` | `""` |
|
||||
| `source.disk` | Clone an existing vm-disk. | `*object` | `null` |
|
||||
| `source.disk.name` | Name of the vm-disk to clone. | `string` | `""` |
|
||||
| `optical` | Defines if disk should be considered optical. | `bool` | `false` |
|
||||
| `storage` | The size of the disk allocated for the virtual machine. | `quantity` | `5Gi` |
|
||||
| `storageClass` | StorageClass used to store the data. | `string` | `replicated` |
|
||||
| `bindImmediately` | Provision the volume at disk creation instead of waiting for a consumer. | `bool` | `true` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
@@ -98,6 +98,12 @@
|
||||
"description": "Provision the volume at disk creation instead of waiting for a consumer.",
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,3 +37,7 @@ storageClass: replicated
|
||||
|
||||
## @param {bool} bindImmediately - Provision the volume at disk creation instead of waiting for a consumer.
|
||||
bindImmediately: true
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -68,6 +68,7 @@ virtctl ssh <user>@<vm>
|
||||
| `cloudInit` | Cloud-init user data. | `string` | `""` |
|
||||
| `netplanDhcp` | 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. | `bool` | `false` |
|
||||
| `cloudInitSeed` | Seed string to generate SMBIOS UUID for the VM. | `string` | `""` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## U Series
|
||||
|
||||
@@ -234,6 +234,12 @@
|
||||
"description": "Seed string to generate SMBIOS UUID for the VM.",
|
||||
"type": "string",
|
||||
"default": ""
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,3 +130,7 @@ netplanDhcp: false
|
||||
cloudInitSeed: ""
|
||||
## Example:
|
||||
## cloudInitSeed: "upd1"
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -31,12 +31,13 @@ Furthermore, Shadowbox is compatible with standard Shadowsocks clients, providin
|
||||
|
||||
### Application-specific parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ---------------------- | ------------------------------------------------------------------------------------------------------ | ------------------- | ----- |
|
||||
| `host` | Host used to substitute into generated URLs. | `string` | `""` |
|
||||
| `users` | Users configuration map. | `map[string]object` | `{}` |
|
||||
| `users[name].password` | Password for the user (autogenerated if not provided). | `string` | `""` |
|
||||
| `externalIPs` | List of externalIPs for service. Optional. If not specified, will use LoadBalancer service by default. | `[]string` | `[]` |
|
||||
| Name | Description | Type | Value |
|
||||
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ----- |
|
||||
| `host` | Host used to substitute into generated URLs. | `string` | `""` |
|
||||
| `users` | Users configuration map. | `map[string]object` | `{}` |
|
||||
| `users[name].password` | Password for the user (autogenerated if not provided). | `string` | `""` |
|
||||
| `externalIPs` | List of externalIPs for service. Optional. If not specified, will use LoadBalancer service by default. | `[]string` | `[]` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
|
||||
## Parameter examples and reference
|
||||
|
||||
@@ -125,6 +125,12 @@
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,3 +87,7 @@ users: {}
|
||||
|
||||
## @param {[]string} externalIPs - List of externalIPs for service. Optional. If not specified, will use LoadBalancer service by default.
|
||||
externalIPs: []
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -4,20 +4,21 @@
|
||||
|
||||
### Common parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ------------------------- | ----------------------------------------------------- | ---------- | ------- |
|
||||
| `whitelistHTTP` | Secure HTTP by enabling client networks whitelisting. | `bool` | `true` |
|
||||
| `whitelist` | List of client networks. | `[]string` | `[]` |
|
||||
| `machines` | Configuration of physical machine instances. | `[]object` | `[]` |
|
||||
| `machines[i].hostname` | Hostname. | `string` | `""` |
|
||||
| `machines[i].arch` | Architecture. | `string` | `""` |
|
||||
| `machines[i].ip` | IP address configuration. | `object` | `{}` |
|
||||
| `machines[i].ip.address` | IP address. | `string` | `""` |
|
||||
| `machines[i].ip.gateway` | IP gateway. | `string` | `""` |
|
||||
| `machines[i].ip.netmask` | Netmask. | `string` | `""` |
|
||||
| `machines[i].leaseTime` | Lease time. | `int` | `0` |
|
||||
| `machines[i].mac` | MAC addresses. | `[]string` | `[]` |
|
||||
| `machines[i].nameServers` | Name servers. | `[]string` | `[]` |
|
||||
| `machines[i].timeServers` | Time servers. | `[]string` | `[]` |
|
||||
| `machines[i].uefi` | UEFI. | `bool` | `false` |
|
||||
| Name | Description | Type | Value |
|
||||
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- | ------- |
|
||||
| `whitelistHTTP` | Secure HTTP by enabling client networks whitelisting. | `bool` | `true` |
|
||||
| `whitelist` | List of client networks. | `[]string` | `[]` |
|
||||
| `machines` | Configuration of physical machine instances. | `[]object` | `[]` |
|
||||
| `machines[i].hostname` | Hostname. | `string` | `""` |
|
||||
| `machines[i].arch` | Architecture. | `string` | `""` |
|
||||
| `machines[i].ip` | IP address configuration. | `object` | `{}` |
|
||||
| `machines[i].ip.address` | IP address. | `string` | `""` |
|
||||
| `machines[i].ip.gateway` | IP gateway. | `string` | `""` |
|
||||
| `machines[i].ip.netmask` | Netmask. | `string` | `""` |
|
||||
| `machines[i].leaseTime` | Lease time. | `int` | `0` |
|
||||
| `machines[i].mac` | MAC addresses. | `[]string` | `[]` |
|
||||
| `machines[i].nameServers` | Name servers. | `[]string` | `[]` |
|
||||
| `machines[i].timeServers` | Time servers. | `[]string` | `[]` |
|
||||
| `machines[i].uefi` | UEFI. | `bool` | `false` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
@@ -91,6 +91,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,3 +43,7 @@ machines: []
|
||||
## nameServers: [1.1.1.1,8.8.8.8]
|
||||
## timeServers: [pool.ntp.org]
|
||||
## uefi: true
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -44,4 +44,5 @@ coordinates).
|
||||
| `resources.cpu` | Number of CPU cores allocated. | `quantity` | `1000m` |
|
||||
| `resources.memory` | Amount of memory allocated. | `quantity` | `512Mi` |
|
||||
| `affinity` | Affinity rules set verbatim on the EtcdCluster's spec.affinity, replacing the chart default. When left empty the chart applies a soft (preferred) podAntiAffinity by kubernetes.io/hostname on top of the topologySpreadConstraints, which by default require an even spread of members over nodes (whenUnsatisfiable DoNotSchedule, maxSkew 1) unless the platform sets scheduling.globalAppTopologySpreadConstraints. The anti-affinity stays soft because a required rule forbids two members on one node even when every node already has one, so an etcd with more members than schedulable nodes could not start all of them. Set a requiredDuringSchedulingIgnoredDuringExecution rule here only on clusters with at least as many schedulable nodes as members. With node-local storage a recreated member Pod can only return to its own node, so a required rule keeps it Pending while that node holds another member, and the default spread does the same once some other node holds none. The operator copies affinity into each EtcdMember when it creates the member and builds every Pod of that member from that copy, so a change does not reschedule running members and takes effect only as members are replaced by new ones. | `object` | `{}` |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
@@ -71,6 +71,12 @@
|
||||
"type": "object",
|
||||
"default": {},
|
||||
"x-kubernetes-preserve-unknown-fields": true
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,3 +25,7 @@ resources:
|
||||
|
||||
## @param {object} [affinity] - Affinity rules set verbatim on the EtcdCluster's spec.affinity, replacing the chart default. When left empty the chart applies a soft (preferred) podAntiAffinity by kubernetes.io/hostname on top of the topologySpreadConstraints, which by default require an even spread of members over nodes (whenUnsatisfiable DoNotSchedule, maxSkew 1) unless the platform sets scheduling.globalAppTopologySpreadConstraints. The anti-affinity stays soft because a required rule forbids two members on one node even when every node already has one, so an etcd with more members than schedulable nodes could not start all of them. Set a requiredDuringSchedulingIgnoredDuringExecution rule here only on clusters with at least as many schedulable nodes as members. With node-local storage a recreated member Pod can only return to its own node, so a required rule keeps it Pending while that node holds another member, and the default spread does the same once some other node holds none. The operator copies affinity into each EtcdMember when it creates the member and builds every Pod of that member from that copy, so a change does not reschedule running members and takes effect only as members are replaced by new ones.
|
||||
affinity: {}
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
@@ -86,3 +86,10 @@
|
||||
| `resources.memory` | Memory (RAM) available to each replica. | `quantity` | `""` |
|
||||
| `resourcesPreset` | Default sizing preset used when `resources` is omitted. | `string` | `t1.nano` |
|
||||
|
||||
|
||||
### Scheduling parameters
|
||||
|
||||
| Name | Description | Type | Value |
|
||||
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----- |
|
||||
| `schedulingClass` | Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant. | `string` | `""` |
|
||||
|
||||
@@ -228,6 +228,12 @@
|
||||
"xlarge",
|
||||
"2xlarge"
|
||||
]
|
||||
},
|
||||
"schedulingClass": {
|
||||
"description": "Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 63
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,3 +187,9 @@ resources: {}
|
||||
|
||||
## @param {ResourcesPreset} resourcesPreset="t1.nano" - Default sizing preset used when `resources` is omitted.
|
||||
resourcesPreset: "t1.nano"
|
||||
|
||||
## @section Scheduling parameters
|
||||
|
||||
## @param {string} schedulingClass - Name of a SchedulingClass CR (cluster-scoped, group cozystack.io) used in place of the tenant's for this application's pods. A pod gets its class when it is created, so running pods keep theirs until they are recreated. Must be the tenant's own class or one listed in the tenant's `allowedSchedulingClasses`. Setting any other value is refused, and the pods of an application whose class is not, or no longer, in that list get the tenant's class. Empty means inherit from the tenant.
|
||||
## @maxLength 63
|
||||
schedulingClass: ""
|
||||
Loaded 100 of 142 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user