Merge pull request #990 from openziti/qrkourier-patch-1

update local dev tutorial
This commit is contained in:
Ken Bingham
2023-02-06 10:46:03 -05:00
committed by GitHub
3 changed files with 28 additions and 44 deletions
+14 -30
View File
@@ -7,56 +7,40 @@ This local development README guides you to install the Ziti stack built from th
You will need to [install a version of Go](https://go.dev/) that is as recent as the version used by this project. Find the current minimum version by running this command to inspect `go.mod`.
```bash
grep -Po '^go\s+\K\d+\.\d+$' go.mod
grep -Po '^go\s+\K\d+\.\d+(\.\d+)?$' go.mod
```
## Build and Install All Applications
This repo contains several Go applications. The easiest way to build and install all to `${GOPATH}/bin` is:
This repo contains several Go applications, e.g. ziti-controller, ziti-router. These applications were reorganized as subcommands of the `ziti` CLI application, so it's no longer necessary to build the discrete binaries. Only the `ziti` CLI is necessary. The easiest way to build and install `ziti` in `${GOPATH}/bin` is:
```bash
# build and install all apps
go install ./...
# build and install ziti CLI
go install ./ziti
```
If you add `${GOPATH}/bin` to your executable search `${PATH}` then you may immediately run the newly-built binaries. For example,
```bash
$ ziti-controller version
v0.0.0
$ ziti version
NAME VERSION
ziti v0.0.0
ziti-controller not installed
ziti-prox-c not installed
ziti-router not installed
ziti-tunnel not installed
ziti-edge-tunnel v0.20.18-local
```
The remainder of this article will assume you have installed all apps to be available in your `PATH`.
## Build Applications Individually
### `ziti` CLI
## Build ziti CLI
```bash
# build the binary without installing in GOPATH
go build -o ./build/ziti ./ziti/cmd/ziti/
go build -o ./build/ziti ./ziti/
# execute the binary
./build/ziti version
```
### `ziti-controller`
```bash
# build the binary without installing in GOPATH
go build -o ./build/ziti-controller ./ziti-controller/
# execute the binary
./build/ziti-controller version
```
### `ziti-router`
```bash
# build the binary without installing in GOPATH
go build -o ./build/ziti-router ./ziti-router/
# execute the binary
./build/ziti-router version
```
## Run a Local Ziti Stack
Let's get a local Ziti stack up and running now that you have built and installed all the Ziti apps in this repo.
+7 -7
View File
@@ -6,15 +6,15 @@ be found in your shell's executable search `PATH`.
You will configure and run:
- `ziti-controller` with the provided demo certificate authority in `./etc/ca`
- `ziti-router` as an edge router
- `ziti controller` with the provided demo certificate authority in `./etc/ca`
- `ziti router` as an edge router
## A Note About Windows
These commands require a running BASH shell. Windows users will need to use WSL, [cygwin](https://www.cygwin.com/), a Linux virtual machine, or some other environment that supports BASH. The easiest
thing might just be to use the shell that comes with [git bashfor windows](https://gitforwindows.org/). WSL is maturing more and more: [Mintty and WSL](https://github.com/mintty/wsltty).
Also note that commands for `ziti`, `ziti-controller`, and `ziti-router` may need to have the `.exe` suffix appended to the example commands.
Also note that the `ziti` command may need to have the `.exe` suffix appended to the example commands.
## Initialize the Environment
@@ -47,7 +47,7 @@ ZITI_SIGNING_KEY=./etc/ca/intermediate/private/intermediate.key.decrypted.pem \
```
```bash
ziti-controller edge init ./db/ctrl-config.yml -u ADMIN_NAME -p ADMIN_PW
ziti controller edge init ./db/ctrl-config.yml -u ADMIN_NAME -p ADMIN_PW
```
## Run the Controller
@@ -55,7 +55,7 @@ ziti-controller edge init ./db/ctrl-config.yml -u ADMIN_NAME -p ADMIN_PW
Edge SDKs will connect to the running controller to authenticate and request a session. Leave the controller running in a terminal so that you may inspect the log messages.
```bash
ziti-controller run ./db/ctrl-config.yml
ziti controller run ./db/ctrl-config.yml
```
## Login to the Controller
@@ -92,7 +92,7 @@ ZITI_EDGE_ROUTER_RAWNAME=localhost \
Enroll router01 by presenting the token to the controller to receive a certificate in the filesystem location specified in the configuration file.
```bash
ziti-router enroll --jwt /tmp/router01.jwt ./db/router01-config.yml
ziti router enroll --jwt /tmp/router01.jwt ./db/router01-config.yml
```
## Run the Edge Router
@@ -101,7 +101,7 @@ Edge SDKs will connect to the running edge router to connect to services. Leave
terminal.
```bash
ziti-router run ./db/router01-config.yml
ziti router run ./db/router01-config.yml
```
## Create Your First Service
+7 -7
View File
@@ -19,7 +19,7 @@ router egress. The full connection will be:
These commands require a running BASH shell. Windows users will need to use WSL, [cygwin](https://www.cygwin.com/), a Linux virtual machine, or some other environment that supports BASH. The easiest thing might just be to use the shell that comes with [git bashfor windows](https://gitforwindows.org/). WSL is maturing more and more: [Mintty and WSL](https://github.com/mintty/wsltty).
Also note that commands for `ziti`, `ziti-controller`, and `ziti-router` may need to have the `.exe` suffix appended to the example commands.
Also note that the `ziti`command may need to have the `.exe` suffix appended to the example commands.
## Hosts File
@@ -213,10 +213,10 @@ The following steps outline how to configure and start the Ziti Controller.
```bash
# if needed, initialize the controller
ziti-controller edge init $ZITI_HOME/controller.yaml -u admin -p admin
ziti controller edge init $ZITI_HOME/controller.yaml -u admin -p admin
# run the controller
ziti-controller run $ZITI_HOME/controller.yaml
ziti controller run $ZITI_HOME/controller.yaml
```
Note that running this command will commandeer your current terminal. Use `screen` or multiple terminals by using
@@ -329,7 +329,7 @@ to connect to and control the fabric.
1. Start the router:
```bash
ziti-router run $ZITI_HOME/r01.yaml
ziti router run $ZITI_HOME/r01.yaml
```
Note that running this command will commandeer your current terminal. Use `screen` or multiple terminals by using
@@ -339,7 +339,7 @@ to connect to and control the fabric.
A Ziti Edge Router allows the Ziti SDK to ingress to a Ziti overlay network. A Ziti Edge Router is a Ziti Router that has the `edge`
section of the configuration defined and has gone through the Edge Router Enrollment process instead of the Ziti Router
enrollment process. Ziti Edge Routers and Ziti Routers are run from the same binary `ziti-router`.
enrollment process. Ziti Edge Routers and Ziti Routers are run from the same binary `ziti router`.
Ensure that the `env` file is sourced if you are using a new terminal.
@@ -401,13 +401,13 @@ Ensure that the `env` file is sourced if you are using a new terminal.
1. Complete the enrollment process with the controller
```bash
ziti-router enroll $ZITI_HOME/er01.yaml --jwt $ZITI_HOME/er01.jwt
ziti router enroll $ZITI_HOME/er01.yaml --jwt $ZITI_HOME/er01.jwt
```
1. Start the edge router:
```bash
ziti-router run $ZITI_HOME/er01.yaml
ziti router run $ZITI_HOME/er01.yaml
```
Note that running this command will commandeer your current terminal. Use `screen` or multiple terminals by using