Skip to content

Commit

Permalink
#200: Initial status support for crash loop detection
Browse files Browse the repository at this point in the history
- Add status to all crds.
- Extend operator role to allow editing status for our crds

Part of eclipse-theia/theia-cloud#200
  • Loading branch information
lucas-koehler committed Aug 1, 2023
1 parent 3b4eb5e commit a4cadb1
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,82 @@ spec:
singular: appdefinition
scope: Namespaced
versions:
- name: v7beta
- name: v8beta
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: v7beta
served: true
storage: false
schema:
openAPIV3Schema:
type: object
Expand Down
51 changes: 50 additions & 1 deletion charts/theia-cloud-crds/templates/session-spec-resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
48 changes: 47 additions & 1 deletion charts/theia-cloud-crds/templates/workspace-spec-resource.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions charts/theia.cloud-base/templates/operator-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ rules:
resources:
- customresourcedefinitions
- appdefinitions
- appdefinitions/status
- workspaces
- workspaces/status
- ingresses
- sessions
- sessions/status
- persistentvolumes
- persistentvolumeclaims
- services
Expand Down

0 comments on commit a4cadb1

Please sign in to comment.