kind: DevWorkspaceTemplate
apiVersion: workspace.devfile.io/v1alpha2
metadata:
  name: theia-next
  annotations:
    controller.devfile.io/allow-import-from: '*'
spec:
  components:
    - name: plugins
      volume: {}
    - name: remote-endpoint
      volume:
        ephemeral: true
    - name: remote-runtime-injector
      plugin:
        kubernetes:
          name: remote-runtime-injector
          namespace: devworkspace-plugins
    - name: theia-ide
      attributes:
        "app.kubernetes.io/name": che-theia.eclipse.org
        "app.kubernetes.io/part-of": che.eclipse.org
        "app.kubernetes.io/component": editor

        # Added by Che-theia at start when detecting, after cloning, that the extensions.json in the repo
        # contains the vscode-pull-request-github vscode plugin.
        "che-theia.eclipse.org/vscode-extensions":
          - https://github.com/microsoft/vscode-pull-request-github/releases/download/v0.8.0/vscode-pull-request-github-0.8.0.vsix
      container:
        image: "quay.io/eclipse/che-theia:next"
        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:
          - path: "/plugins"
            name: plugins
        mountSources: true
        memoryLimit: "512M"
        endpoints:
          - name: "theia"
            exposure: public
            targetPort: 3100
            secure: true
            protocol: http
            attributes:
              type: main
          - name: "webviews"
            exposure: public
            targetPort: 3100
            protocol: http
            secure: true
            attributes:
              type: webview
              unique: "true"
          - name: "theia-dev"
            exposure: public
            targetPort: 3130
            protocol: http
            attributes:
              type: ide-dev
          - name: "theia-redir-1"
            exposure: public
            targetPort: 13131
            protocol: http
          - name: "theia-redir-2"
            exposure: public
            targetPort: 13132
            protocol: http
          - name: "theia-redir-3"
            exposure: public
            targetPort: 13133
            protocol: http
