Skip to content

Commit

Permalink
Introduce a template-based custom docker server evaluation strategy (#…
Browse files Browse the repository at this point in the history
…4928)

* Introduce a custom server evaluation strategy
This custom server evaluation strategy allows to configure the links by providing a set of macro/templates.
It avoids to create one strategy class file for each needs, as template/macros can be used independently.

Change-Id: I3d941e0e786bdbfec037ba59e3f790f890bf9eb0
Signed-off-by: Florent BENOIT <fbenoit@codenvy.com>
  • Loading branch information
benoitf authored May 12, 2017
1 parent aed295c commit 52e418b
Show file tree
Hide file tree
Showing 5 changed files with 686 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,28 @@ che.docker.ip.external=NULL
# - 'default': internal address is address of docker host and ephemeral port are used
# - 'docker-local': internal address is address of container within docker network, and exposed ports
# are used.
# - 'custom': The evaluation strategy may be customized through a template property.
# The 'docker-local' strategy may be useful if a firewall prevents communication between che-server and
# workspace containers, but will prevent communication when che-server and workspace containers are not
# on the same Docker network.
che.docker.server_evaluation_strategy=default


# Here are macros available for the custom server evaluation strategy
# serverName: server reference exposing the port (like tomcat8, ws-agent, etc)
# machineName: name of the machine of the workspace. (like devMachine)
# workspaceId: id of the workspace
# internalIp: IP of the internal address of che (che.docker.ip property)
# externalIP: IP of the external address of che
# externalAddresss : external address of che (che.docker.ip.external or if null che.docker.ip)
# chePort : Che listening port number of workspace master
# wildcardNipDomain : get external address transformed into a nip.io DNS sub-domain
# wildcardXipDomain : get external address transformed into a xip.io DNS sub-domain
che.docker.server_evaluation_strategy.custom.template=<serverName>.<machineName>.<workspaceId>.<wildcardNipDomain>:<chePort>

# Protocol to use for http access (for example it can be set to https)
che.docker.server_evaluation_strategy.custom.external.protocol=http

# Provides a Docker network where Che server is running.
# Workspace containers created by Che will be added to this Docker network.
# Communications between the Che server and container occur over this network.
Expand Down
4 changes: 4 additions & 0 deletions plugins/plugin-docker/che-plugin-docker-machine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>ST4</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.che.core</groupId>
<artifactId>che-core-api-core</artifactId>
Expand Down
Loading

0 comments on commit 52e418b

Please sign in to comment.