Skip to content

atiratree/console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bridge

The Tectonic Console

quay.io/coreos/tectonic-console

Bridge consists of a frontend webapp and a backend service which serves the following purposes:

  • Proxy the Kubernetes API
  • Provide additional non-Kubernetes APIs for interacting with the cluster
  • Serve all frontend static assets
  • User Authentication (TBD)

Quickstart

Deps:

  1. nodejs >= 4.3
  2. npm >= 2 (probably installed with node)
  3. go >= 1.6

Build everything:

./build

Backend binaries are output to /bin.

Configure the application to run

If you've got a working kubectl on your path, you can run the application with

source ./contrib/environment.sh
./bin/bridge

The script in contrib/environment.sh sets sensible defaults in the environment, and uses kubectl to query your cluster for endpoint and authentication information.

To configure the application to run by hand, (or if enironment.sh doesn't work for some reason) you can manually provide a Kubernetes bearer token with the following steps.

First get the secret ID that has a type of kubernetes.io/service-account-token by running:

kubectl get secrets

then get the secret contents:

kubectl describe secrets/<secret-id-obtained-previously>

Use this token value to set the BRIDGE_K8S_BEARER_TOKEN environment variable when running Bridge.

Docker

The builder-run script will run any command from a docker container to ensure a consistent build environment. For example to build with docker run:

./builder-run ./build

The docker image used by builder-run is itself built and pushed by the script push-builder, which uses the file Dockerfile-builder to define an image. To update the builder-run build environment, first make your changes to Dockerfile-builder, then run push-builder, and then update the BUILDER_VERSION variable in builder-run to point to your new image. Our practice is to manually tag images builder images in the form Builder-v$SEMVER once we're happy with the state of the push.

Compile, Build, & Push Docker Image

Build a docker image, tag it with the current git sha, and pushes it to the quay.io/coreos/tectonic-console repo.

Must set env vars DOCKER_USER and DOCKER_PASSWORD or have a valid .dockercfg file.

./build-docker-push

Hacking

Project Dependencies

go, godep, nodejs, gulp

Frontend

For interactive frontend development compiling html templates and sass is required. The following build task will watch the source code for changes and compile automatically:

npm run dev

All frontend build tasks are defined in /frontend/gulpfile.js

Tests

Run backend tests:

./test

Run frontend tests:

./test-web

Dependency Management

Add new frontend dependencies:

  1. npm install --save the dependency
  2. commit the altered package.json

Add new backend dependencies:

  1. go get ... as usual
  2. run godep save ./...

Update existing backend dependencies:

  1. go get -u foo/bar as usual
  2. godep update foo/bar

API Schema

If changes are made to the schema/v1.json file you must regenerate the go bindings:

./schema/generator

Packages

No packages published

Languages

  • TypeScript 87.1%
  • JavaScript 5.5%
  • CSS 2.5%
  • Go 2.4%
  • Gherkin 2.3%
  • Shell 0.2%