From 754d5a976db02df5d1482237eef280061003d10b Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Fri, 18 Jul 2025 23:39:12 +0200 Subject: [PATCH] [apps] Introduce new OpenAPI schema generator Use https://github.com/cozystack/cozyvalues-gen for three apps: - apps/postgres - apps/virtual-machine - extra/monitoring Changes: - Add type and enum definitions to values.yaml. - Update READMEs with new information. - Update values.schema.json with definitions for children objects, allowing precise UI customization. Add regexp for specific types such as resources: CPU like `500m` and RAM like `4GiB`. - Remove direct injections with `yq` from Makefiles where they're not needed anymore. Co-authored-by: Nick Volynkin Signed-off-by: Andrei Kvapil Signed-off-by: Nick Volynkin --- .github/workflows/pre-commit.yml | 1 + packages/apps/postgres/Makefile | 4 +- packages/apps/postgres/README.md | 75 ++- packages/apps/postgres/values.schema.json | 379 ++++++++----- packages/apps/postgres/values.yaml | 67 ++- packages/apps/virtual-machine/Makefile | 5 +- packages/apps/virtual-machine/README.md | 40 +- .../apps/virtual-machine/values.schema.json | 106 ++-- packages/apps/virtual-machine/values.yaml | 57 +- packages/extra/monitoring/Makefile | 6 +- packages/extra/monitoring/README.md | 104 +++- packages/extra/monitoring/values.schema.json | 533 ++++++++++++++---- packages/extra/monitoring/values.yaml | 69 ++- 13 files changed, 1026 insertions(+), 420 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index a06a171f..e00fe0d7 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -29,6 +29,7 @@ jobs: - name: Install generate run: | curl -sSL https://github.com/cozystack/readme-generator-for-helm/releases/download/v1.0.0/readme-generator-for-helm-linux-amd64.tar.gz | tar -xzvf- -C /usr/local/bin/ readme-generator-for-helm + curl -sSL https://github.com/cozystack/cozyvalues-gen/releases/download/v0.7.0/cozyvalues-gen-linux-amd64.tar.gz | tar -xzvf- -C /usr/local/bin/ cozyvalues-gen - name: Run pre-commit hooks run: | diff --git a/packages/apps/postgres/Makefile b/packages/apps/postgres/Makefile index 4a92cb71..7017c673 100644 --- a/packages/apps/postgres/Makefile +++ b/packages/apps/postgres/Makefile @@ -1,6 +1,4 @@ include ../../../scripts/package.mk -PRESET_ENUM := ["nano","micro","small","medium","large","xlarge","2xlarge"] generate: - readme-generator-for-helm -v values.yaml -s values.schema.json -r README.md - yq -i -o json --indent 4 '.properties.resourcesPreset.enum = $(PRESET_ENUM)' values.schema.json + cozyvalues-gen -v values.yaml -s values.schema.json -r README.md diff --git a/packages/apps/postgres/README.md b/packages/apps/postgres/README.md index e0a17ec6..c9cda3c3 100644 --- a/packages/apps/postgres/README.md +++ b/packages/apps/postgres/README.md @@ -66,44 +66,61 @@ See: ### Common parameters -| Name | Description | Value | -| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------- | ------- | -| `replicas` | Number of Postgres replicas | `2` | -| `resources` | Explicit CPU and memory configuration for each PostgreSQL replica. When left empty, the preset defined in `resourcesPreset` is applied. | `{}` | -| `resourcesPreset` | Default sizing preset used when `resources` is omitted. Allowed values: nano, micro, small, medium, large, xlarge, 2xlarge. | `micro` | -| `size` | Persistent Volume size | `10Gi` | -| `storageClass` | StorageClass used to store the data | `""` | -| `external` | Enable external access from outside the cluster | `false` | +| Name | Description | Type | Value | +| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------- | --------- | ------- | +| `replicas` | Number of Postgres replicas | `int` | `2` | +| `resources` | Explicit CPU and memory configuration for each PostgreSQL replica. When left empty, the preset defined in `resourcesPreset` is applied. | `*object` | `{}` | +| `resources.cpu` | CPU | `*string` | `null` | +| `resources.memory` | Memory | `*string` | `null` | +| `resourcesPreset` | Default sizing preset used when `resources` is omitted. Allowed values: `nano`, `micro`, `small`, `medium`, `large`, `xlarge`, `2xlarge`. | `string` | `{}` | +| `size` | Persistent Volume Claim size, available for application data | `string` | `10Gi` | +| `storageClass` | StorageClass used to store the data | `string` | `""` | +| `external` | Enable external access from outside the cluster | `bool` | `false` | + ### Application-specific parameters -| Name | Description | Value | -| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----- | -| `postgresql.parameters.max_connections` | Determines the maximum number of concurrent connections to the database server. The default is typically 100 connections | `100` | -| `quorum.minSyncReplicas` | Minimum number of synchronous replicas that must acknowledge a transaction before it is considered committed. | `0` | -| `quorum.maxSyncReplicas` | Maximum number of synchronous replicas that can acknowledge a transaction (must be lower than the number of instances). | `0` | -| `users` | Users configuration | `{}` | -| `databases` | Databases configuration | `{}` | +| Name | Description | Type | Value | +| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ------------------- | ------- | +| `postgresql` | PostgreSQL server configuration | `object` | `{}` | +| `postgresql.parameters` | PostgreSQL server parameters | `object` | `{}` | +| `postgresql.parameters.max_connections` | Determines the maximum number of concurrent connections to the database server. The default is typically 100 connections | `int` | `100` | +| `quorum` | Quorum configuration for synchronous replication | `object` | `{}` | +| `quorum.minSyncReplicas` | Minimum number of synchronous replicas that must acknowledge a transaction before it is considered committed. | `int` | `0` | +| `quorum.maxSyncReplicas` | Maximum number of synchronous replicas that can acknowledge a transaction (must be lower than the number of instances). | `int` | `0` | +| `users` | Users configuration | `map[string]object` | `{...}` | +| `users[name].password` | Password for the user | `*string` | `null` | +| `users[name].replication` | Whether the user has replication privileges | `*bool` | `null` | +| `databases` | Databases configuration | `map[string]object` | `{...}` | +| `databases[name].roles` | Roles for the database | `*object` | `null` | +| `databases[name].roles.admin` | List of users with admin privileges | `[]string` | `[]` | +| `databases[name].roles.readonly` | List of users with read-only privileges | `[]string` | `[]` | +| `databases[name].extensions` | Extensions enabled for the database | `[]string` | `[]` | + ### Backup parameters -| Name | Description | Value | -| ------------------------ | ---------------------------------------------------------- | ----------------------------------- | -| `backup.enabled` | Enable regular backups | `false` | -| `backup.schedule` | Cron schedule for automated backups | `0 2 * * * *` | -| `backup.retentionPolicy` | Retention policy | `30d` | -| `backup.destinationPath` | Path to store the backup (i.e. s3://bucket/path/to/folder) | `s3://bucket/path/to/folder/` | -| `backup.endpointURL` | S3 Endpoint used to upload data to the cloud | `http://minio-gateway-service:9000` | -| `backup.s3AccessKey` | Access key for S3, used for authentication | `oobaiRus9pah8PhohL1ThaeTa4UVa7gu` | -| `backup.s3SecretKey` | Secret key for S3, used for authentication | `ju3eum4dekeich9ahM1te8waeGai0oog` | +| Name | Description | Type | Value | +| ------------------------ | ---------------------------------------------------------- | -------- | ----------------------------------- | +| `backup` | Backup configuration | `object` | `{}` | +| `backup.enabled` | Enable regular backups | `bool` | `false` | +| `backup.schedule` | Cron schedule for automated backups | `string` | `0 2 * * * *` | +| `backup.retentionPolicy` | Retention policy | `string` | `30d` | +| `backup.destinationPath` | Path to store the backup (i.e. s3://bucket/path/to/folder) | `string` | `s3://bucket/path/to/folder/` | +| `backup.endpointURL` | S3 Endpoint used to upload data to the cloud | `string` | `http://minio-gateway-service:9000` | +| `backup.s3AccessKey` | Access key for S3, used for authentication | `string` | `` | +| `backup.s3SecretKey` | Secret key for S3, used for authentication | `string` | `` | + ### Bootstrap (recovery) parameters -| Name | Description | Value | -| ------------------------ | -------------------------------------------------------------------------------------------------------------------- | ------- | -| `bootstrap.enabled` | Restore database cluster from a backup | `false` | -| `bootstrap.recoveryTime` | Timestamp (PITR) up to which recovery will proceed, expressed in RFC 3339 format. If left empty, will restore latest | `""` | -| `bootstrap.oldName` | Name of database cluster before deleting | `""` | +| Name | Description | Type | Value | +| ------------------------ | -------------------------------------------------------------------------------------------------------------------- | --------- | ------- | +| `bootstrap` | Bootstrap configuration | `object` | `{}` | +| `bootstrap.enabled` | Restore database cluster from a backup | `bool` | `false` | +| `bootstrap.recoveryTime` | Timestamp (PITR) up to which recovery will proceed, expressed in RFC 3339 format. If left empty, will restore latest | `*string` | `""` | +| `bootstrap.oldName` | Name of database cluster before deleting | `string` | `""` | + ## Parameter examples and reference diff --git a/packages/apps/postgres/values.schema.json b/packages/apps/postgres/values.schema.json index 6964fde1..9ba39ebc 100644 --- a/packages/apps/postgres/values.schema.json +++ b/packages/apps/postgres/values.schema.json @@ -1,140 +1,257 @@ { - "properties": { - "backup": { - "properties": { - "destinationPath": { - "default": "s3://bucket/path/to/folder/", - "description": "Path to store the backup (i.e. s3://bucket/path/to/folder)", - "type": "string" - }, - "enabled": { - "default": false, - "description": "Enable regular backups", - "type": "boolean" - }, - "endpointURL": { - "default": "http://minio-gateway-service:9000", - "description": "S3 Endpoint used to upload data to the cloud", - "type": "string" - }, - "retentionPolicy": { - "default": "30d", - "description": "Retention policy", - "type": "string" - }, - "s3AccessKey": { - "default": "oobaiRus9pah8PhohL1ThaeTa4UVa7gu", - "description": "Access key for S3, used for authentication", - "type": "string" - }, - "s3SecretKey": { - "default": "ju3eum4dekeich9ahM1te8waeGai0oog", - "description": "Secret key for S3, used for authentication", - "type": "string" - }, - "schedule": { - "default": "0 2 * * * *", - "description": "Cron schedule for automated backups", - "type": "string" - } - }, - "type": "object" + "title": "Chart Values", + "type": "object", + "properties": { + "backup": { + "description": "Backup configuration", + "type": "object", + "default": { + "destinationPath": "s3://bucket/path/to/folder/", + "enabled": false, + "endpointURL": "http://minio-gateway-service:9000", + "retentionPolicy": "30d", + "s3AccessKey": "\u003caccess key\u003e", + "s3SecretKey": "\u003csecret key\u003e", + "schedule": "0 2 * * * *" + }, + "required": [ + "destinationPath", + "enabled", + "endpointURL", + "retentionPolicy", + "s3AccessKey", + "s3SecretKey", + "schedule" + ], + "properties": { + "destinationPath": { + "description": "Path to store the backup (i.e. s3://bucket/path/to/folder)", + "type": "string", + "default": "s3://bucket/path/to/folder/" }, - "bootstrap": { - "properties": { - "enabled": { - "default": false, - "description": "Restore database cluster from a backup", - "type": "boolean" - }, - "oldName": { - "default": "", - "description": "Name of database cluster before deleting", - "type": "string" - }, - "recoveryTime": { - "default": "", - "description": "Timestamp (PITR) up to which recovery will proceed, expressed in RFC 3339 format. If left empty, will restore latest", - "type": "string" - } - }, - "type": "object" + "enabled": { + "description": "Enable regular backups", + "type": "boolean", + "default": false }, - "databases": { - "default": {}, - "description": "Databases configuration", - "type": "object" + "endpointURL": { + "description": "S3 Endpoint used to upload data to the cloud", + "type": "string", + "default": "http://minio-gateway-service:9000" }, - "external": { - "default": false, - "description": "Enable external access from outside the cluster", - "type": "boolean" + "retentionPolicy": { + "description": "Retention policy", + "type": "string", + "default": "30d" }, - "postgresql": { - "properties": { - "parameters": { - "properties": { - "max_connections": { - "default": 100, - "description": "Determines the maximum number of concurrent connections to the database server. The default is typically 100 connections", - "type": "number" - } - }, - "type": "object" - } - }, - "type": "object" + "s3AccessKey": { + "description": "Access key for S3, used for authentication", + "type": "string", + "default": "\u003caccess key\u003e" }, - "quorum": { - "properties": { - "maxSyncReplicas": { - "default": 0, - "description": "Maximum number of synchronous replicas that can acknowledge a transaction (must be lower than the number of instances).", - "type": "number" - }, - "minSyncReplicas": { - "default": 0, - "description": "Minimum number of synchronous replicas that must acknowledge a transaction before it is considered committed.", - "type": "number" - } - }, - "type": "object" + "s3SecretKey": { + "description": "Secret key for S3, used for authentication", + "type": "string", + "default": "\u003csecret key\u003e" }, - "replicas": { - "default": 2, - "description": "Number of Postgres replicas", - "type": "number" - }, - "resources": { - "default": {}, - "description": "Explicit CPU and memory configuration for each PostgreSQL replica. When left empty, the preset defined in `resourcesPreset` is applied.", - "type": "object" - }, - "resourcesPreset": { - "default": "micro", - "description": "Default sizing preset used when `resources` is omitted. Allowed values: nano, micro, small, medium, large, xlarge, 2xlarge.", - "type": "string", - "enum": [ - "nano", - "micro", - "small", - "medium", - "large", - "xlarge", - "2xlarge" - ] - }, - "size": { - "default": "10Gi", - "description": "Persistent Volume size", - "type": "string" - }, - "storageClass": { - "default": "", - "description": "StorageClass used to store the data", - "type": "string" + "schedule": { + "description": "Cron schedule for automated backups", + "type": "string", + "default": "0 2 * * * *" } + } }, - "title": "Chart Values", - "type": "object" -} + "bootstrap": { + "description": "Bootstrap configuration", + "type": "object", + "default": { + "enabled": false, + "oldName": "", + "recoveryTime": "" + }, + "required": [ + "enabled", + "oldName" + ], + "properties": { + "enabled": { + "description": "Restore database cluster from a backup", + "type": "boolean", + "default": false + }, + "oldName": { + "description": "Name of database cluster before deleting", + "type": "string" + }, + "recoveryTime": { + "description": "Timestamp (PITR) up to which recovery will proceed, expressed in RFC 3339 format. If left empty, will restore latest", + "type": "string" + } + } + }, + "databases": { + "description": "Databases configuration", + "type": "object", + "default": {}, + "additionalProperties": { + "type": "object", + "properties": { + "extensions": { + "description": "Extensions enabled for the database", + "type": "array", + "items": { + "type": "string" + } + }, + "roles": { + "description": "Roles for the database", + "type": "object", + "properties": { + "admin": { + "description": "List of users with admin privileges", + "type": "array", + "items": { + "type": "string" + } + }, + "readonly": { + "description": "List of users with read-only privileges", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "external": { + "description": "Enable external access from outside the cluster", + "type": "boolean", + "default": false + }, + "postgresql": { + "description": "PostgreSQL server configuration", + "type": "object", + "default": { + "parameters": { + "max_connections": 100 + } + }, + "required": [ + "parameters" + ], + "properties": { + "parameters": { + "description": "PostgreSQL server parameters", + "type": "object", + "default": { + "max_connections": 100 + }, + "required": [ + "max_connections" + ], + "properties": { + "max_connections": { + "description": "Determines the maximum number of concurrent connections to the database server. The default is typically 100 connections", + "type": "integer", + "default": 100 + } + } + } + } + }, + "quorum": { + "description": "Quorum configuration for synchronous replication", + "type": "object", + "default": { + "maxSyncReplicas": 0, + "minSyncReplicas": 0 + }, + "required": [ + "maxSyncReplicas", + "minSyncReplicas" + ], + "properties": { + "maxSyncReplicas": { + "description": "Maximum number of synchronous replicas that can acknowledge a transaction (must be lower than the number of instances).", + "type": "integer", + "default": 0 + }, + "minSyncReplicas": { + "description": "Minimum number of synchronous replicas that must acknowledge a transaction before it is considered committed.", + "type": "integer", + "default": 0 + } + } + }, + "replicas": { + "description": "Number of Postgres replicas", + "type": "integer", + "default": 2 + }, + "resources": { + "description": "Explicit CPU and memory configuration for each PostgreSQL replica. When left empty, the preset defined in `resourcesPreset` is applied.", + "type": "object", + "default": {}, + "properties": { + "cpu": { + "description": "CPU", + "type": "string", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory", + "type": "string", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + }, + "resourcesPreset": { + "description": "Default sizing preset used when `resources` is omitted. Allowed values: `nano`, `micro`, `small`, `medium`, `large`, `xlarge`, `2xlarge`.", + "type": "string", + "default": "micro", + "enum": [ + "nano", + "micro", + "small", + "medium", + "large", + "xlarge", + "2xlarge" + ] + }, + "size": { + "description": "Persistent Volume Claim size, available for application data", + "type": "string", + "default": "10Gi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "storageClass": { + "description": "StorageClass used to store the data", + "type": "string" + }, + "users": { + "description": "Users configuration", + "type": "object", + "default": {}, + "additionalProperties": { + "type": "object", + "properties": { + "password": { + "description": "Password for the user", + "type": "string" + }, + "replication": { + "description": "Whether the user has replication privileges", + "type": "boolean" + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/apps/postgres/values.yaml b/packages/apps/postgres/values.yaml index 25aa091e..bd283477 100644 --- a/packages/apps/postgres/values.yaml +++ b/packages/apps/postgres/values.yaml @@ -1,36 +1,44 @@ ## @section Common parameters ## -## @param replicas Number of Postgres replicas +## @param replicas {int} Number of Postgres replicas replicas: 2 -## @param resources Explicit CPU and memory configuration for each PostgreSQL replica. When left empty, the preset defined in `resourcesPreset` is applied. +## @param resources {*resources} Explicit CPU and memory configuration for each PostgreSQL replica. When left empty, the preset defined in `resourcesPreset` is applied. +## @field resources.cpu {*quantity} CPU +## @field resources.memory {*quantity} Memory resources: {} # resources: # cpu: 4000m # memory: 4Gi -## @param resourcesPreset Default sizing preset used when `resources` is omitted. Allowed values: nano, micro, small, medium, large, xlarge, 2xlarge. +## @param resourcesPreset {string enum:"nano,micro,small,medium,large,xlarge,2xlarge"} Default sizing preset used when `resources` is omitted. Allowed values: `nano`, `micro`, `small`, `medium`, `large`, `xlarge`, `2xlarge`. resourcesPreset: "micro" -## @param size Persistent Volume size +## @param size {quantity} Persistent Volume Claim size, available for application data size: 10Gi -## @param storageClass StorageClass used to store the data +## @param storageClass {string} StorageClass used to store the data storageClass: "" -## @param external Enable external access from outside the cluster +## @param external {bool} Enable external access from outside the cluster external: false - ## @section Application-specific parameters +## @param postgresql {postgresql} PostgreSQL server configuration +## @field postgresql.parameters {postgresqlParameters} PostgreSQL server parameters +## @field postgresqlParameters.max_connections {int} Determines the maximum number of concurrent connections to the database server. The default is typically 100 connections ## -## @param postgresql.parameters.max_connections Determines the maximum number of concurrent connections to the database server. The default is typically 100 connections postgresql: parameters: max_connections: 100 -## @param quorum.minSyncReplicas Minimum number of synchronous replicas that must acknowledge a transaction before it is considered committed. -## @param quorum.maxSyncReplicas Maximum number of synchronous replicas that can acknowledge a transaction (must be lower than the number of instances). +## Configuration for the quorum-based synchronous replication +## @param quorum {quorum} Quorum configuration for synchronous replication +## @field quorum.minSyncReplicas {int} Minimum number of synchronous replicas that must acknowledge a transaction before it is considered committed. +## @field quorum.maxSyncReplicas {int} Maximum number of synchronous replicas that can acknowledge a transaction (must be lower than the number of instances). quorum: minSyncReplicas: 0 maxSyncReplicas: 0 -## @param users [object] Users configuration +## @param users {map[string]user} Users configuration +## @field user.password {*string} Password for the user +## @field user.replication {*bool} Whether the user has replication privileges +## ## Example: ## users: ## user1: @@ -44,7 +52,12 @@ quorum: ## users: {} -## @param databases Databases configuration +## @param databases {map[string]database} Databases configuration +## @field database.roles {*databaseRoles} Roles for the database +## @field databaseRoles.admin {[]string} List of users with admin privileges +## @field databaseRoles.readonly {[]string} List of users with read-only privileges +## @field database.extensions {[]string} Extensions enabled for the database +## ## Example: ## databases: ## myapp: @@ -64,27 +77,29 @@ databases: {} ## @section Backup parameters -## @param backup.enabled Enable regular backups -## @param backup.schedule Cron schedule for automated backups -## @param backup.retentionPolicy Retention policy -## @param backup.destinationPath Path to store the backup (i.e. s3://bucket/path/to/folder) -## @param backup.endpointURL S3 Endpoint used to upload data to the cloud -## @param backup.s3AccessKey Access key for S3, used for authentication -## @param backup.s3SecretKey Secret key for S3, used for authentication +## @param backup {backup} Backup configuration +## @field backup.enabled {bool} Enable regular backups +## @field backup.schedule {string} Cron schedule for automated backups +## @field backup.retentionPolicy {string} Retention policy +## @field backup.destinationPath {string} Path to store the backup (i.e. s3://bucket/path/to/folder) +## @field backup.endpointURL {string} S3 Endpoint used to upload data to the cloud +## @field backup.s3AccessKey {string} Access key for S3, used for authentication +## @field backup.s3SecretKey {string} Secret key for S3, used for authentication backup: enabled: false retentionPolicy: 30d - destinationPath: s3://bucket/path/to/folder/ - endpointURL: http://minio-gateway-service:9000 + destinationPath: "s3://bucket/path/to/folder/" + endpointURL: "http://minio-gateway-service:9000" schedule: "0 2 * * * *" - s3AccessKey: oobaiRus9pah8PhohL1ThaeTa4UVa7gu - s3SecretKey: ju3eum4dekeich9ahM1te8waeGai0oog + s3AccessKey: "" + s3SecretKey: "" ## @section Bootstrap (recovery) parameters -## @param bootstrap.enabled Restore database cluster from a backup -## @param bootstrap.recoveryTime Timestamp (PITR) up to which recovery will proceed, expressed in RFC 3339 format. If left empty, will restore latest -## @param bootstrap.oldName Name of database cluster before deleting +## @param bootstrap {bootstrap} Bootstrap configuration +## @field bootstrap.enabled {bool} Restore database cluster from a backup +## @field bootstrap.recoveryTime {*string} Timestamp (PITR) up to which recovery will proceed, expressed in RFC 3339 format. If left empty, will restore latest +## @field bootstrap.oldName {string} Name of database cluster before deleting ## bootstrap: enabled: false diff --git a/packages/apps/virtual-machine/Makefile b/packages/apps/virtual-machine/Makefile index 5234bd85..6834018d 100644 --- a/packages/apps/virtual-machine/Makefile +++ b/packages/apps/virtual-machine/Makefile @@ -1,12 +1,9 @@ include ../../../scripts/package.mk generate: - readme-generator-for-helm -v values.yaml -s values.schema.json -r README.md + cozyvalues-gen -v values.yaml -s values.schema.json -r README.md yq -o json -i '.properties.gpus.items.type = "object" | .properties.gpus.default = []' values.schema.json # INSTANCE_TYPES=$$(yq e '.metadata.name' -o=json -r ../../system/kubevirt-instancetypes/templates/instancetypes.yaml | yq 'split(" ") | . + [""]' -o json) \ # && yq -i -o json ".properties.instanceType.enum = $${INSTANCE_TYPES}" values.schema.json PREFERENCES=$$(yq e '.metadata.name' -o=json -r ../../system/kubevirt-instancetypes/templates/preferences.yaml | yq 'split(" ") | . + [""]' -o json) \ && yq -i -o json ".properties.instanceProfile.enum = $${PREFERENCES}" values.schema.json - yq -i -o json '.properties.externalPorts.items.type = "integer"' values.schema.json - yq -i -o json '.properties.systemDisk.properties.image.enum = ["ubuntu", "cirros", "alpine", "fedora", "talos"]' values.schema.json - yq -i -o json '.properties.externalMethod.enum = ["PortList", "WholeIP"]' values.schema.json diff --git a/packages/apps/virtual-machine/README.md b/packages/apps/virtual-machine/README.md index a1a89bdc..6ed30826 100644 --- a/packages/apps/virtual-machine/README.md +++ b/packages/apps/virtual-machine/README.md @@ -36,24 +36,28 @@ virtctl ssh @ ### Common parameters -| Name | Description | Value | -| ------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------ | -| `external` | Enable external access from outside the cluster | `false` | -| `externalMethod` | specify method to passthrough the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `PortList` | -| `externalPorts` | Specify ports to forward from outside the cluster | `[]` | -| `running` | Determines if the virtual machine should be running | `true` | -| `instanceType` | Virtual Machine instance type | `u1.medium` | -| `instanceProfile` | Virtual Machine preferences profile | `ubuntu` | -| `systemDisk.image` | The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine`, `fedora` and `talos` | `ubuntu` | -| `systemDisk.storage` | The size of the disk allocated for the virtual machine | `5Gi` | -| `systemDisk.storageClass` | StorageClass used to store the data | `replicated` | -| `gpus` | List of GPUs to attach | `[]` | -| `resources.cpu` | The number of CPU cores allocated to the virtual machine | `""` | -| `resources.memory` | The amount of memory allocated to the virtual machine | `""` | -| `resources.sockets` | The number of CPU sockets allocated to the virtual machine (used to define vCPU topology) | `""` | -| `sshKeys` | List of SSH public keys for authentication. Can be a single key or a list of keys. | `[]` | -| `cloudInit` | cloud-init user data config. See cloud-init documentation for more details. | `""` | -| `cloudInitSeed` | A seed string to generate an SMBIOS UUID for the VM. | `""` | +| Name | Description | Type | Value | +| ------------------------- | ----------------------------------------------------------------------------------------------------------- | ---------- | ------------ | +| `external` | Enable external access from outside the cluster | `bool` | `false` | +| `externalMethod` | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string` | `{}` | +| `externalPorts` | Specify ports to forward from outside the cluster | `[]int` | `[22]` | +| `running` | if the virtual machine should be running | `bool` | `true` | +| `instanceType` | Virtual Machine instance type | `string` | `u1.medium` | +| `instanceProfile` | Virtual Machine preferences profile | `string` | `ubuntu` | +| `systemDisk` | System disk configuration | `object` | `{}` | +| `systemDisk.image` | The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine`, `fedora` and `talos` | `string` | `ubuntu` | +| `systemDisk.storage` | The size of the disk allocated for the virtual machine | `string` | `5Gi` | +| `systemDisk.storageClass` | StorageClass used to store the data | `*string` | `replicated` | +| `gpus` | List of GPUs to attach | `[]object` | `[]` | +| `gpus[i].name` | The name of the GPU to attach. This should match the GPU resource name in the cluster. | `string` | `""` | +| `resources` | Resources | `object` | `{}` | +| `resources.cpu` | The number of CPU cores allocated to the virtual machine | `*string` | `null` | +| `resources.sockets` | The number of CPU sockets allocated to the virtual machine (used to define vCPU topology) | `*string` | `null` | +| `resources.memory` | The amount of memory allocated to the virtual machine | `*string` | `null` | +| `sshKeys` | List of SSH public keys for authentication. Can be a single key or a list of keys. | `[]string` | `[]` | +| `cloudInit` | cloud-init user data config. See cloud-init documentation for more details. | `string` | `""` | +| `cloudInitSeed` | A seed string to generate an SMBIOS UUID for the VM. | `string` | `""` | + ## U Series diff --git a/packages/apps/virtual-machine/values.schema.json b/packages/apps/virtual-machine/values.schema.json index 2d328886..999d60d6 100644 --- a/packages/apps/virtual-machine/values.schema.json +++ b/packages/apps/virtual-machine/values.schema.json @@ -1,49 +1,60 @@ { + "title": "Chart Values", + "type": "object", "properties": { "cloudInit": { - "default": "", "description": "cloud-init user data config. See cloud-init documentation for more details.", "type": "string" }, "cloudInitSeed": { - "default": "", "description": "A seed string to generate an SMBIOS UUID for the VM.", "type": "string" }, "external": { - "default": false, "description": "Enable external access from outside the cluster", - "type": "boolean" + "type": "boolean", + "default": false }, "externalMethod": { - "default": "PortList", - "description": "specify method to passthrough the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList`", + "description": "Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList`", "type": "string", + "default": "PortList", "enum": [ "PortList", "WholeIP" ] }, "externalPorts": { - "default": [], "description": "Specify ports to forward from outside the cluster", + "type": "array", + "default": [ + 22 + ], "items": { "type": "integer" - }, - "type": "array" + } }, "gpus": { - "default": [], "description": "List of GPUs to attach", + "type": "array", + "default": [], "items": { - "type": "object" - }, - "type": "array" + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "description": "The name of the GPU to attach. This should match the GPU resource name in the cluster.", + "type": "string" + } + } + } }, "instanceProfile": { - "default": "ubuntu", "description": "Virtual Machine preferences profile", "type": "string", + "default": "ubuntu", "enum": [ "alpine", "centos.7", @@ -91,47 +102,65 @@ ] }, "instanceType": { - "default": "u1.medium", "description": "Virtual Machine instance type", - "type": "string" + "type": "string", + "default": "u1.medium" }, "resources": { + "description": "Resources", + "type": "object", + "default": {}, "properties": { "cpu": { - "default": "", "description": "The number of CPU cores allocated to the virtual machine", - "type": "string" + "type": "string", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true }, "memory": { - "default": "", "description": "The amount of memory allocated to the virtual machine", - "type": "string" + "type": "string", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true }, "sockets": { - "default": "", "description": "The number of CPU sockets allocated to the virtual machine (used to define vCPU topology)", - "type": "string" + "type": "string", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true } - }, - "type": "object" + } }, "running": { - "default": true, - "description": "Determines if the virtual machine should be running", - "type": "boolean" + "description": "if the virtual machine should be running", + "type": "boolean", + "default": true }, "sshKeys": { - "default": [], "description": "List of SSH public keys for authentication. Can be a single key or a list of keys.", - "items": {}, - "type": "array" + "type": "array", + "default": [], + "items": { + "type": "string" + } }, "systemDisk": { + "description": "System disk configuration", + "type": "object", + "default": { + "image": "ubuntu", + "storage": "5Gi", + "storageClass": "replicated" + }, + "required": [ + "image", + "storage" + ], "properties": { "image": { - "default": "ubuntu", "description": "The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine`, `fedora` and `talos`", "type": "string", + "default": "ubuntu", "enum": [ "ubuntu", "cirros", @@ -141,19 +170,16 @@ ] }, "storage": { - "default": "5Gi", "description": "The size of the disk allocated for the virtual machine", - "type": "string" + "type": "string", + "default": "5Gi" }, "storageClass": { - "default": "replicated", "description": "StorageClass used to store the data", - "type": "string" + "type": "string", + "default": "replicated" } - }, - "type": "object" + } } - }, - "title": "Chart Values", - "type": "object" + } } diff --git a/packages/apps/virtual-machine/values.yaml b/packages/apps/virtual-machine/values.yaml index 116e8ab3..f993a913 100644 --- a/packages/apps/virtual-machine/values.yaml +++ b/packages/apps/virtual-machine/values.yaml @@ -1,46 +1,53 @@ + ## @section Common parameters - -## @param external Enable external access from outside the cluster -## @param externalMethod specify method to passthrough the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` -## @param externalPorts [array] Specify ports to forward from outside the cluster +## +## @param external {bool} Enable external access from outside the cluster external: false -externalMethod: PortList +## @param externalMethod {string enum:"PortList,WholeIP"} Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` +externalMethod: "PortList" +## @param externalPorts {[]int} Specify ports to forward from outside the cluster externalPorts: -- 22 + - 22 -## @param running Determines if the virtual machine should be running +## @param running {bool} if the virtual machine should be running running: true -## @param instanceType Virtual Machine instance type -## @param instanceProfile Virtual Machine preferences profile +## @param instanceType {string} Virtual Machine instance type +## @param instanceProfile {string} Virtual Machine preferences profile ## instanceType: "u1.medium" instanceProfile: ubuntu -## @param systemDisk.image The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine`, `fedora` and `talos` -## @param systemDisk.storage The size of the disk allocated for the virtual machine -## @param systemDisk.storageClass StorageClass used to store the data -## +## @param systemDisk {systemDisk} System disk configuration +## @field systemDisk.image {string enum:"ubuntu,cirros,alpine,fedora,talos"} The base image for the virtual machine. Allowed values: `ubuntu`, `cirros`, `alpine`, `fedora` and `talos` +## @field systemDisk.storage {string} The size of the disk allocated for the virtual machine +## @field systemDisk.storageClass {*string} StorageClass used to store the data +## systemDisk: image: ubuntu storage: 5Gi storageClass: replicated -## @param gpus [array] List of GPUs to attach +## @param gpus {[]gpu} List of GPUs to attach +## @field gpu.name {string} The name of the GPU to attach. This should match the GPU resource name in the cluster. ## Example: ## gpus: ## - name: nvidia.com/GA102GL_A10 gpus: [] -## @param resources.cpu The number of CPU cores allocated to the virtual machine -## @param resources.memory The amount of memory allocated to the virtual machine -## @param resources.sockets The number of CPU sockets allocated to the virtual machine (used to define vCPU topology) -resources: - cpu: "" - memory: "" - sockets: "" -## @param sshKeys [array] List of SSH public keys for authentication. Can be a single key or a list of keys. +## @param resources {resources} Resources +## @field resources.cpu {*quantity} The number of CPU cores allocated to the virtual machine +## @field resources.sockets {*quantity} The number of CPU sockets allocated to the virtual machine (used to define vCPU topology) +## @field resources.memory {*quantity} The amount of memory allocated to the virtual machine +## Example: +## resources: +## cpu: "4" +## sockets: "1" +## memory: "8Gi" +resources: {} + +## @param sshKeys {[]string} List of SSH public keys for authentication. Can be a single key or a list of keys. ## Example: ## sshKeys: ## - ssh-rsa ... @@ -48,7 +55,7 @@ resources: ## sshKeys: [] -## @param cloudInit cloud-init user data config. See cloud-init documentation for more details. +## @param cloudInit {string} cloud-init user data config. See cloud-init documentation for more details. ## - https://cloudinit.readthedocs.io/en/latest/explanation/format.html ## - https://cloudinit.readthedocs.io/en/latest/reference/examples.html ## Example: @@ -59,11 +66,11 @@ sshKeys: [] ## cloudInit: "" -## @param cloudInitSeed A seed string to generate an SMBIOS UUID for the VM. -cloudInitSeed: "" +## @param cloudInitSeed {string} A seed string to generate an SMBIOS UUID for the VM. ## Change it to any new value to force a full cloud-init reconfiguration. Change it when you want to apply ## to an existing VM settings that are usually written only once, like new SSH keys or new network configuration. ## An empty value does nothing (and the existing UUID is not reverted). Please note that changing this value ## does not trigger a VM restart. You must perform the restart separately. ## Example: ## cloudInitSeed: "upd1" +cloudInitSeed: "" diff --git a/packages/extra/monitoring/Makefile b/packages/extra/monitoring/Makefile index 8b7e72da..53608e14 100644 --- a/packages/extra/monitoring/Makefile +++ b/packages/extra/monitoring/Makefile @@ -6,11 +6,7 @@ include ../../../scripts/common-envs.mk include ../../../scripts/package.mk generate: - readme-generator-for-helm -v values.yaml -s values.schema.json.tmp -r README.md - cat values.schema.json.tmp | \ - jq '.properties.metricsStorages.items.type = "object" | .properties.logsStorages.items.type = "object"' \ - > values.schema.json - rm -f values.schema.json.tmp + cozyvalues-gen -v values.yaml -s values.schema.json -r README.md image: docker buildx build images/grafana \ diff --git a/packages/extra/monitoring/README.md b/packages/extra/monitoring/README.md index 5fa84dce..7bf4b646 100644 --- a/packages/extra/monitoring/README.md +++ b/packages/extra/monitoring/README.md @@ -4,22 +4,88 @@ ### Common parameters -| Name | Description | Value | -| ----------------------------------------- | --------------------------------------------------------------------------------------------------------- | ------- | -| `host` | The hostname used to access the grafana externally (defaults to 'grafana' subdomain for the tenant host). | `""` | -| `metricsStorages` | Configuration of metrics storage instances | `[]` | -| `logsStorages` | Configuration of logs storage instances | `[]` | -| `alerta.storage` | Persistent Volume size for alerta database | `10Gi` | -| `alerta.storageClassName` | StorageClass used to store the data | `""` | -| `alerta.resources.requests.cpu` | The minimum amount of CPU required for alerta | `100m` | -| `alerta.resources.requests.memory` | The minimum amount of memory required for alerta | `256Mi` | -| `alerta.resources.limits.cpu` | The maximum amount of CPU allowed for alerta | `1` | -| `alerta.resources.limits.memory` | The maximum amount of memory allowed for alerta | `1Gi` | -| `alerta.alerts.telegram.token` | telegram token for your bot | `""` | -| `alerta.alerts.telegram.chatID` | specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `""` | -| `alerta.alerts.telegram.disabledSeverity` | list of severity without alerts, separated comma like: "informational,warning" | `""` | -| `grafana.db.size` | Persistent Volume size for grafana database | `10Gi` | -| `grafana.resources.requests.cpu` | The minimum amount of CPU required for grafana | `100m` | -| `grafana.resources.requests.memory` | The minimum amount of memory required for grafana | `256Mi` | -| `grafana.resources.limits.cpu` | The maximum amount of CPU allowed for grafana | `1` | -| `grafana.resources.limits.memory` | The maximum amount of memory allowed for grafana | `1Gi` | +| Name | Description | Type | Value | +| ------ | --------------------------------------------------------------------------------------------------------- | -------- | ----- | +| `host` | The hostname used to access the grafana externally (defaults to 'grafana' subdomain for the tenant host). | `string` | `""` | + + +### Metrics storage configuration + +| Name | Description | Type | Value | +| ------------------------------------------------ | -------------------------------------------------------------- | ---------- | ------- | +| `metricsStorages` | Configuration of metrics storage instances | `[]object` | `[...]` | +| `metricsStorages[i].name` | Name of the storage instance | `string` | `""` | +| `metricsStorages[i].retentionPeriod` | Retention period for the metrics in the storage instance | `string` | `""` | +| `metricsStorages[i].deduplicationInterval` | Deduplication interval for the metrics in the storage instance | `string` | `""` | +| `metricsStorages[i].storage` | Persistent Volume size for the storage instance | `string` | `""` | +| `metricsStorages[i].storageClassName` | StorageClass used to store the data | `*string` | `null` | +| `metricsStorages[i].vminsert` | Configuration for vminsert component of the storage instance | `*object` | `null` | +| `metricsStorages[i].vminsert.minAllowed` | Requests (minimum allowed/available resources) | `*object` | `null` | +| `metricsStorages[i].vminsert.minAllowed.cpu` | CPU request (minimum available CPU) | `*string` | `null` | +| `metricsStorages[i].vminsert.minAllowed.memory` | Memory request (minimum available memory) | `*string` | `null` | +| `metricsStorages[i].vminsert.maxAllowed` | Limits (maximum allowed/available resources ) | `*object` | `null` | +| `metricsStorages[i].vminsert.maxAllowed.cpu` | CPU limit (maximum available CPU) | `*string` | `null` | +| `metricsStorages[i].vminsert.maxAllowed.memory` | Memory limit (maximum available memory) | `*string` | `null` | +| `metricsStorages[i].vmselect` | Configuration for vmselect component of the storage instance | `*object` | `null` | +| `metricsStorages[i].vmselect.minAllowed` | Requests (minimum allowed/available resources) | `*object` | `null` | +| `metricsStorages[i].vmselect.minAllowed.cpu` | CPU request (minimum available CPU) | `*string` | `null` | +| `metricsStorages[i].vmselect.minAllowed.memory` | Memory request (minimum available memory) | `*string` | `null` | +| `metricsStorages[i].vmselect.maxAllowed` | Limits (maximum allowed/available resources ) | `*object` | `null` | +| `metricsStorages[i].vmselect.maxAllowed.cpu` | CPU limit (maximum available CPU) | `*string` | `null` | +| `metricsStorages[i].vmselect.maxAllowed.memory` | Memory limit (maximum available memory) | `*string` | `null` | +| `metricsStorages[i].vmstorage` | Configuration for vmstorage component of the storage instance | `*object` | `null` | +| `metricsStorages[i].vmstorage.minAllowed` | Requests (minimum allowed/available resources) | `*object` | `null` | +| `metricsStorages[i].vmstorage.minAllowed.cpu` | CPU request (minimum available CPU) | `*string` | `null` | +| `metricsStorages[i].vmstorage.minAllowed.memory` | Memory request (minimum available memory) | `*string` | `null` | +| `metricsStorages[i].vmstorage.maxAllowed` | Limits (maximum allowed/available resources ) | `*object` | `null` | +| `metricsStorages[i].vmstorage.maxAllowed.cpu` | CPU limit (maximum available CPU) | `*string` | `null` | +| `metricsStorages[i].vmstorage.maxAllowed.memory` | Memory limit (maximum available memory) | `*string` | `null` | + + +### Logs storage configuration + +| Name | Description | Type | Value | +| ---------------------------------- | ----------------------------------------------------- | ---------- | ------- | +| `logsStorages` | Configuration of logs storage instances | `[]object` | `[...]` | +| `logsStorages[i].name` | Name of the storage instance | `string` | `""` | +| `logsStorages[i].retentionPeriod` | Retention period for the logs in the storage instance | `string` | `""` | +| `logsStorages[i].storage` | Persistent Volume size for the storage instance | `string` | `""` | +| `logsStorages[i].storageClassName` | StorageClass used to store the data | `*string` | `null` | + + +### Alerta configuration + +| Name | Description | Type | Value | +| ----------------------------------------- | ----------------------------------------------------------------------------------- | --------- | ------- | +| `alerta` | Configuration for Alerta service | `object` | `{}` | +| `alerta.storage` | Persistent Volume size for the database | `string` | `10Gi` | +| `alerta.storageClassName` | StorageClass used to store the data | `string` | `""` | +| `alerta.resources` | Resources configuration | `*object` | `null` | +| `alerta.resources.requests` | | `*object` | `null` | +| `alerta.resources.requests.cpu` | CPU request (minimum available CPU) | `*string` | `100m` | +| `alerta.resources.requests.memory` | Memory request (minimum available memory) | `*string` | `256Mi` | +| `alerta.resources.limits` | | `*object` | `null` | +| `alerta.resources.limits.cpu` | CPU limit (maximum available CPU) | `*string` | `1` | +| `alerta.resources.limits.memory` | Memory limit (maximum available memory) | `*string` | `1Gi` | +| `alerta.alerts` | Configuration for alerts | `object` | `{}` | +| `alerta.alerts.telegram` | Configuration for Telegram alerts | `object` | `{}` | +| `alerta.alerts.telegram.token` | Telegram token for your bot | `string` | `""` | +| `alerta.alerts.telegram.chatID` | Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `string` | `""` | +| `alerta.alerts.telegram.disabledSeverity` | List of severity without alerts, separated by comma like: "informational,warning" | `string` | `""` | + + +### Grafana configuration + +| Name | Description | Type | Value | +| ----------------------------------- | ----------------------------------------- | --------- | ------- | +| `grafana` | Configuration for Grafana | `object` | `{}` | +| `grafana.db` | Database configuration | `object` | `{}` | +| `grafana.db.size` | Persistent Volume size for the database | `string` | `10Gi` | +| `grafana.resources` | Resources configuration | `*object` | `null` | +| `grafana.resources.requests` | | `*object` | `null` | +| `grafana.resources.requests.cpu` | CPU request (minimum available CPU) | `*string` | `100m` | +| `grafana.resources.requests.memory` | Memory request (minimum available memory) | `*string` | `256Mi` | +| `grafana.resources.limits` | | `*object` | `null` | +| `grafana.resources.limits.cpu` | CPU limit (maximum available CPU) | `*string` | `1` | +| `grafana.resources.limits.memory` | Memory limit (maximum available memory) | `*string` | `1Gi` | + diff --git a/packages/extra/monitoring/values.schema.json b/packages/extra/monitoring/values.schema.json index 75f76eb5..ae807aa8 100644 --- a/packages/extra/monitoring/values.schema.json +++ b/packages/extra/monitoring/values.schema.json @@ -1,152 +1,487 @@ { + "title": "Chart Values", + "type": "object", "properties": { "alerta": { + "description": "Configuration for Alerta service", + "type": "object", + "default": { + "alerts": { + "telegram": { + "chatID": "", + "disabledSeverity": "", + "token": "" + } + }, + "resources": { + "limits": { + "cpu": "1", + "memory": "1Gi" + }, + "requests": { + "cpu": "100m", + "memory": "256Mi" + } + }, + "storage": "10Gi", + "storageClassName": "" + }, + "required": [ + "alerts", + "storage", + "storageClassName" + ], "properties": { "alerts": { + "description": "Configuration for alerts", + "type": "object", + "default": { + "telegram": { + "chatID": "", + "disabledSeverity": "", + "token": "" + } + }, + "required": [ + "telegram" + ], "properties": { "telegram": { + "description": "Configuration for Telegram alerts", + "type": "object", + "default": { + "chatID": "", + "disabledSeverity": "", + "token": "" + }, + "required": [ + "chatID", + "disabledSeverity", + "token" + ], "properties": { "chatID": { - "default": "", - "description": "specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot", + "description": "Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot", "type": "string" }, "disabledSeverity": { - "default": "", - "description": "list of severity without alerts, separated comma like: \"informational,warning\"", + "description": "List of severity without alerts, separated by comma like: \"informational,warning\"", "type": "string" }, "token": { - "default": "", - "description": "telegram token for your bot", + "description": "Telegram token for your bot", "type": "string" } - }, - "type": "object" + } } - }, - "type": "object" + } }, "resources": { - "properties": { + "description": "Resources configuration", + "type": "object", + "default": { "limits": { - "properties": { - "cpu": { - "default": "1", - "description": "The maximum amount of CPU allowed for alerta", - "type": "string" - }, - "memory": { - "default": "1Gi", - "description": "The maximum amount of memory allowed for alerta", - "type": "string" - } - }, - "type": "object" + "cpu": "1", + "memory": "1Gi" }, "requests": { - "properties": { - "cpu": { - "default": "100m", - "description": "The minimum amount of CPU required for alerta", - "type": "string" - }, - "memory": { - "default": "256Mi", - "description": "The minimum amount of memory required for alerta", - "type": "string" - } - }, - "type": "object" + "cpu": "100m", + "memory": "256Mi" } }, - "type": "object" + "properties": { + "limits": { + "type": "object", + "default": { + "cpu": "1", + "memory": "1Gi" + }, + "properties": { + "cpu": { + "description": "CPU limit (maximum available CPU)", + "type": "string", + "default": "1", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory limit (maximum available memory)", + "type": "string", + "default": "1Gi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + }, + "requests": { + "type": "object", + "default": { + "cpu": "100m", + "memory": "256Mi" + }, + "properties": { + "cpu": { + "description": "CPU request (minimum available CPU)", + "type": "string", + "default": "100m", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory request (minimum available memory)", + "type": "string", + "default": "256Mi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + } + } }, "storage": { - "default": "10Gi", - "description": "Persistent Volume size for alerta database", - "type": "string" + "description": "Persistent Volume size for the database", + "type": "string", + "default": "10Gi" }, "storageClassName": { - "default": "", "description": "StorageClass used to store the data", "type": "string" } - }, - "type": "object" + } }, "grafana": { - "properties": { + "description": "Configuration for Grafana", + "type": "object", + "default": { "db": { - "properties": { - "size": { - "default": "10Gi", - "description": "Persistent Volume size for grafana database", - "type": "string" - } - }, - "type": "object" + "size": "10Gi" }, "resources": { - "properties": { - "limits": { - "properties": { - "cpu": { - "default": "1", - "description": "The maximum amount of CPU allowed for grafana", - "type": "string" - }, - "memory": { - "default": "1Gi", - "description": "The maximum amount of memory allowed for grafana", - "type": "string" - } - }, - "type": "object" - }, - "requests": { - "properties": { - "cpu": { - "default": "100m", - "description": "The minimum amount of CPU required for grafana", - "type": "string" - }, - "memory": { - "default": "256Mi", - "description": "The minimum amount of memory required for grafana", - "type": "string" - } - }, - "type": "object" - } + "limits": { + "cpu": "1", + "memory": "1Gi" }, - "type": "object" + "requests": { + "cpu": "100m", + "memory": "256Mi" + } } }, - "type": "object" + "required": [ + "db" + ], + "properties": { + "db": { + "description": "Database configuration", + "type": "object", + "default": { + "size": "10Gi" + }, + "required": [ + "size" + ], + "properties": { + "size": { + "description": "Persistent Volume size for the database", + "type": "string", + "default": "10Gi" + } + } + }, + "resources": { + "description": "Resources configuration", + "type": "object", + "default": { + "limits": { + "cpu": "1", + "memory": "1Gi" + }, + "requests": { + "cpu": "100m", + "memory": "256Mi" + } + }, + "properties": { + "limits": { + "type": "object", + "default": { + "cpu": "1", + "memory": "1Gi" + }, + "properties": { + "cpu": { + "description": "CPU limit (maximum available CPU)", + "type": "string", + "default": "1", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory limit (maximum available memory)", + "type": "string", + "default": "1Gi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + }, + "requests": { + "type": "object", + "default": { + "cpu": "100m", + "memory": "256Mi" + }, + "properties": { + "cpu": { + "description": "CPU request (minimum available CPU)", + "type": "string", + "default": "100m", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory request (minimum available memory)", + "type": "string", + "default": "256Mi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + } + } + } + } }, "host": { - "default": "", "description": "The hostname used to access the grafana externally (defaults to 'grafana' subdomain for the tenant host).", "type": "string" }, "logsStorages": { - "default": [], "description": "Configuration of logs storage instances", + "type": "array", + "default": [ + { + "name": "generic", + "retentionPeriod": "1", + "storage": "10Gi", + "storageClassName": "replicated" + } + ], "items": { - "type": "object" - }, - "type": "array" + "type": "object", + "required": [ + "name", + "retentionPeriod", + "storage" + ], + "properties": { + "name": { + "description": "Name of the storage instance", + "type": "string" + }, + "retentionPeriod": { + "description": "Retention period for the logs in the storage instance", + "type": "string" + }, + "storage": { + "description": "Persistent Volume size for the storage instance", + "type": "string" + }, + "storageClassName": { + "description": "StorageClass used to store the data", + "type": "string" + } + } + } }, "metricsStorages": { - "default": [], "description": "Configuration of metrics storage instances", + "type": "array", + "default": [ + { + "deduplicationInterval": "15s", + "name": "shortterm", + "retentionPeriod": "3d", + "storage": "10Gi", + "storageClassName": "" + }, + { + "deduplicationInterval": "5m", + "name": "longterm", + "retentionPeriod": "14d", + "storage": "10Gi", + "storageClassName": "" + } + ], "items": { - "type": "object" - }, - "type": "array" + "type": "object", + "required": [ + "deduplicationInterval", + "name", + "retentionPeriod", + "storage" + ], + "properties": { + "deduplicationInterval": { + "description": "Deduplication interval for the metrics in the storage instance", + "type": "string" + }, + "name": { + "description": "Name of the storage instance", + "type": "string" + }, + "retentionPeriod": { + "description": "Retention period for the metrics in the storage instance", + "type": "string" + }, + "storage": { + "description": "Persistent Volume size for the storage instance", + "type": "string" + }, + "storageClassName": { + "description": "StorageClass used to store the data", + "type": "string" + }, + "vminsert": { + "description": "Configuration for vminsert component of the storage instance", + "type": "object", + "properties": { + "maxAllowed": { + "description": "Limits (maximum allowed/available resources )", + "type": "object", + "properties": { + "cpu": { + "description": "CPU limit (maximum available CPU)", + "type": "string", + "default": "1", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory limit (maximum available memory)", + "type": "string", + "default": "1Gi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + }, + "minAllowed": { + "description": "Requests (minimum allowed/available resources)", + "type": "object", + "properties": { + "cpu": { + "description": "CPU request (minimum available CPU)", + "type": "string", + "default": "100m", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory request (minimum available memory)", + "type": "string", + "default": "256Mi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + } + } + }, + "vmselect": { + "description": "Configuration for vmselect component of the storage instance", + "type": "object", + "properties": { + "maxAllowed": { + "description": "Limits (maximum allowed/available resources )", + "type": "object", + "properties": { + "cpu": { + "description": "CPU limit (maximum available CPU)", + "type": "string", + "default": "1", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory limit (maximum available memory)", + "type": "string", + "default": "1Gi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + }, + "minAllowed": { + "description": "Requests (minimum allowed/available resources)", + "type": "object", + "properties": { + "cpu": { + "description": "CPU request (minimum available CPU)", + "type": "string", + "default": "100m", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory request (minimum available memory)", + "type": "string", + "default": "256Mi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + } + } + }, + "vmstorage": { + "description": "Configuration for vmstorage component of the storage instance", + "type": "object", + "properties": { + "maxAllowed": { + "description": "Limits (maximum allowed/available resources )", + "type": "object", + "properties": { + "cpu": { + "description": "CPU limit (maximum available CPU)", + "type": "string", + "default": "1", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory limit (maximum available memory)", + "type": "string", + "default": "1Gi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + }, + "minAllowed": { + "description": "Requests (minimum allowed/available resources)", + "type": "object", + "properties": { + "cpu": { + "description": "CPU request (minimum available CPU)", + "type": "string", + "default": "100m", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + }, + "memory": { + "description": "Memory request (minimum available memory)", + "type": "string", + "default": "256Mi", + "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$", + "x-kubernetes-int-or-string": true + } + } + } + } + } + } + } } - }, - "title": "Chart Values", - "type": "object" -} + } +} \ No newline at end of file diff --git a/packages/extra/monitoring/values.yaml b/packages/extra/monitoring/values.yaml index 9e992f22..f507ba05 100644 --- a/packages/extra/monitoring/values.yaml +++ b/packages/extra/monitoring/values.yaml @@ -1,10 +1,29 @@ ## @section Common parameters -## @param host The hostname used to access the grafana externally (defaults to 'grafana' subdomain for the tenant host). +## @param host {string} The hostname used to access the grafana externally (defaults to 'grafana' subdomain for the tenant host). host: "" -## @param metricsStorages [array] Configuration of metrics storage instances -## +## @section Metrics storage configuration + +## @param metricsStorages {[]metricsStorage} Configuration of metrics storage instances +## @field metricsStorage.name {string} Name of the storage instance +## @field metricsStorage.retentionPeriod {string} Retention period for the metrics in the storage instance +## @field metricsStorage.deduplicationInterval {string} Deduplication interval for the metrics in the storage instance +## @field metricsStorage.storage {string} Persistent Volume size for the storage instance +## @field metricsStorage.storageClassName {*string} StorageClass used to store the data +## @field metricsStorage.vminsert {*vmcomponent} Configuration for vminsert component of the storage instance +## @field metricsStorage.vmselect {*vmcomponent} Configuration for vmselect component of the storage instance +## @field metricsStorage.vmstorage {*vmcomponent} Configuration for vmstorage component of the storage instance + +## @field request.cpu {*quantity} CPU request (minimum available CPU) +## @field request.memory {*quantity} Memory request (minimum available memory) +## @field limit.cpu {*quantity} CPU limit (maximum available CPU) +## @field limit.memory {*quantity} Memory limit (maximum available memory) +## @field vmcomponent.minAllowed {*request} Requests (minimum allowed/available resources) +## @field vmcomponent.maxAllowed {*limit} Limits (maximum allowed/available resources ) +## @field resources.requests {*request} +## @field resources.limits {*limit} + ## Example: ## metricsStorages: ## - name: shortterm @@ -46,7 +65,13 @@ metricsStorages: storage: 10Gi storageClassName: "" -## @param logsStorages [array] Configuration of logs storage instances +## @section Logs storage configuration + +## @param logsStorages {[]logsStorage} Configuration of logs storage instances +## @field logsStorage.name {string} Name of the storage instance +## @field logsStorage.retentionPeriod {string} Retention period for the logs in the storage instance +## @field logsStorage.storage {string} Persistent Volume size for the storage instance +## @field logsStorage.storageClassName {*string} StorageClass used to store the data ## logsStorages: - name: generic @@ -54,14 +79,17 @@ logsStorages: storage: 10Gi storageClassName: replicated -## Configuration for Alerta -## @param alerta.storage Persistent Volume size for alerta database -## @param alerta.storageClassName StorageClass used to store the data -## @param alerta.resources.requests.cpu The minimum amount of CPU required for alerta -## @param alerta.resources.requests.memory The minimum amount of memory required for alerta -## @param alerta.resources.limits.cpu The maximum amount of CPU allowed for alerta -## @param alerta.resources.limits.memory The maximum amount of memory allowed for alerta -## +## @section Alerta configuration + +## @param alerta {alerta} Configuration for Alerta service +## @field alerta.storage {string} Persistent Volume size for the database +## @field alerta.storageClassName {string} StorageClass used to store the data +## @field alerta.resources {*resources} Resources configuration +## @field alerta.alerts {alerts} Configuration for alerts +## @field alerts.telegram {telegramAlerts} Configuration for Telegram alerts +## @field telegramAlerts.token {string} Telegram token for your bot +## @field telegramAlerts.chatID {string} Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot +## @field telegramAlerts.disabledSeverity {string} List of severity without alerts, separated by comma like: "informational,warning" alerta: storage: 10Gi storageClassName: "" @@ -73,9 +101,6 @@ alerta: cpu: 100m memory: 256Mi alerts: - ## @param alerta.alerts.telegram.token telegram token for your bot - ## @param alerta.alerts.telegram.chatID specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot - ## @param alerta.alerts.telegram.disabledSeverity list of severity without alerts, separated comma like: "informational,warning" ## example: ## telegram: ## token: "7262461387:AAGtwq16iwuVtWtzoN6TUEMpF00fpC9Xz34" @@ -87,12 +112,14 @@ alerta: chatID: "" disabledSeverity: "" -## Configuration for Grafana -## @param grafana.db.size Persistent Volume size for grafana database -## @param grafana.resources.requests.cpu The minimum amount of CPU required for grafana -## @param grafana.resources.requests.memory The minimum amount of memory required for grafana -## @param grafana.resources.limits.cpu The maximum amount of CPU allowed for grafana -## @param grafana.resources.limits.memory The maximum amount of memory allowed for grafana +## @section Grafana configuration + +## @param grafana {grafana} Configuration for Grafana +## @field grafana.db {grafanaDB} Database configuration +## @field grafanaDB.size {string} Persistent Volume size for the database +## @field grafana.resources {*resources} Resources configuration + + grafana: db: size: 10Gi