From 903ee07fbd4dc94d4e645ce0276f228a47307522 Mon Sep 17 00:00:00 2001 From: Lucas Koehler Date: Wed, 2 Aug 2023 17:49:23 +0200 Subject: [PATCH] #200: Add status support for crash loop detection(#39) - Add status to all crds. - Extend operator role to allow editing status for our crds - Increase chart versions and use new app version Part of eclipsesource/theia-cloud#200 --- charts/theia-cloud-crds/Chart.yaml | 4 +- .../appdefinition-spec-resource.yaml | 75 ++++++++++++++++++- .../templates/session-spec-resource.yaml | 51 ++++++++++++- .../templates/workspace-spec-resource.yaml | 48 +++++++++++- charts/theia.cloud-base/Chart.yaml | 4 +- .../templates/operator-role.yaml | 3 + charts/theia.cloud/Chart.yaml | 4 +- charts/theia.cloud/values.yaml | 10 +-- 8 files changed, 185 insertions(+), 14 deletions(-) diff --git a/charts/theia-cloud-crds/Chart.yaml b/charts/theia-cloud-crds/Chart.yaml index 77f1aa4..22df018 100644 --- a/charts/theia-cloud-crds/Chart.yaml +++ b/charts/theia-cloud-crds/Chart.yaml @@ -15,10 +15,10 @@ 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.8.1-v001 +version: 0.8.1-v002 # 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 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.8.1.OSWeek23-v1" +appVersion: "0.8.1.OSWeek23-v3" diff --git a/charts/theia-cloud-crds/templates/appdefinition-spec-resource.yaml b/charts/theia-cloud-crds/templates/appdefinition-spec-resource.yaml index 8485333..534f92a 100644 --- a/charts/theia-cloud-crds/templates/appdefinition-spec-resource.yaml +++ b/charts/theia-cloud-crds/templates/appdefinition-spec-resource.yaml @@ -11,9 +11,82 @@ spec: singular: appdefinition scope: Namespaced versions: - - name: v6beta + - name: v7beta 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 + image: + type: string + imagePullPolicy: + type: string + enum: ["Always", "IfNotPresent", "Never"] + pullSecret: + type: string + uid: + type: integer + port: + type: integer + ingressname: + type: string + minInstances: + type: integer + maxInstances: + type: integer + timeout: + type: object + properties: + strategy: + type: string + limit: + 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 + status: + type: object + properties: + operatorStatus: + type: string + operatorMessage: + type: string + - name: v6beta + served: true + storage: false schema: openAPIV3Schema: type: object diff --git a/charts/theia-cloud-crds/templates/session-spec-resource.yaml b/charts/theia-cloud-crds/templates/session-spec-resource.yaml index 31a36e7..a3759f9 100644 --- a/charts/theia-cloud-crds/templates/session-spec-resource.yaml +++ b/charts/theia-cloud-crds/templates/session-spec-resource.yaml @@ -11,9 +11,58 @@ spec: singular: session scope: Namespaced versions: - - name : v4beta + - name : v5beta 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 + workspace: + type: string + appDefinition: # cached from workspace + type: string + user: # cached from workspace + type: string + url: + type: string + error: + type: string + sessionSecret: + type: string + lastActivity: + type: integer + envVars: + type: object + additionalProperties: + x-kubernetes-int-or-string: true + envVarsFromConfigMaps: + type: array + items: + type: string + envVarsFromSecrets: + type: array + items: + type: string + status: + type: object + properties: + operatorStatus: + type: string + operatorMessage: + type: string + - name : v4beta + served: true + storage: false schema: openAPIV3Schema: type: object diff --git a/charts/theia-cloud-crds/templates/workspace-spec-resource.yaml b/charts/theia-cloud-crds/templates/workspace-spec-resource.yaml index fe87c74..aa99251 100644 --- a/charts/theia-cloud-crds/templates/workspace-spec-resource.yaml +++ b/charts/theia-cloud-crds/templates/workspace-spec-resource.yaml @@ -11,9 +11,55 @@ spec: singular: workspace scope: Namespaced versions: - - name : v1beta + - name : v2beta 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 + label: + type: string + appDefinition: # last app definition that ran on this workspace + type: string + user: # user who created the workspace + type: string + storage: + type: string + 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 + + - name : v1beta + served: true + storage: false schema: openAPIV3Schema: type: object diff --git a/charts/theia.cloud-base/Chart.yaml b/charts/theia.cloud-base/Chart.yaml index 107f5ae..93d4cf6 100644 --- a/charts/theia.cloud-base/Chart.yaml +++ b/charts/theia.cloud-base/Chart.yaml @@ -15,10 +15,10 @@ 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.8.1-v002 +version: 0.8.1-v003 # 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 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.8.1.OSWeek23-v1" +appVersion: "0.8.1.OSWeek23-v3" diff --git a/charts/theia.cloud-base/templates/operator-role.yaml b/charts/theia.cloud-base/templates/operator-role.yaml index b580c07..cab0291 100644 --- a/charts/theia.cloud-base/templates/operator-role.yaml +++ b/charts/theia.cloud-base/templates/operator-role.yaml @@ -14,9 +14,12 @@ rules: resources: - customresourcedefinitions - appdefinitions + - appdefinitions/status - workspaces + - workspaces/status - ingresses - sessions + - sessions/status - persistentvolumes - persistentvolumeclaims - services diff --git a/charts/theia.cloud/Chart.yaml b/charts/theia.cloud/Chart.yaml index 2e5a552..2ba8c0a 100644 --- a/charts/theia.cloud/Chart.yaml +++ b/charts/theia.cloud/Chart.yaml @@ -15,10 +15,10 @@ 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.8.1-v005 +version: 0.8.1-v006 # 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 # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.8.1.OSWeek23-v2" +appVersion: "0.8.1.OSWeek23-v3" diff --git a/charts/theia.cloud/values.yaml b/charts/theia.cloud/values.yaml index b09a266..28e86dd 100644 --- a/charts/theia.cloud/values.yaml +++ b/charts/theia.cloud/values.yaml @@ -33,7 +33,7 @@ issuer: # Docker image of the main application image: # The name of docker image to be used - name: theiacloud/theia-cloud-demo:0.8.1.OSWeek23-v2 + name: theiacloud/theia-cloud-demo:0.8.1.OSWeek23-v3 # Optional: Override the imagePullPolicy for the main application's docker image. # If this is omitted or empty, the root at .Values.imagePullPolicy is used. @@ -93,7 +93,7 @@ hosts: # Values related to the landing page landingPage: # the landing page image to use - image: theiacloud/theia-cloud-landing-page:0.8.1.OSWeek23-v2 + image: theiacloud/theia-cloud-landing-page:0.8.1.OSWeek23-v3 # Optional: Override the imagePullPolicy for the landing page's docker image. # If this is omitted or empty, the root at .Values.imagePullPolicy is used. @@ -147,7 +147,7 @@ keycloak: # Values related to the operator operator: # The operator image - image: theiacloud/theia-cloud-operator:0.8.1.OSWeek23-v2 + image: theiacloud/theia-cloud-operator:0.8.1.OSWeek23-v3 # Optional: Override the imagePullPolicy for the operator's docker image. # If this is omitted or empty, the root at .Values.imagePullPolicy is used. @@ -176,7 +176,7 @@ operator: bandwidthLimiter: "K8SANNOTATION" # If bandwidthLimiter is set to WONDERSHAPER or K8SANNOTATIONANDWONDERSHAPER this image will be used for the wondershaper init container - wondershaperImage: theiacloud/theia-cloud-wondershaper:0.8.1.OSWeek23-v2 + wondershaperImage: theiacloud/theia-cloud-wondershaper:0.8.1.OSWeek23-v3 # Set the number of active sessions a single user can launch sessionsPerUser: "1" @@ -207,7 +207,7 @@ operator: # Values of the Theia.cloud REST service service: # The image to use - image: theiacloud/theia-cloud-service:0.8.1.OSWeek23-v2 + image: theiacloud/theia-cloud-service:0.8.1.OSWeek23-v3 # Optional: Override the imagePullPolicy for the service's docker image. # If this is omitted or empty, the root at .Values.imagePullPolicy is used.