schemaVersion: 2.1.0
metadata:
  name: theia-ide
commands:
  - id: init-container-command
    apply:
      component: remote-runtime-injector
events:
  preStart:
    - init-container-command
components:
  - name: theia-ide
    container:
      image: "registry.redhat.io/codeready-workspaces/theia-rhel8@sha256:de36fdf140ba6367e6edf577d6dbaffa270e5e5ecf0890e498f5907f8287858f"
      env:
        - name: THEIA_PLUGINS
          value: 'local-dir:///plugins'
        - name: HOSTED_PLUGIN_HOSTNAME
          value: 0.0.0.0
        - name: HOSTED_PLUGIN_PORT
          value: '3130'
        - name: THEIA_HOST
          value: 0.0.0.0
      volumeMounts:
        - name: plugins
          path: /plugins
        - name: theia-local
          path: /home/theia/.theia
      mountSources: true
      memoryLimit: 512M
      endpoints:
        - name: theia
          attributes:
            type: ide
            cookiesAuthEnabled: true
            discoverable: false
          targetPort: 3100
          exposure: public
          secure: false
          protocol: https
        - name: webviews
          attributes:
            type: webview
            cookiesAuthEnabled: true
            discoverable: false
            unique: true
          targetPort: 3100
          exposure: public
          secure: false
          protocol: https
        - name: mini-browser
          attributes:
            type: mini-browser
            cookiesAuthEnabled: true
            discoverable: false
            unique: true
          targetPort: 3100
          exposure: public
          secure: false
          protocol: https
        - name: theia-dev
          attributes:
            type: ide-dev
            discoverable: false
          targetPort: 3130
          exposure: public
          protocol: http
        - name: theia-redirect-1
          attributes:
            discoverable: false
          targetPort: 13131
          exposure: public
          protocol: http
        - name: theia-redirect-2
          attributes:
            discoverable: false
          targetPort: 13132
          exposure: public
          protocol: http
        - name: theia-redirect-3
          attributes:
            discoverable: false
          targetPort: 13133
          exposure: public
          protocol: http
        - name: terminal
          attributes:
            type: collocated-terminal
            discoverable: false
            cookiesAuthEnabled: true
          targetPort: 3333
          exposure: public
          secure: false
          protocol: wss
  - name: plugins
    volume: {}
  - name: theia-local
    volume: {}
  - name: che-machine-exec
    container:
      image: 'registry.redhat.io/codeready-workspaces/machineexec-rhel8@sha256:19a8daf7f9adde981dcd588b0526fa7682111097849f60a9b0e81137bdde8f6c'
      command:
        - /go/bin/che-machine-exec
        - '--url'
        - '0.0.0.0:3333'
  - name: remote-runtime-injector
    container:
      image: >-
        registry.redhat.io/codeready-workspaces/theia-endpoint-rhel8@sha256:60c84fca55a997a6aab4ca07b8ff7d859948c1f525adeba2ae624c84fe059a56
      env:
        - name: PLUGIN_REMOTE_ENDPOINT_EXECUTABLE
          value: /remote-endpoint/plugin-remote-endpoint
        - name: REMOTE_ENDPOINT_VOLUME_NAME
          value: remote-endpoint
      volumeMounts:
        - name: remote-endpoint
          path: /remote-endpoint
  - name: remote-endpoint
    volume:
      ephemeral: true