mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 12:16:03 +09:00
The lineage webhook keeps a pod on the tenant class when the application names a class the tenant does not allow, but it can only log that, on a pod the user never looks at. Refusing the application at admission puts the error where the field was set, with the list of classes that would be accepted. An update that keeps the class is not refused, so an application whose class was removed from the list after admission stays editable; the webhook already keeps its pods on the tenant class. Tenants are left out, because their spec.schedulingClass is the child tenant's class, which the tenant chart's inheritance governs. Users read the field description in the dashboard form and the API schema, so it names the tenant setting that decides which classes are accepted, says that only setting another value is refused, and that a pod gets its class when it is created, so running pods keep theirs. The field sits in its own README section, since a reader looking for placement would not look under the unrelated heading it was appended to. Assisted-by: LLM Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
200 lines
7.8 KiB
YAML
200 lines
7.8 KiB
YAML
##
|
|
## @section Common parameters
|
|
##
|
|
|
|
## @typedef {struct} Resources - Explicit CPU and memory configuration for each MongoDB replica.
|
|
## @field {quantity} [cpu] - CPU available to each replica.
|
|
## @field {quantity} [memory] - Memory (RAM) available to each replica.
|
|
|
|
## @enum {string} ResourcesPreset - Default sizing preset.
|
|
## @value t1.nano
|
|
## @value t1.micro
|
|
## @value t1.small
|
|
## @value t1.medium
|
|
## @value t1.large
|
|
## @value t1.xlarge
|
|
## @value t1.2xlarge
|
|
## @value t1.4xlarge
|
|
## @value c1.nano
|
|
## @value c1.micro
|
|
## @value c1.small
|
|
## @value c1.medium
|
|
## @value c1.large
|
|
## @value c1.xlarge
|
|
## @value c1.2xlarge
|
|
## @value c1.4xlarge
|
|
## @value s1.nano
|
|
## @value s1.micro
|
|
## @value s1.small
|
|
## @value s1.medium
|
|
## @value s1.large
|
|
## @value s1.xlarge
|
|
## @value s1.2xlarge
|
|
## @value s1.4xlarge
|
|
## @value u1.nano
|
|
## @value u1.micro
|
|
## @value u1.small
|
|
## @value u1.medium
|
|
## @value u1.large
|
|
## @value u1.xlarge
|
|
## @value u1.2xlarge
|
|
## @value u1.4xlarge
|
|
## @value m1.nano
|
|
## @value m1.micro
|
|
## @value m1.small
|
|
## @value m1.medium
|
|
## @value m1.large
|
|
## @value m1.xlarge
|
|
## @value m1.2xlarge
|
|
## @value m1.4xlarge
|
|
## @value nano
|
|
## @value micro
|
|
## @value small
|
|
## @value medium
|
|
## @value large
|
|
## @value xlarge
|
|
## @value 2xlarge
|
|
|
|
## @param {int} replicas - Number of MongoDB replicas in replica set.
|
|
replicas: 3
|
|
|
|
## @param {Resources} [resources] - Explicit CPU and memory configuration for each MongoDB replica. When omitted, the preset defined in `resourcesPreset` is applied.
|
|
resources: {}
|
|
|
|
## @param {ResourcesPreset} resourcesPreset="t1.small" - Default sizing preset used when `resources` is omitted.
|
|
resourcesPreset: "t1.small"
|
|
|
|
## @param {quantity} size - Persistent Volume Claim size available for application data.
|
|
size: 10Gi
|
|
|
|
## @param {string} storageClass - StorageClass used to store the data.
|
|
## @immutable
|
|
## @x-cozystack-options {source: storageclass}
|
|
storageClass: ""
|
|
|
|
## @param {bool} external - Enable external access from outside the cluster.
|
|
external: false
|
|
|
|
##
|
|
## @enum {string} Version
|
|
## @value v8
|
|
## @value v7
|
|
## @value v6
|
|
|
|
## @param {Version} version - MongoDB major version to deploy.
|
|
version: v8
|
|
|
|
##
|
|
## @section Sharding configuration
|
|
##
|
|
|
|
## @param {bool} sharding - Enable sharded cluster mode. When disabled, deploys a replica set.
|
|
sharding: false
|
|
|
|
## @typedef {struct} ShardingConfig - Sharded cluster configuration.
|
|
## @field {int} configServers - Number of config server replicas.
|
|
## @field {quantity} configServerSize - PVC size for config servers.
|
|
## @field {int} mongos - Number of mongos router replicas.
|
|
## @field {[]Shard} shards - List of shard configurations.
|
|
|
|
## @typedef {struct} Shard - Individual shard configuration.
|
|
## @field {string} name - Shard name.
|
|
## @field {int} replicas - Number of replicas in this shard.
|
|
## @field {quantity} size - PVC size for this shard.
|
|
|
|
## @param {ShardingConfig} shardingConfig - Configuration for sharded cluster mode.
|
|
shardingConfig:
|
|
configServers: 3
|
|
configServerSize: 3Gi
|
|
mongos: 2
|
|
shards:
|
|
- name: rs0
|
|
replicas: 3
|
|
size: 10Gi
|
|
|
|
##
|
|
## @section Users configuration
|
|
##
|
|
|
|
## @typedef {struct} User - User configuration.
|
|
## @field {string} [password] - Password for the user (auto-generated if omitted).
|
|
|
|
## @param {map[string]User} users - Users configuration map.
|
|
users: {}
|
|
## Example:
|
|
## users:
|
|
## user1:
|
|
## password: strongpassword
|
|
## user2: {}
|
|
|
|
##
|
|
## @section Databases configuration
|
|
##
|
|
|
|
## @typedef {struct} DatabaseRoles - Role assignments for a database.
|
|
## @field {[]string} [admin] - List of users with admin privileges (readWrite + dbAdmin).
|
|
## @field {[]string} [readonly] - List of users with read-only privileges.
|
|
|
|
## @typedef {struct} Database - Database configuration.
|
|
## @field {DatabaseRoles} [roles] - Roles assigned to users.
|
|
|
|
## @param {map[string]Database} databases - Databases configuration map.
|
|
databases: {}
|
|
## Example:
|
|
## databases:
|
|
## myapp:
|
|
## roles:
|
|
## admin:
|
|
## - user1
|
|
## readonly:
|
|
## - user2
|
|
|
|
##
|
|
## @section Backup parameters
|
|
##
|
|
|
|
## @typedef {struct} Backup - Backup configuration.
|
|
## @field {bool} enabled - Enable regular backups.
|
|
## @field {bool} [useSystemBucket] - Opt-in: back up to the platform system bucket without supplying S3 credentials. The cozy-default MongoDB BackupClass injects the storage at BackupJob time; tenants do not set s3AccessKey/s3SecretKey/destinationPath/endpointURL, and backups scope to `<namespace>/<application>`. Scheduling moves to a BackupClass Plan; `schedule`, `retentionPolicy` and PITR are ignored while this is on, and this flow has no retention yet (see https://cozystack.io/docs/v1/operations/services/backup-classes/). Requires `backup.enabled: true` (the pbm agents run on that flag); the chart refuses the combination with `enabled: false` at render time; the schema carries the same rule as a marker for the UI and for the day the apiserver enforces CEL on application schemas (cozystack/cozystack#2657), which it does not yet. A release that has not yet rendered this flag (its cluster still carries the chart's scheduled tasks and PITR) holds a BackupJob until it does, so the tenant's own storage is never injected over.
|
|
## @field {string} [schedule] - Cron schedule for automated backups. Ignored when useSystemBucket is true (scheduling moves to the BackupClass Plan).
|
|
## @field {string} [retentionPolicy] - Retention policy (e.g. "30d"). Ignored when useSystemBucket is true (no engine-side retention on that flow).
|
|
## @field {string} [destinationPath] - Destination path for backups (e.g. s3://bucket/path/). Ignored when useSystemBucket is true (the driver injects the platform bucket).
|
|
## @field {string} [endpointURL] - S3 endpoint URL for uploads. Ignored when useSystemBucket is true (the strategy supplies the platform endpoint).
|
|
## @field {bool} [insecureSkipTLSVerify] - Skip TLS verification for the S3 endpoint (self-signed, e.g. in-cluster seaweedfs). Ignored when useSystemBucket is true (the platform backupStorage knob applies instead).
|
|
## @field {string} [s3AccessKey] - Access key for S3 authentication. Ignored when useSystemBucket is true (credentials come from the projected cozy-backups-creds).
|
|
## @field {string} [s3SecretKey] - Secret key for S3 authentication. Ignored when useSystemBucket is true (credentials come from the projected cozy-backups-creds).
|
|
|
|
## @param {Backup} backup - Backup configuration.
|
|
## @x-kubernetes-validations [{rule: "!(has(self.useSystemBucket) && self.useSystemBucket) || (has(self.enabled) && self.enabled)", message: "backup.useSystemBucket requires backup.enabled: the percona-backup-mongodb agents only run when backups are enabled"}]
|
|
backup:
|
|
enabled: false
|
|
useSystemBucket: false
|
|
schedule: "0 2 * * *"
|
|
retentionPolicy: 30d
|
|
destinationPath: "s3://bucket/path/to/folder/"
|
|
endpointURL: "http://minio-gateway-service:9000"
|
|
insecureSkipTLSVerify: false
|
|
s3AccessKey: ""
|
|
s3SecretKey: ""
|
|
|
|
##
|
|
## @section Bootstrap (recovery) parameters
|
|
##
|
|
|
|
## @typedef {struct} Bootstrap - Bootstrap configuration for restoring a database cluster from a backup.
|
|
## @field {bool} enabled - Whether to restore from a backup.
|
|
## @field {string} [recoveryTime] - Timestamp for point-in-time recovery; empty means latest.
|
|
## @field {string} backupName - Name of backup to restore from.
|
|
|
|
## @param {Bootstrap} bootstrap - Bootstrap configuration.
|
|
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: ""
|