Oshinko Console Extensions
Switch branches/tags
Clone or download
crobby Now editing openshiftwebconsoleconfigs.webconsole.operator.openshift.io
instead of webconsole-config because that is what the operator used
in oc cluster up is using for web console config.
Latest commit 765bfba Sep 6, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Updating _.indexBy to _.keyBy for updated version of lodash. (#96) Jun 12, 2018
dist
distro-assembly [CI/CD] Creating release subproject for jenkins to preform releases (#42 Jan 31, 2017
test
tools Update docs and sample script for modern extension usage. (#95) Jun 11, 2018
.bowerrc initial setup Oct 17, 2016
.gitignore create zip/tar release files (#54) Mar 6, 2017
.jshintrc
.travis.yml Updating extension to run with openshift 3.9 and later. (#94) Jun 11, 2018
Gruntfile.js Updating to use latest protractor/jasmine/chrome Dec 11, 2017
LICENSE.txt initial setup Oct 17, 2016
README.md Update docs and sample script for modern extension usage. (#95) Jun 11, 2018
bower.json
package.json Updating extension to run with openshift 3.9 and later. (#94) Jun 11, 2018

README.md

Oshinko Console Extensions

The Oshinko console extensions in OpenShift Origin.

Contributing

Getting started

  1. Install Nodejs and npm
  2. Install grunt-cli and bower by running npm install -g grunt-cli bower (may need to be run with sudo)
  3. Install ruby
  4. Install bundler gem install bundler
  5. Run sudo npm install & bower install
  6. Build the code via grunt build for minified files or with grunt dev
  7. Spin-up a server (TLS enabled) to host the files located in the dist directory. If you're unsure on how to do this, see below for a tip.
  8. Login as system:admin and change to the openshift-web-console project. Modify the webconsole-config configmap oc edit configmap webconsole-config to point to the URL where your files are hosted.
assetConfig:
  ...
    extensionScripts:
    - /<path to>https://yourserver.org/dist/scripts/templates.js
    - /<path to>https://yourserver.org/dist/scripts/scripts.js
    extensionStylesheets:
    - /<path to>https://yourserver.org/dist/styles/oshinko.css
  ...
  1. Trigger a restart of the webconsole by deleting the only pod in the openshift-web-console project. The console will be restarted.

Setup

  1. Start Cluster oc cluster up --public-hostname=<your IP>
  2. Spin-up a server (TLS enabled) to host the files located in the dist directory. If you're unsure on how to do this, see below for a tip.
  3. Login as system:admin and change to the openshift-web-console project. Modify the webconsole-config configmap oc edit configmap webconsole-config to point to the URL where your files are hosted.
assetConfig:
  ...
    extensionScripts:
    - /<path to>https://yourserver.org/dist/scripts/templates.js
    - /<path to>https://yourserver.org/dist/scripts/scripts.js
    extensionStylesheets:
    - /<path to>https://yourserver.org/dist/styles/oshinko.css
  ...
  1. Trigger a restart of the webconsole by deleting the only pod in the openshift-web-console project. The console will be restarted.

Running integration tests

  1. Have an instance up and running with the extension installed (See Getting Started above)
  2. oc create configmap storedconfig --from-literal=mastercount=1 --from-literal=workercount=4
  3. grunt test-integration --baseUrl= (https://:8443 would be common)

Quick method to host your extension scripts

  1. Get a certificate (see comment in script) and run the following python script in your oshinko-console directory.
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
#    openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
#    python simple-https-server.py
# then in your browser, visit:
#    https://localhost:4443

import BaseHTTPServer, SimpleHTTPServer
import ssl

httpd = BaseHTTPServer.HTTPServer(('0.0.0.0', 4443), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='./server.pem', server_side=True)
httpd.serve_forever()
  1. Verify that your scripts can be reached by pointing your browser at https://:4443/dist/scripts/scripts.js (You may need to accept the certificate if you're using a self-signed cert).

Alternative method for hosting oshinko-console extension scripts

  1. Switch to a new project and run the following to serve the extension scripts (from github) via s2i.
oc new-app centos/httpd-24-centos7~https://github.com/radanalyticsio/oshinko-console --context-dir=dist
#optionally specify your server certs as part of the following command
oc create route edge --service oshinko-console 
    1. Verify that your scripts can be reached by pointing your browser at https:///dist/scripts/scripts.js (You may need to accept the certificate if you're using a self-signed cert).