From 92d88b5389d0893fef6db936619cecde74fdcb3d Mon Sep 17 00:00:00 2001 From: Simon Graband Date: Thu, 18 Apr 2024 09:45:10 +0200 Subject: [PATCH] Add options field to CRDs (#55) This field can be used by adopters to pass arbitrary data to the operator. Field is added to all three CRDs for maximum configurability. Bumped version number to `Session.v1beta8`, `Workspace.v1beta5` and `AppDefinition.v1beta10`. --- CHANGELOG.md | 4 +- charts/theia-cloud-crds/Chart.yaml | 2 +- charts/theia-cloud-crds/README.md | 4 +- .../appdefinition-spec-resource.yaml | 94 ++++++++++++++++++- .../templates/session-spec-resource.yaml | 63 ++++++++++++- .../templates/workspace-spec-resource.yaml | 60 +++++++++++- 6 files changed, 220 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f710e03..957aaf9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog - +## [0.11.0] - estimated 2024-07 + +- [theia-cloud-crds] Add option field to CRDs and increase version to `Session.v1beta8`, `Workspace.v1beta5` and `AppDefinition.v1beta10` [#55](https://github.com/eclipsesource/theia-cloud-helm/pull/55) | [#293](https://github.com/eclipsesource/theia-cloud/pull/293) ## [0.10.0] - 2024-04-02 diff --git a/charts/theia-cloud-crds/Chart.yaml b/charts/theia-cloud-crds/Chart.yaml index 70709c0..e62576c 100644 --- a/charts/theia-cloud-crds/Chart.yaml +++ b/charts/theia-cloud-crds/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.11.0-next.0 +version: 0.11.0-next.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/theia-cloud-crds/README.md b/charts/theia-cloud-crds/README.md index 75668be..8682aac 100644 --- a/charts/theia-cloud-crds/README.md +++ b/charts/theia-cloud-crds/README.md @@ -1,6 +1,6 @@ # theia-cloud-crds -![Version: 0.11.0-next.0](https://img.shields.io/badge/Version-0.11.0--next.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.11.0-next](https://img.shields.io/badge/AppVersion-0.11.0--next-informational?style=flat-square) +![Version: 0.11.0-next.1](https://img.shields.io/badge/Version-0.11.0--next.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.11.0-next](https://img.shields.io/badge/AppVersion-0.11.0--next-informational?style=flat-square) A Helm chart for the custom resource definitions (CRDs) of Theia Cloud @@ -13,4 +13,4 @@ A Helm chart for the custom resource definitions (CRDs) of Theia Cloud | conversion.image | string | `"theiacloud/theia-cloud-conversion-webhook:0.11.0-next"` | The image of the webhook container | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) +Autogenerated from chart metadata using [helm-docs v1.12.0](https://github.com/norwoodj/helm-docs/releases/v1.12.0) diff --git a/charts/theia-cloud-crds/templates/appdefinition-spec-resource.yaml b/charts/theia-cloud-crds/templates/appdefinition-spec-resource.yaml index eff929d..e63fb3d 100644 --- a/charts/theia-cloud-crds/templates/appdefinition-spec-resource.yaml +++ b/charts/theia-cloud-crds/templates/appdefinition-spec-resource.yaml @@ -16,10 +16,102 @@ spec: - ad scope: Namespaced versions: - - name: v1beta9 + - name: v1beta10 served: true storage: true # subresources describes the subresources for custom resources. + subresources: + # status enables the status subresource. + status: {} + schema: + openAPIV3Schema: + type: object + properties: + spec: + type: object + x-kubernetes-validations: + - rule: "self.minInstances <= self.maxInstances" + message: "minInstances should be less or equal than maxInstances." + properties: + name: + type: string + pattern: "^[a-z0-9A-Z-_]+$" + image: + type: string + imagePullPolicy: + type: string + enum: ["Always", "IfNotPresent", "Never"] + pullSecret: + type: string + uid: + type: integer + port: + type: integer + minimum: 0 + maximum: 65535 + ingressname: + type: string + minInstances: + type: integer + maxInstances: + type: integer + timeout: + type: integer + requestsMemory: + type: string + requestsCpu: + type: string + limitsMemory: + type: string + limitsCpu: + type: string + downlinkLimit: + type: integer + uplinkLimit: + type: integer + mountPath: + type: string + monitor: + type: object + properties: + port: + type: integer + activityTracker: + type: object + properties: + timeoutAfter: + type: integer + notifyAfter: + type: integer + options: + type: object + additionalProperties: + x-kubernetes-int-or-string: true + required: + - name + - image + - uid + - port + - ingressname + - minInstances + - maxInstances + - requestsCpu + - requestsMemory + - limitsMemory + - limitsCpu + status: + type: object + properties: + operatorStatus: + type: string + operatorMessage: + type: string + required: + - spec + - name: v1beta9 + served: true + storage: false + # subresources describes the subresources for custom resources. subresources: # status enables the status subresource. status: {} diff --git a/charts/theia-cloud-crds/templates/session-spec-resource.yaml b/charts/theia-cloud-crds/templates/session-spec-resource.yaml index 0167006..3af7353 100644 --- a/charts/theia-cloud-crds/templates/session-spec-resource.yaml +++ b/charts/theia-cloud-crds/templates/session-spec-resource.yaml @@ -13,10 +13,71 @@ spec: singular: session scope: Namespaced versions: - - name : v1beta7 + - name : v1beta8 served: true storage: true # subresources describes the subresources for custom resources. + subresources: + # status enables the status subresource. + status: {} + schema: + openAPIV3Schema: + type: object + properties: + spec: + type: object + properties: + name: + type: string + pattern: '^[a-z0-9A-Z-_]+$' + workspace: + type: string + appDefinition: # cached from workspace + type: string + pattern: '^[a-z0-9A-Z-_]+$' + user: # cached from workspace + type: string + sessionSecret: + type: string + options: + type: object + additionalProperties: + x-kubernetes-int-or-string: true + envVars: + type: object + additionalProperties: + x-kubernetes-int-or-string: true + envVarsFromConfigMaps: + type: array + items: + type: string + envVarsFromSecrets: + type: array + items: + type: string + required: + - name + - user + - appDefinition + status: + type: object + properties: + operatorStatus: + type: string + operatorMessage: + type: string + url: + type: string + error: + type: string + lastActivity: + type: integer + required: + - spec + - name : v1beta7 + served: true + storage: false + # subresources describes the subresources for custom resources. subresources: # status enables the status subresource. status: {} diff --git a/charts/theia-cloud-crds/templates/workspace-spec-resource.yaml b/charts/theia-cloud-crds/templates/workspace-spec-resource.yaml index f4d5162..3c9d5da 100644 --- a/charts/theia-cloud-crds/templates/workspace-spec-resource.yaml +++ b/charts/theia-cloud-crds/templates/workspace-spec-resource.yaml @@ -15,10 +15,68 @@ spec: - ws scope: Namespaced versions: - - name : v1beta4 + - name : v1beta5 served: true storage: true # subresources describes the subresources for custom resources. + subresources: + # status enables the status subresource. + status: {} + schema: + openAPIV3Schema: + type: object + properties: + spec: + type: object + properties: + name: + type: string + pattern: '^[a-z0-9A-Z-_]+$' + label: + type: string + appDefinition: # last app definition that ran on this workspace + type: string + pattern: '^[a-z0-9A-Z-_]+$' + user: # user who created the workspace + type: string + storage: + type: string + options: + type: object + additionalProperties: + x-kubernetes-int-or-string: true + required: + - name + - user + status: + type: object + properties: + operatorStatus: + type: string + operatorMessage: + type: string + volumeClaim: + type: object + properties: + status: + type: string + message: + type: string + volumeAttach: + type: object + properties: + status: + type: string + message: + type: string + error: + type: string + required: + - spec + - name : v1beta4 + served: true + storage: false + # subresources describes the subresources for custom resources. subresources: # status enables the status subresource. status: {}