Skip to content

Commit

Permalink
updated instructions for running against OpenShift
Browse files Browse the repository at this point in the history
  • Loading branch information
Alec Merdler committed Feb 23, 2018
1 parent 20d27da commit c07d138
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ Backend binaries are output to `/bin`.

### Configure the application

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

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

```
source ./contrib/environment.sh
Expand All @@ -73,6 +75,18 @@ kubectl describe secrets/<secret-id-obtained-previously>

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

#### OpenShift

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

```
oc login -u system:admin
oc adm policy --as system:admin add-cluster-role-to-user cluster-admin developer
oc login -u developer
source ./contrib/oc-environment.sh
./bin/bridge
```

## Docker

The `builder-run` script will run any command from a docker container to ensure a consistent build environment.
Expand Down
26 changes: 26 additions & 0 deletions contrib/oc-environment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This file is an example of how you might set up your environment to
# run the tectonic console against OpenShift during development. To use it for running
# bridge, do
#
# . contrib/oc-environment.sh
# ./bin/bridge
#

# You'll need a working kubectl, working oc logged in as cluster-admin role, and you'll need jq installed and in
# your path for this script to work correctly.

# The environment variables beginning with "BRIDGE_" act just like
# bridge command line arguments - in fact. to get more information
# about any of them, you can run ./bin/bridge --help

export BRIDGE_USER_AUTH="disabled"
export BRIDGE_K8S_MODE="off-cluster"
BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT=$(kubectl config view -o json | jq '{myctx: .["current-context"], ctxs: .contexts[], clusters: .clusters[]}' | jq 'select(.myctx == .ctxs.name)' | jq 'select(.ctxs.context.cluster == .clusters.name)' | jq '.clusters.cluster.server' -r)
export BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT
export BRIDGE_K8S_MODE_OFF_CLUSTER_SKIP_VERIFY_TLS=true
export BRIDGE_K8S_AUTH="bearer-token"

BRIDGE_K8S_AUTH_BEARER_TOKEN=$(oc whoami --show-token)
export BRIDGE_K8S_AUTH_BEARER_TOKEN

echo "Using $BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT"

0 comments on commit c07d138

Please sign in to comment.