diff --git a/chart/crds/stream.streamspace.io_connections.yaml b/chart/crds/stream.space_connections.yaml similarity index 97% rename from chart/crds/stream.streamspace.io_connections.yaml rename to chart/crds/stream.space_connections.yaml index 9bbef471..70b1cebb 100644 --- a/chart/crds/stream.streamspace.io_connections.yaml +++ b/chart/crds/stream.space_connections.yaml @@ -1,11 +1,11 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: connections.stream.streamspace.io + name: connections.stream.space annotations: controller-gen.kubebuilder.io/version: v0.11.1 spec: - group: stream.streamspace.io + group: stream.space names: kind: Connection listKind: ConnectionList diff --git a/chart/crds/stream.space_sessions.yaml b/chart/crds/stream.space_sessions.yaml new file mode 100644 index 00000000..da66c726 --- /dev/null +++ b/chart/crds/stream.space_sessions.yaml @@ -0,0 +1,131 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: sessions.stream.space +spec: + group: stream.space + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + type: object + properties: + spec: + type: object + required: [user, template, state] + properties: + user: + type: string + description: Username who owns this session + minLength: 1 + maxLength: 253 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + template: + type: string + description: Template name to use for this session + minLength: 1 + maxLength: 253 + pattern: '^[a-z0-9]([-a-z0-9]*[a-z0-9])?$' + state: + type: string + enum: [running, hibernated, terminated] + description: Desired state of the session + resources: + type: object + properties: + memory: + type: string + description: Memory limit (e.g., 2Gi, 4Gi) + pattern: '^[0-9]+(Mi|Gi|Ti)$' + minLength: 2 + maxLength: 10 + cpu: + type: string + description: CPU limit (e.g., 1000m, 2000m) + pattern: '^[0-9]+(m)?$' + minLength: 1 + maxLength: 10 + persistentHome: + type: boolean + default: true + description: Mount persistent home directory + idleTimeout: + type: string + default: "30m" + description: Idle timeout before hibernation (e.g., 30m, 1h) + pattern: '^[0-9]+(s|m|h)$' + minLength: 2 + maxLength: 10 + maxSessionDuration: + type: string + default: "8h" + description: Maximum session duration before forced termination + pattern: '^[0-9]+(s|m|h)$' + minLength: 2 + maxLength: 10 + status: + type: object + properties: + phase: + type: string + enum: [Pending, Running, Hibernated, Failed, Terminated] + podName: + type: string + url: + type: string + lastActivity: + type: string + format: date-time + resourceUsage: + type: object + properties: + memory: + type: string + cpu: + type: string + conditions: + type: array + items: + type: object + properties: + type: + type: string + status: + type: string + lastTransitionTime: + type: string + format: date-time + reason: + type: string + message: + type: string + subresources: + status: {} + additionalPrinterColumns: + - name: User + type: string + jsonPath: .spec.user + - name: Template + type: string + jsonPath: .spec.template + - name: State + type: string + jsonPath: .spec.state + - name: Phase + type: string + jsonPath: .status.phase + - name: URL + type: string + jsonPath: .status.url + - name: Age + type: date + jsonPath: .metadata.creationTimestamp + scope: Namespaced + names: + plural: sessions + singular: session + kind: Session + shortNames: + - ss diff --git a/chart/crds/stream.streamspace.io_templaterepositories.yaml b/chart/crds/stream.space_templaterepositories.yaml similarity index 98% rename from chart/crds/stream.streamspace.io_templaterepositories.yaml rename to chart/crds/stream.space_templaterepositories.yaml index 37996b3f..5c58930a 100644 --- a/chart/crds/stream.streamspace.io_templaterepositories.yaml +++ b/chart/crds/stream.space_templaterepositories.yaml @@ -1,11 +1,11 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: - name: templaterepositories.stream.streamspace.io + name: templaterepositories.stream.space annotations: controller-gen.kubebuilder.io/version: v0.11.1 spec: - group: stream.streamspace.io + group: stream.space names: kind: TemplateRepository listKind: TemplateRepositoryList diff --git a/chart/crds/stream.space_templates.yaml b/chart/crds/stream.space_templates.yaml new file mode 100644 index 00000000..a4b6c49e --- /dev/null +++ b/chart/crds/stream.space_templates.yaml @@ -0,0 +1,125 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: templates.stream.space +spec: + group: stream.space + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + type: object + properties: + spec: + type: object + required: [displayName, baseImage] + properties: + displayName: + type: string + description: Human-readable name for the application + description: + type: string + description: Detailed description of the application + category: + type: string + description: Category for organizing templates (e.g., Browsers, Development) + icon: + type: string + description: URL to icon image + baseImage: + type: string + description: Docker image to use (e.g., lscr.io/linuxserver/firefox:latest) + defaultResources: + type: object + properties: + memory: + type: string + default: "2Gi" + cpu: + type: string + default: "1000m" + ports: + type: array + items: + type: object + properties: + name: + type: string + containerPort: + type: integer + protocol: + type: string + default: TCP + env: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string + volumeMounts: + type: array + items: + type: object + properties: + name: + type: string + mountPath: + type: string + vnc: + type: object + description: VNC server configuration (generic, not Kasm-specific) + properties: + enabled: + type: boolean + default: true + port: + type: integer + default: 3000 + capabilities: + type: array + items: + type: string + enum: [Network, Audio, Clipboard, USB, Printing] + tags: + type: array + items: + type: string + status: + type: object + properties: + phase: + type: string + description: Current phase (Ready, Invalid, etc.) + message: + type: string + description: Additional status information + subresources: + status: {} + additionalPrinterColumns: + - name: Display Name + type: string + jsonPath: .spec.displayName + - name: Category + type: string + jsonPath: .spec.category + - name: Image + type: string + jsonPath: .spec.baseImage + - name: Memory + type: string + jsonPath: .spec.defaultResources.memory + - name: Age + type: date + jsonPath: .metadata.creationTimestamp + scope: Namespaced + names: + plural: templates + singular: template + kind: Template + shortNames: + - tpl diff --git a/chart/crds/stream.streamspace.io_sessions.yaml b/chart/crds/stream.streamspace.io_sessions.yaml deleted file mode 100644 index a720b8c0..00000000 --- a/chart/crds/stream.streamspace.io_sessions.yaml +++ /dev/null @@ -1,219 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: sessions.stream.streamspace.io - annotations: - controller-gen.kubebuilder.io/version: v0.11.1 -spec: - group: stream.streamspace.io - names: - kind: Session - listKind: SessionList - plural: sessions - shortNames: - - ss - singular: session - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: Session is the Schema for the sessions API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: SessionSpec defines the desired state of Session - properties: - idleTimeout: - description: IdleTimeout specifies when to auto-hibernate (e.g., "30m") - type: string - maxSessionDuration: - description: MaxSessionDuration specifies maximum session lifetime - type: string - persistentHome: - description: PersistentHome enables mounting user's persistent home - directory - type: boolean - resources: - description: Resources specifies resource limits - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - 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 - description: 'Limits describes the maximum amount of compute resources - allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - 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 - description: 'Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - state: - description: State defines the desired state (running, hibernated, - terminated) - enum: - - running - - hibernated - - terminated - type: string - template: - description: Template references the Template to use - type: string - user: - description: User is the username who owns this session - type: string - required: - - state - - template - - user - type: object - status: - description: SessionStatus defines the observed state of Session - properties: - conditions: - description: Conditions represent the latest available observations - items: - description: "Condition contains details for one aspect of the current - state of this API Resource. --- This struct is intended for direct - use as an array at the field path .status.conditions. For example, - \n type FooStatus struct{ // Represents the observations of a - foo's current state. // Known .status.conditions.type are: \"Available\", - \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge - // +listType=map // +listMapKey=type Conditions []metav1.Condition - `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" - protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" - properties: - lastTransitionTime: - description: lastTransitionTime is the last time the condition - transitioned from one status to another. This should be when - the underlying condition changed. If that is not known, then - using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: message is a human readable message indicating - details about the transition. This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: observedGeneration represents the .metadata.generation - that the condition was set based upon. For instance, if .metadata.generation - is currently 12, but the .status.conditions[x].observedGeneration - is 9, the condition is out of date with respect to the current - state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: reason contains a programmatic identifier indicating - the reason for the condition's last transition. Producers - of specific condition types may define expected values and - meanings for this field, and whether the values are considered - a guaranteed API. The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: type of condition in CamelCase or in foo.example.com/CamelCase. - --- Many .condition.type values are consistent across resources - like Available, but because arbitrary conditions can be useful - (see .node.status.conditions), the ability to deconflict is - important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - lastActivity: - description: LastActivity tracks the last user interaction time - format: date-time - type: string - phase: - description: Phase represents the current phase (Pending, Running, - Hibernated, etc.) - type: string - podName: - description: PodName is the name of the pod running this session - type: string - resourceUsage: - description: ResourceUsage shows current resource consumption - properties: - cpu: - anyOf: - - type: integer - - 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 - memory: - anyOf: - - type: integer - - 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 - type: object - url: - description: URL is the access URL for this session - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} - additionalPrinterColumns: - - name: User - type: string - jsonPath: .spec.user - - name: Template - type: string - jsonPath: .spec.template - - name: State - type: string - jsonPath: .spec.state - - name: Phase - type: string - jsonPath: .status.phase - - name: URL - type: string - jsonPath: .status.url - - name: Age - type: date - jsonPath: .metadata.creationTimestamp diff --git a/chart/crds/stream.streamspace.io_templates.yaml b/chart/crds/stream.streamspace.io_templates.yaml deleted file mode 100644 index a7736562..00000000 --- a/chart/crds/stream.streamspace.io_templates.yaml +++ /dev/null @@ -1,306 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: templates.stream.streamspace.io - annotations: - controller-gen.kubebuilder.io/version: v0.11.1 -spec: - group: stream.streamspace.io - names: - kind: Template - listKind: TemplateList - plural: templates - shortNames: - - tpl - singular: template - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: Template is the Schema for the templates API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: TemplateSpec defines the desired state of Template - properties: - baseImage: - description: BaseImage is the container image to use - type: string - capabilities: - description: Capabilities lists available features (Network, Audio, - Clipboard, etc.) - items: - type: string - type: array - appType: - description: AppType specifies whether this is a desktop or webapp application - enum: - - desktop - - webapp - type: string - category: - description: Category for organizing templates in the UI - type: string - defaultResources: - description: DefaultResources specifies default resource requests/limits - properties: - limits: - additionalProperties: - anyOf: - - type: integer - - 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 - description: 'Limits describes the maximum amount of compute resources - allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - requests: - additionalProperties: - anyOf: - - type: integer - - 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 - description: 'Requests describes the minimum amount of compute - resources required. If Requests is omitted for a container, - it defaults to Limits if that is explicitly specified, otherwise - to an implementation-defined value. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/' - type: object - type: object - description: - description: Description provides detailed information about this - template - type: string - displayName: - description: DisplayName is the human-readable name - type: string - env: - description: Env specifies environment variables - items: - description: EnvVar represents an environment variable present in - a Container. - properties: - name: - description: Name of the environment variable. Must be a C_IDENTIFIER. - type: string - value: - description: 'Variable references $(VAR_NAME) are expanded using - the previously defined environment variables in the container - and any service environment variables. If a variable cannot - be resolved, the reference in the input string will be unchanged. - Double $$ are reduced to a single $, which allows for escaping - the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will produce the - string literal "$(VAR_NAME)". Escaped references will never - be expanded, regardless of whether the variable exists or - not. Defaults to "".' - type: string - valueFrom: - description: Source for the environment variable's value. Cannot - be used if value is not empty. - properties: - configMapKeyRef: - description: Selects a key of a ConfigMap. - properties: - key: - description: The key to select. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the ConfigMap or its key - must be defined - type: boolean - required: - - key - type: object - fieldRef: - description: 'Selects a field of the pod: supports metadata.name, - metadata.namespace, `metadata.labels['''']`, `metadata.annotations['''']`, - spec.nodeName, spec.serviceAccountName, status.hostIP, - status.podIP, status.podIPs.' - properties: - apiVersion: - description: Version of the schema the FieldPath is - written in terms of, defaults to "v1". - type: string - fieldPath: - description: Path of the field to select in the specified - API version. - type: string - required: - - fieldPath - type: object - resourceFieldRef: - description: 'Selects a resource of the container: only - resources limits and requests (limits.cpu, limits.memory, - limits.ephemeral-storage, requests.cpu, requests.memory - and requests.ephemeral-storage) are currently supported.' - properties: - containerName: - description: 'Container name: required for volumes, - optional for env vars' - type: string - divisor: - anyOf: - - type: integer - - type: string - description: Specifies the output format of the exposed - resources, defaults to "1" - pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ - x-kubernetes-int-or-string: true - resource: - description: 'Required: resource to select' - type: string - required: - - resource - type: object - secretKeyRef: - description: Selects a key of a secret in the pod's namespace - properties: - key: - description: The key of the secret to select from. Must - be a valid secret key. - type: string - name: - description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names - TODO: Add other useful fields. apiVersion, kind, uid?' - type: string - optional: - description: Specify whether the Secret or its key must - be defined - type: boolean - required: - - key - type: object - type: object - required: - - name - type: object - type: array - icon: - description: Icon is the URL to the template icon - type: string - tags: - description: Tags for categorization and search - items: - type: string - type: array - vnc: - description: VNC defines VNC server configuration (generic, not Kasm-specific) - properties: - enabled: - description: Enabled indicates if VNC is enabled for this template - type: boolean - encryption: - description: Encryption enables VNC encryption - type: boolean - port: - description: Port is the VNC server port (default 5900 or 3000 - for LinuxServer.io) - type: integer - protocol: - description: Protocol specifies the VNC protocol (rfb, websocket) - type: string - type: object - webapp: - description: WebApp defines native web application configuration - properties: - enabled: - description: Enabled indicates if this is a native webapp - type: boolean - healthCheck: - description: HealthCheck path for checking if the webapp is ready - type: string - path: - description: Path is the URL path for the webapp (default "/") - type: string - port: - description: Port is the webapp HTTP port - type: integer - type: object - volumeMounts: - description: VolumeMounts specifies additional volume mounts - items: - description: VolumeMount describes a mounting of a Volume within - a container. - properties: - mountPath: - description: Path within the container at which the volume should - be mounted. Must not contain ':'. - type: string - mountPropagation: - description: mountPropagation determines how mounts are propagated - from the host to container and the other way around. When - not set, MountPropagationNone is used. This field is beta - in 1.10. - type: string - name: - description: This must match the Name of a Volume. - type: string - readOnly: - description: Mounted read-only if true, read-write otherwise - (false or unspecified). Defaults to false. - type: boolean - subPath: - description: Path within the volume from which the container's - volume should be mounted. Defaults to "" (volume's root). - type: string - subPathExpr: - description: Expanded path within the volume from which the - container's volume should be mounted. Behaves similarly to - SubPath but environment variable references $(VAR_NAME) are - expanded using the container's environment. Defaults to "" - (volume's root). SubPathExpr and SubPath are mutually exclusive. - type: string - required: - - mountPath - - name - type: object - type: array - required: - - baseImage - - displayName - type: object - status: - description: TemplateStatus defines the observed state of Template - properties: - message: - description: Message provides additional information about the template - status - type: string - phase: - description: Phase represents the current phase (Ready, Invalid, etc.) - type: string - type: object - type: object - served: true - storage: true - subresources: - status: {} - additionalPrinterColumns: - - name: Display Name - type: string - jsonPath: .spec.displayName - - name: Category - type: string - jsonPath: .spec.category - - name: Phase - type: string - jsonPath: .status.phase - - name: Age - type: date - jsonPath: .metadata.creationTimestamp