From b26dc63b0146eaefd4cc8fb42f08fb530b3112cf Mon Sep 17 00:00:00 2001 From: Nick Volynkin Date: Mon, 4 Aug 2025 21:37:04 +0300 Subject: [PATCH] [apps] Use new OpenAPI schema and README generator for tenants Signed-off-by: Nick Volynkin --- packages/apps/tenant/Makefile | 2 +- packages/apps/tenant/README.md | 19 +++--- packages/apps/tenant/values.schema.json | 80 +++++++++++++------------ packages/apps/tenant/values.yaml | 14 ++--- 4 files changed, 60 insertions(+), 55 deletions(-) diff --git a/packages/apps/tenant/Makefile b/packages/apps/tenant/Makefile index 6bb0835c..7017c673 100644 --- a/packages/apps/tenant/Makefile +++ b/packages/apps/tenant/Makefile @@ -1,4 +1,4 @@ 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 diff --git a/packages/apps/tenant/README.md b/packages/apps/tenant/README.md index cc26c830..5526c146 100644 --- a/packages/apps/tenant/README.md +++ b/packages/apps/tenant/README.md @@ -69,12 +69,13 @@ tenant-u1 ### Common parameters -| Name | Description | Value | -| ---------------- | --------------------------------------------------------------------------------------------------------------------------- | ------- | -| `host` | The hostname used to access tenant services (defaults to using the tenant name as a subdomain for it's parent tenant host). | `""` | -| `etcd` | Deploy own Etcd cluster | `false` | -| `monitoring` | Deploy own Monitoring Stack | `false` | -| `ingress` | Deploy own Ingress Controller | `false` | -| `seaweedfs` | Deploy own SeaweedFS | `false` | -| `isolated` | Enforce tenant namespace with network policies | `true` | -| `resourceQuotas` | Define resource quotas for the tenant | `{}` | +| Name | Description | Type | Value | +| ---------------- | --------------------------------------------------------------------------------------------------------------------------- | --------- | ------- | +| `host` | The hostname used to access tenant services (defaults to using the tenant name as a subdomain for it's parent tenant host). | `*string` | `""` | +| `etcd` | Deploy own Etcd cluster | `bool` | `false` | +| `monitoring` | Deploy own Monitoring Stack | `bool` | `false` | +| `ingress` | Deploy own Ingress Controller | `bool` | `false` | +| `seaweedfs` | Deploy own SeaweedFS | `bool` | `false` | +| `isolated` | Enforce tenant namespace with network policies, `true` by default | `bool` | `true` | +| `resourceQuotas` | Define resource quotas for the tenant | `string` | `{}` | + diff --git a/packages/apps/tenant/values.schema.json b/packages/apps/tenant/values.schema.json index a0f4f919..6e89ae6d 100644 --- a/packages/apps/tenant/values.schema.json +++ b/packages/apps/tenant/values.schema.json @@ -1,41 +1,45 @@ { - "properties": { - "etcd": { - "default": false, - "description": "Deploy own Etcd cluster", - "type": "boolean" - }, - "host": { - "default": "", - "description": "The hostname used to access tenant services (defaults to using the tenant name as a subdomain for it's parent tenant host).", - "type": "string" - }, - "ingress": { - "default": false, - "description": "Deploy own Ingress Controller", - "type": "boolean" - }, - "isolated": { - "default": true, - "description": "Enforce tenant namespace with network policies", - "type": "boolean" - }, - "monitoring": { - "default": false, - "description": "Deploy own Monitoring Stack", - "type": "boolean" - }, - "resourceQuotas": { - "default": {}, - "description": "Define resource quotas for the tenant", - "type": "object" - }, - "seaweedfs": { - "default": false, - "description": "Deploy own SeaweedFS", - "type": "boolean" - } + "title": "Chart Values", + "type": "object", + "properties": { + "etcd": { + "description": "Deploy own Etcd cluster", + "type": "boolean", + "default": false }, - "title": "Chart Values", - "type": "object" + "host": { + "description": "The hostname used to access tenant services (defaults to using the tenant name as a subdomain for it's parent tenant host).", + "type": "string" + }, + "ingress": { + "description": "Deploy own Ingress Controller", + "type": "boolean", + "default": false + }, + "isolated": { + "description": "Enforce tenant namespace with network policies, `true` by default", + "type": "boolean", + "default": true + }, + "monitoring": { + "description": "Deploy own Monitoring Stack", + "type": "boolean", + "default": false + }, + "resourceQuotas": { + "description": "Define resource quotas for the tenant", + "type": "object", + "default": {}, + "additionalProperties": { + "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 + } + }, + "seaweedfs": { + "description": "Deploy own SeaweedFS", + "type": "boolean", + "default": false + } + } } \ No newline at end of file diff --git a/packages/apps/tenant/values.yaml b/packages/apps/tenant/values.yaml index 7c64b278..ae41bf5b 100644 --- a/packages/apps/tenant/values.yaml +++ b/packages/apps/tenant/values.yaml @@ -1,18 +1,18 @@ ## @section Common parameters -## @param host The hostname used to access tenant services (defaults to using the tenant name as a subdomain for it's parent tenant host). -## @param etcd Deploy own Etcd cluster -## @param monitoring Deploy own Monitoring Stack -## @param ingress Deploy own Ingress Controller -## @param seaweedfs Deploy own SeaweedFS -## @param isolated Enforce tenant namespace with network policies -## @param resourceQuotas Define resource quotas for the tenant +## @param host {*string} The hostname used to access tenant services (defaults to using the tenant name as a subdomain for it's parent tenant host). +## @param etcd {bool} Deploy own Etcd cluster +## @param monitoring {bool} Deploy own Monitoring Stack +## @param ingress {bool} Deploy own Ingress Controller +## @param seaweedfs {bool} Deploy own SeaweedFS +## @param isolated {bool} Enforce tenant namespace with network policies, `true` by default host: "" etcd: false monitoring: false ingress: false seaweedfs: false isolated: true +## @param resourceQuotas {map[string]quantity} Define resource quotas for the tenant resourceQuotas: {} # resourceQuotas: # cpu: "1"