mirror of
https://github.com/cozystack/cozystack.git
synced 2026-12-06 23:23:23 +09:00
Application values reach chart templates as strings, maps and lists, and several templates rendered them as-is. Values are now quoted or converted to their type where they are rendered, map keys used as names or config keys are checked against what their target accepts, hook Jobs read their data from environment variables, and values handed to upstream charts are passed in the form those charts expect. cozy-lib gains cozy-lib.yaml.toYaml and cozy-lib.yaml.fromYaml, which fail the render on a value they cannot encode or decode instead of returning an empty result. external-dns GoDaddy credentials move from args to a Secret. Values that were valid before keep rendering: NATS units, restic short keep flags, MongoDB database names by MongoDB's own rule, uppercase and IPv6 VPN hosts, bootbox hostnames that are subdomains, netmask whitelists, bracketed IPv6 registries for the Talos installer, time zones and intervals in the MongoDB backup schedule. Co-authored-by: Timofei Larkin <lllamnyp@gmail.com> Assisted-by: LLM Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
207 lines
8.5 KiB
YAML
207 lines
8.5 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.
|
|
## @maxLength 253
|
|
## @pattern ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)?$
|
|
## @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.
|
|
## @maxLength 63
|
|
## @pattern ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
|
|
## @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. Users have no settings of their own; their roles come from `databases`.
|
|
|
|
## @param {map[string]User} users - Users configuration map. Each user is a MongoDB user the operator manages from an account Secret the platform keeps. Passwords are issued through the Cozystack credentials API: a mint on the account's `Credential` (`core.cozystack.io`) returns a new password once, and a revoke retires the password without issuing one. A `password` key here is ignored. The names of the MongoDB system users (`backup`, `clusterAdmin`, `clusterMonitor`, `databaseAdmin`, `userAdmin`) are refused.
|
|
users: {}
|
|
## Example:
|
|
## users:
|
|
## user1: {}
|
|
## 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).
|
|
## @pattern ^[-0-9A-Za-z*/,@? ._=]*$
|
|
## @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).
|
|
## @pattern ^[^\s"'$`\x5c;&|<>(){}]*$
|
|
## @field {string} [endpointURL] - S3 endpoint URL for uploads. Ignored when useSystemBucket is true (the strategy supplies the platform endpoint).
|
|
## @pattern ^[^\s"'$`\x5c;&|<>(){}]*$
|
|
## @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.
|
|
## @pattern ^[0-9TZtz:.+ -]*$
|
|
## @field {string} backupName - Name of backup to restore from.
|
|
## @pattern ^[^\s"'$`\x5c;&|<>(){}]*$
|
|
|
|
## @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: ""
|