From 4ae1fece8aad70fb5cfad9fa618fa1f854eb5df9 Mon Sep 17 00:00:00 2001 From: Lucas Koehler Date: Tue, 1 Aug 2023 17:50:20 +0200 Subject: [PATCH] #200: Initial status support for crash loop detection - Add status to all crds. - Extend operator role to allow editing status for our crds Part of eclipsesource/theia-cloud#200 --- .../appdefinition-spec-resource.yaml | 75 ++++++++++++++++++- .../templates/session-spec-resource.yaml | 51 ++++++++++++- .../templates/workspace-spec-resource.yaml | 48 +++++++++++- .../templates/operator-role.yaml | 3 + 4 files changed, 174 insertions(+), 3 deletions(-) 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/templates/operator-role.yaml b/charts/theia.cloud-base/templates/operator-role.yaml index 7fac410..e2b337e 100644 --- a/charts/theia.cloud-base/templates/operator-role.yaml +++ b/charts/theia.cloud-base/templates/operator-role.yaml @@ -16,9 +16,12 @@ rules: resources: - customresourcedefinitions - appdefinitions + - appdefinitions/status - workspaces + - workspaces/status - ingresses - sessions + - sessions/status - persistentvolumes - persistentvolumeclaims - services