Add an ability to expose K8s/OS tool container port in Workspace Runtime
See original GitHub issueShow motivation description
With Workspace Config, there is an ability to define that Container exposed some port (with server config entry in machine configuration) and then it is possible to get publicly available URL (powered by Ingress/Route) via Che Server API (it’s Workspace#Runtime#Machines[n]#Servers
).
And there are two main reasons why users may want to expose their containers ports with Che Server API:
- Theia provides UI to get these servers URLs for a user for further using, like their server testing.
- Theia itself may need to pick up such exposed port. See Detailed use-case description.
Detailed Theia Dev Use case description
In my use case I need a workspace with Theia editor and two custom containers which I use to launch another instance of Theia and remote plugin. This two containers must have exposed ports. One is for Theia http server, another one is for remote plugin which opens a websocket server. Theia has to know URI to the plugin server which is taken from workspace runtime.
In the Dockerfile I use kubernetes
tool to describe custom containers.
For those containers I need to describe exposes ports 3030 and 10000.
Here are my files from which I create my workspace.
.devfile
specVersion: 0.0.1
name: develop-remote-plugins
projects:
- name: theia
source:
type: git
location: 'https://github.com/theia-ide/theia.git'
- name: sample-remote-plugin
source:
type: git
location: 'https://github.com/vitaliy-guliy/sample-remote-plugin.git'
tools:
- name: theia-editor
type: cheEditor
id: org.eclipse.che.editor.theia:1.0.0
- name: exec-plugin
type: chePlugin
id: che-machine-exec-plugin:0.0.1
- name: dev
type: kubernetes
local: dev.yaml
commands:
- name: build-plugin
actions:
- type: exec
tool: dev-plugin
command: cd /projects/sample-remote-plugin && yarn
workdir: /projects/sample-remote-plugin
- name: build-theia
actions:
- type: exec
tool: dev
command: cd /projects/theia && yarn
workdir: /projects/theia
dev.yaml
---
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Pod
metadata:
name: ws
spec:
containers:
- name: dev
image: eclipse/che-theia-dev:nightly
resources:
limits:
memory: 2048Mi
volumeMounts:
- mountPath: /projects
name: projects
- name: dev-plugin
image: eclipse/che-theia-dev:nightly
resources:
limits:
memory: 2048Mi
volumeMounts:
- mountPath: /projects
name: projects
volumes:
- name: projects
persistentVolumeClaim:
claimName: projects
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: projects
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (12 by maintainers)
Top GitHub Comments
@sleshchenko
via Che API
->in Che workspace config
or just removevia Che API
WDYT ?Outdated