forked from minishift/minishift-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue minishift#42 Eclipse Che addon
Signed-off-by: Sun Seng David TAN <[email protected]>
- Loading branch information
1 parent
502b2c2
commit 0984944
Showing
6 changed files
with
619 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Eclipse Che Addon | ||
|
||
This addon create Eclipse Che templates, image streams and a project running Che in Minishift. In short this helps in setting up Eclipse Che | ||
on Minishift inline with [Deploy Che on Minishift](https://www.eclipse.org/che/docs/setup/openshift/index.html#deploy-che-on-minishift) | ||
|
||
<!-- MarkdownTOC --> | ||
|
||
- [Using the Eclipse Che Add-on](#using-the-eclipse-che-add-on) | ||
- [Install add-on](#install-add-on) | ||
- [Start Minishift](#start-minishift) | ||
- [Apply add-on](#apply-add-on) | ||
- [Replace Che stacks](#replace-stacks) | ||
- [Remove add-on](#remove-add-on) | ||
- [Uninstall add-on](#uninstall-add-on) | ||
|
||
<!-- /MarkdownTOC --> | ||
|
||
This addon provides an easy way to install Eclipse Che on MiniShift. | ||
|
||
Eclipse Che provides a complete cloud IDE. | ||
|
||
<a name="using-the-eclipse-che-add-on"></a> | ||
## Using the Eclipse Che Add-on | ||
|
||
The best way of using this add-on is via the [`minishift add-ons apply`](https://docs.openshift.org/latest/minishift/command-ref/minishift_addons_apply.html) command which is outlined in the following paragraphs. | ||
|
||
<a name="install-add-on"></a> | ||
### Install add-on | ||
Che default stacks require root privilege to run sshd. Without root privilege, workspaces will take more time to timeout and start. | ||
One workaround would be to enable the `anyuid` addon. Another way would be to [replace the existing stacks](#replace-stacks) with the ones without the `sshd` agent. | ||
|
||
$ minishift addons install --defaults | ||
$ minishift addons enable anyuid | ||
|
||
Clone this repository onto your local machine and then install the add-on via: | ||
|
||
$ minishift addons install <path_to_directory_containing_this_readme> | ||
$ minishift addons enable che | ||
|
||
|
||
`enable` will setup Eclipse Che when you start Minishift the next time. | ||
|
||
<a name="start-minishift"></a> | ||
### Start Minishift | ||
|
||
Start Minishift using something like this: | ||
|
||
$ minishift start | ||
|
||
However, as default memory is set to 2GB and a che-server takes about 700MB memory and a default stack workspace can reach 2GB, | ||
we recommand to start Minishift with at least 5GB: | ||
|
||
$ minishift start --memory=5GB | ||
|
||
<a name="apply-add-on"></a> | ||
### Apply add-on | ||
If Minishift is already started and che addon is installed. It is possible to deploy che without restarting Minishift: | ||
|
||
|
||
$ minishift addons apply che | ||
|
||
|
||
<a name="replace-stacks"></a> | ||
### Replace Che stacks | ||
Once Che is up and running, | ||
|
||
$ STACKS_SCRIPT_URL=https://raw.githubusercontent.com/eclipse/che/master/dockerfiles/init/modules/openshift/files/scripts/replace_stacks.sh | ||
$ curl -fsSL ${STACKS_SCRIPT_URL} -o ./stacks-che.sh | ||
$ oc project mini-che && bash ./stacks-che.sh | ||
|
||
|
||
<a name="remove-add-on"></a> | ||
### Remove add-on | ||
To remove all created template and che project: | ||
|
||
|
||
$ minishift addons remove che | ||
|
||
<a name="uninstall-add-on"></a> | ||
### Uninstall add-on | ||
To uninstall the addon from the addon list: | ||
|
||
|
||
$ minishift addons uninstall che | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Name: che | ||
# Description: Setup and Configure Eclipse Che Template and Image Streams | ||
# Url: https://www.eclipse.org/che/docs/setup/openshift/index.html | ||
|
||
echo [CHE] Create Image Stream | ||
oc apply -f streams/che-server-streams.json -n openshift | ||
|
||
echo [CHE] Create the Che server Template | ||
oc apply -f templates/che-single-user.yml -n openshift | ||
|
||
echo [CHE] Creating mini-che project | ||
oc new-project mini-che --description="Eclipse Che on minishift" --as=developer | ||
|
||
echo [CHE] Switching to mini-che... | ||
oc project mini-che | ||
|
||
echo [CHE] Deploying Che on minishift | ||
oc new-app --param DOMAIN_NAME=#{ip}.nip.io che-single-user -n mini-che | ||
|
||
echo Please wait while the pods all startup! | ||
echo You can watch in the OpenShift console via: | ||
echo minishift console | ||
echo Then you should be able the open the Che dashboard here: | ||
echo http://che-mini-che.#{ip}.nip.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Name: che | ||
# Description: Remove add on | ||
# Url: https://www.eclipse.org/che/docs/setup/openshift/index.html | ||
|
||
echo [CHE] Removing Image Stream | ||
oc delete -f streams/che-server-streams.json -n openshift | ||
|
||
echo [CHE] Removing Che server Template | ||
oc delete -f templates/che-single-user.yml -n openshift | ||
|
||
echo [CHE] Removing mini-che project | ||
oc delete project mini-che | ||
|
||
echo Eclipse Che addon removed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"apiVersion": "v1", | ||
"kind": "RoleBinding", | ||
"metadata": { | ||
"name": "che" | ||
}, | ||
"roleRef": { | ||
"name": "admin" | ||
}, | ||
"subjects": [ | ||
{ | ||
"kind": "ServiceAccount", | ||
"name": "che" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"kind": "ImageStreamList", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "che-server-image-streams", | ||
"annotations": { | ||
"description": "ImageStream definitions for Eclipse Che Servers.", | ||
"openshift.io/display-name": "Eclipse Che IDE" | ||
} | ||
}, | ||
"items": [ | ||
{ | ||
"kind": "ImageStream", | ||
"apiVersion": "v1", | ||
"metadata": { | ||
"name": "che-server", | ||
"annotations": { | ||
"description": " Eclipse Che Servers 5.x" | ||
} | ||
}, | ||
"spec": { | ||
"tags": [ | ||
{ | ||
"name": "latest", | ||
"annotations": { | ||
"name": " Eclipse Che Server (latest)", | ||
"description": "Eclipse Che server centos images.", | ||
"iconClass": "icon-che", | ||
"tags": "java,ide,eclipse,che" | ||
}, | ||
"from": { | ||
"kind": "ImageStreamTag", | ||
"name": "5.19.0-centos" | ||
} | ||
}, | ||
{ | ||
"name": "5.19.0-centos", | ||
"annotations": { | ||
"openshift.io/display-name": "Eclipse Che Server 5.19.0", | ||
"description": "Eclipse Che server centos images.", | ||
"iconClass": "icon-che", | ||
"tags": "java,ide,eclipse,che", | ||
"version": "5.19.0-centos" | ||
}, | ||
"from": { | ||
"kind": "DockerImage", | ||
"name": "eclipse/che-server:5.19.0-centos" | ||
} | ||
}, | ||
{ | ||
"name": "nightly", | ||
"annotations": { | ||
"name": " Eclipse Che Server (nightly)", | ||
"description": "Eclipse Che server nightly centos images.", | ||
"iconClass": "icon-che", | ||
"tags": "java,ide,eclipse,che" | ||
}, | ||
"from": { | ||
"kind": "ImageStreamTag", | ||
"name": "nightly-centos" | ||
} | ||
}, | ||
{ | ||
"name": "nightly-centos", | ||
"annotations": { | ||
"openshift.io/display-name": "Eclipse Che Server 5.19.0-SNAPSHOT", | ||
"description": "Eclipse Che server nightly centos images.", | ||
"iconClass": "icon-che", | ||
"tags": "java,ide,eclipse,che", | ||
"version": "nightly-centos" | ||
}, | ||
"from": { | ||
"kind": "DockerImage", | ||
"name": "eclipse/che-server:nightly-centos" | ||
} | ||
} | ||
] | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.