Skip to content

Commit

Permalink
fix console script to work with both Linux and MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
alecmerdler committed Sep 5, 2018
1 parent 00aa9b8 commit a5a1050
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,13 @@ This will keep the etcd `ClusterServiceVersion` up to date as new versions becom

Use the OpenShift admin console (compatible with upstream Kubernetes) to interact with and visualize the resources managed by OLM. Create subscriptions, approve install plans, identify Operator-managed resources, and more.

Ensure `$KUBECONFIG` environment variable is set and run:
Ensure `kubectl` is pointing at a cluster and run:

```shell
$ ./scripts/run_console_local.sh
```

Then visit `http://localhost:9000` to view the console
Then visit `http://localhost:9000` to view the console.

**Subscription detail view:**
![screenshot_20180628_165240](https://user-images.githubusercontent.com/11700385/42060125-c3cde42c-7af3-11e8-87ec-e5910a554902.png)
7 changes: 6 additions & 1 deletion scripts/run_console_local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
secretname=$(kubectl get serviceaccount default --namespace=kube-system -o jsonpath='{.secrets[0].name}')
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)

args="--net=host"
if [[ $OSTYPE == darwin* ]]; then
args="-p 9000:9000"
fi

echo "Using $endpoint"
docker run -it -p 9000:9000 \
docker run -it $args \
-e BRIDGE_USER_AUTH="disabled" \
-e BRIDGE_K8S_MODE="off-cluster" \
-e BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT=$endpoint \
Expand Down

0 comments on commit a5a1050

Please sign in to comment.