linkerd2/web
Phil Calçado e328db7e87
Adds conduit-api check for status command (#140)
* Abstract Conduit API client from protobuf interface to add new features

Signed-off-by: Phil Calcado <phil@buoyant.io>

* Consolidate mock api clients

Signed-off-by: Phil Calcado <phil@buoyant.io>

* Add simple implementation of healthcheck for conduit api

Signed-off-by: Phil Calcado <phil@buoyant.io>

* Change NextSteps to FriendlyMessageToUser

Signed-off-by: Phil Calcado <phil@buoyant.io>

* Add grpc check for status on the client

Signed-off-by: Phil Calcado <phil@buoyant.io>

* Add simple server-side check for Conduit API

Signed-off-by: Phil Calcado <phil@buoyant.io>

* Fix feedback from PR

Signed-off-by: Phil Calcado <phil@buoyant.io>
2018-01-12 15:35:22 -05:00
..
app add ability to add flash to latest datapoint on line graph. (#127) 2018-01-12 09:58:36 -08:00
srv Adds conduit-api check for status command (#140) 2018-01-12 15:35:22 -05:00
templates Remove namespace property from the Conduit web app (#10) 2017-12-08 15:38:04 -08:00
util/filesonly Introducing Conduit, the ultralight service mesh 2017-12-05 00:24:55 +00:00
Dockerfile Upgrade k8s.io/client-go to v6.0.0 (#122) 2018-01-11 10:22:37 -08:00
README.md Add instructions to run web locally (#114) 2018-01-05 15:52:37 -08:00
main.go Fix web and public-api log info messages. (#129) 2018-01-09 16:14:56 -08:00

README.md

Conduit Dashboard

This is a React app. It uses webpack to bundle assets, and postcss to transform css.

The commands below assume that you're starting from the root of the repo.

First time setup

Install yarn and use it to install dependencies.

brew install yarn
cd web/app
yarn

Development

After pulling master:

If you just want to run the frontend:

cd web/app
yarn
yarn webpack
cd ..
go run main.go

The web server will be running on localhost:8084.

Note the web process depends on a public-api server, for which you have three options:

  1. Boot public-api locally

    go run ../controller/cmd/public-api/main.go
    
  2. Connect to public-api in docker-compose (see below)

  3. Connect to public-api in Kubernetes (see below)

To develop with a webpack dev server, start the server in a separate window:

cd web/app
yarn webpack-dev-server

And then set the -webpack-dev-server flag when running the web server:

go run main.go -webpack-dev-server=http://localhost:8080

To add a JS dependency:

cd web/app
yarn add [dep]

Run docker-compose

You can also run all of the go apps in a docker-compose environment.

From the root of the repo, run:

docker-compose build
docker-compose up -d

If you want to develop on the web service locally, stop it first, then run it locally and set the -api-addr flag to the address of the public API server that's running in your docker environment:

docker-compose stop web
cd web
go run main.go -api-addr=localhost:8085 # where localhost is the Docker address

Run Web against a public API server in Kubernetes

If you are running the public API server in Kubernetes, forward localhost:8085 to the conduit controller pod:

POD_NAME=$(kubectl --namespace=conduit get po --selector=app=controller -o jsonpath='{.items[*].metadata.name}')
kubectl -n conduit port-forward $POD_NAME 8085:8085

Then connect the local web process to the forwarded port:

cd web
go run main.go -api-addr=localhost:8085

Testing

Golang unit tests

To run:

go test ./...

JS unit tests

To run:

cd web/app
yarn karma start