diff --git a/changelogs/CHANGELOG.0.30.md b/changelogs/CHANGELOG.0.30.md index 31f5384d5..1ad35f644 100644 --- a/changelogs/CHANGELOG.0.30.md +++ b/changelogs/CHANGELOG.0.30.md @@ -43,7 +43,7 @@ Currently only HTTP Connect proxies which don't require authentication are suppo not create the usual edge router/service edge router policy. * [Issue #1397](https://github.com/openziti/ziti/issues/1397) - HTTP Proxy support for host.v1/host.v2 config types * [Issue #1423](https://github.com/openziti/ziti/issues/1423) - Controller crashes when edge router reconnects (Client Hello) - * [Issue #1414](https://github.com/openziti/ziti/issues/1414) - Race condition in xgress_edge_tunnel tunneller at start but not seen in pre-compiled binary + * [Issue #1414](https://github.com/openziti/ziti/issues/1414) - Race condition in xgress_edge_tunnel tunneler at start but not seen in pre-compiled binary * [Issue #1406](https://github.com/openziti/ziti/issues/1406) - Entity change event dispatcher isn't shutting down properly when controller shuts down * [Issue #1382](https://github.com/openziti/ziti/issues/1382) - service failure costs are not shrinking over time diff --git a/dist/docker-images/ziti-controller/.env b/dist/docker-images/ziti-controller/.env new file mode 100644 index 000000000..a26307e74 --- /dev/null +++ b/dist/docker-images/ziti-controller/.env @@ -0,0 +1,2 @@ +ZITI_PWD=admin +ZITI_CTRL_ADVERTISED_ADDRESS=ctrl.127.0.0.1.sslip.io diff --git a/dist/docker-images/ziti-controller/compose.override.yml b/dist/docker-images/ziti-controller/compose.override.yml new file mode 100644 index 000000000..b15aabc00 --- /dev/null +++ b/dist/docker-images/ziti-controller/compose.override.yml @@ -0,0 +1,3 @@ +services: + ziti-controller: + network_mode: host diff --git a/dist/docker-images/ziti-router/.env b/dist/docker-images/ziti-router/.env new file mode 100644 index 000000000..aa610dbc1 --- /dev/null +++ b/dist/docker-images/ziti-router/.env @@ -0,0 +1,3 @@ +ZITI_ENROLL_TOKEN=eyJhbGciOiJSUzI1NiIsImtpZCI6IjUyN2UwYzMwZjgyYTMwMmFmNzMzMDFiZmQwYjY5YjU4NTRlOTdmZmEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2N0cmwuMTI3LjAuMC4xLnNzbGlwLmlvOjEyODAiLCJzdWIiOiJ0ZVRaa0NZcjB4IiwiYXVkIjpbIiJdLCJleHAiOjE3MTI5NDkwMzEsImp0aSI6IjVkYjAyNzg3LThiYjYtNGI3Ny05ODdiLWUzYTUxNDRjMTBkMSIsImVtIjoiZXJvdHQiLCJjdHJscyI6bnVsbH0.ch5Dp-IVmqmn4u9OtILVaeDBvEeURU8Nh0KRXK_Z8ELwgu7yQO29s2zULHtj5AAVdl6tGkyln3UaUw2rnl-TcjSbRQ2NHDw4fcpLsHEuVZn648ppuDG0UosQJYJX8FSuvCxuUVot7mUaRXgqYbrdPfX8norOJp8f-ZG14i8MOZjR8JH2E1Ye__swH_BZCZ2QJxmaI8-TyCtzS6shbrIv2xWIG_2lscB3_9JGqcFk5f_jNrn0Dc2mXrMwF8xzeoo-erM_DyqTmq63X73fHIZKKZtJGOR58E-1QF77255hcGs7NrhSAl3EPWpYh-mMg9Y13vViT_ann_KFIpiHntKnPwQptmATjrAMhlAsHu0ZOlM1mV0divxJIznBsgr8ESeefWoXWMquctRdiM3l1-7tD37wtlbwGT36azt3ezZkbnjnu9NREZCFRvAyZ_lFrByKv2k7pZrxGrby4pbqeE-1hI1PZabpGiwpa4DK2BPmiUMFQnN557ZzvJXCRn6ucF2h5keLN6sfg0gRSUP32jVZbbJBLGTbmAxpPzLsvo6CPRAtuAoS1vt7E9teSPCiCsfYsm8KRqXhoEHVjqMFexdtIVpWjpKiwToxlP9tXKgqCEVFXRc0b0OM6N3OIuQSJMWocwFIH8JKiXC9_CG9_ZK9kd1XGVRdwCDpUC0pUsA2fg0 +ZITI_CTRL_ADVERTISED_ADDRESS=ctrl.127.0.0.1.sslip.io +ZITI_ROUTER_ADVERTISED_ADDRESS=router1.127.0.0.1.sslip.io diff --git a/doc/001-overview.md b/doc/001-overview.md index ab88fce7c..1bf23faf1 100644 --- a/doc/001-overview.md +++ b/doc/001-overview.md @@ -49,7 +49,7 @@ Below is an outline of all the applications that are generated from this reposit The following binaries are used to deploy long running servers that route traffic and manage the configuration of a Ziti environment. -| Command | Description| +| Subcommand | Description| |-------------------| -----------| | ziti controller | Runs a central server necessary for Ziti environments| | ziti router | Runs a server capable of ingress'ing and egress'ing Ziti traffic standalone or as a mesh| @@ -58,7 +58,7 @@ configuration of a Ziti environment. The following commands provide utility or testing functionality. -| Command | Description| +| Subcommand | Description| |-------------------| -----------| | ziti edge enroll | Provides enrollment processing features for executables that do not directly support enrollment| | ziti fabric inspect | Observe Ziti Fabric runtime values | @@ -67,7 +67,7 @@ The following commands provide utility or testing functionality. The following binaries are used to configure and manage a Ziti environment via command line interactions. -| Command | Description| +| Subcommand | Description| |-------------------| -----------| | ziti fabric | Provides command line access to Ziti Fabric management features| | ziti edge | Provides command line access to Ziti management features| @@ -78,7 +78,7 @@ The following binaries are Ziti endpoint clients which have the Ziti SDK built i edge router. Endpoint clients can be application specific or act as a bridge to other applications, hosts, or underlay networks. -| Command | Description| +| Subcommand | Description| |-------------------| -----------| | ziti tunnel | Provides the ability to intercept traffic to route traffic across Ziti| diff --git a/doc/002-local-dev.md b/doc/002-local-dev.md index 25782443f..a4aa1fe0d 100644 --- a/doc/002-local-dev.md +++ b/doc/002-local-dev.md @@ -26,16 +26,6 @@ $ ziti version v0.0.0 ``` -## Save Build Artifact Elsewhere - -```bash -# build the binary without installing in GOPATH -go build -o ./build/ziti ./ziti/ - -# execute the binary -./build/ziti 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. diff --git a/quickstart/README.md b/quickstart/README.md index 156f1b73f..d7956bc3b 100644 --- a/quickstart/README.md +++ b/quickstart/README.md @@ -1,141 +1,3 @@ # Quickstart -This directory contains a set of scripts designed to make it easy to establish a starter overlay network. -The expectation is that these scripts and docker image are useful for learning or for establishing -simple networks. As with any solution it is common for additional changes to the configuration to be required -after expanding beyond the initial setup. - -There are three different modes contained in these folders. One mode allows you very quickly get setup and -run the two main components of a OpenZiti network: ziti-controller and ziti-router. The [Express](#express) -configuration will guide you here. - -The remaining two modes all use [docker](https://docs.docker.com/get-started/) to establish environments. -The first of the docker-based quickstarts uses [docker-compose](https://docs.docker.com/compose/). -You will find a fully defined OpenZiti Network in a compose file which should allow you to understand better -and learn how multiple routers can be linked to form a mesh network or serve as an initial -template to build your own compose file. - -Lastly, you can choose to run [docker](https://docs.docker.com/get-started/) directly. This mode is necessarily -more verbose but should you prefer to not use docker-compose it can also illustrate how to establish -an OpenZiti Network piece by piece. - -## Prerequisites - -### Bash - -All of these quickstarts will use bash. On MacOS/Linux this will be natural however on Windows you'll want -to ensure you have a suitable shell. There are numerous shells available but perhaps the simplest will be -to use [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install-win10). You -might also use git-bash, Cygwin, or any other bash shell you fancy. - -### Docker/Docker Compose - -If you are interested in using the quickstarts which use docker/docker-compose you will clearly need to -have one or both installed and be moderately familiar with whichever you are using. - -### Review All Scripts - -Remember - it's always a good idea to review any scripts before you run them. We encourage you to review -the scripts in these folders before running them. - -## Express - -By far the easiest way to establish an environment quickly is to simply run the express install script -found at [./quickstart/docker/image/ziti-cli-functions.sh](). - -### What It Does - -The express install script will do quite a few things to get you bootstrapped. It will: - -1. create a full suite of configuration files located by default at ~/.ziti/quickstart/$(hostname) - 1. create a full suite of PKI - 1. create a config file for the controller - 1. create a config file for an edge router -1. download the latest distribution of Ziti from github.com/openziti/ziti/releases -1. unzip the distribution -1. start the controller and router in the background -1. expose the controller on https://$(hostname):1280 - -## Docker - Compose - -The [docker-compose](https://docs.docker.com/compose/) based example will create numerous `ziti-router`s -as well as spooling up a `ziti-controller` and expose the controller on port 1280. This configuration is intended to -look and feel like the following image: -![image info](./docker-compose-nw.svg) - -Here, a simple OpenZiti Network is shown which contains two public OpenZiti Edge Routers, one router without the "edge" enabled -and usable only for transit, and two private edge routers: one blue, one red. The goal with this setup is to attempt to -have a single isolated service that is not accessible from outside of the blue network (as best as possible with -only docker). - -## Docker - No Compose - -You can still start up a dev environment easily with [docker](https://docs.docker.com/get-started/) only. In this example, -you will start an OpenZiti Controller as well as a single OpenZiti Edge Router. - -### Prerequisite - -The Docker containers must be able to communicate with one another. This is accomplished using a Docker network and -setting the alias of the container on that Docker network. - -Before running the commands below please do the following: - - #declare a variable that defines the 'network' - zitinw="myZitiNetwork" - - #declare a fully qualified path to the location that you want your shared files to go and create it - zitinw_shared="${HOME}/.ziti/dockerenvs/${zitinw}" - mkdir -p "${zitinw_shared}" - - #make a docker network for isolation while allowing the parts to be able to interact - docker network create "$zitinw" - -### Starting the Containers - -To start the containers you can simply run these two commands in two different shells. (or choose to daemonize them -once you're ready to do so). Take special note of the initial variables used in these commands. The ${zitinw} variable -is expected to be set. See the Prerequisite section above: - -OpenZiti Controller: - - docker run -d --name "${zitinw}-controller" --volume "${zitinw_shared}":/openziti/shared -it --network="${zitinw}" --network-alias=ziti-controller --network-alias=ziti-edge-controller --rm openziti/quickstart /openziti/scripts/run-controller.sh - -OpenZiti Edge Router: - - routerName=edge-router; docker run -d --name "${zitinw}-${routerName}" --rm -e ZITI_ROUTER_NAME="${routerName}" --volume "${zitinw_shared}":/openziti/shared -it --network="${zitinw}" --hostname "${routerName}" --network-alias="${routerName}" --rm openziti/quickstart /openziti/scripts/run-router.sh edge - -## Releasing a new version of the Quickstart - -### Artifacts Produced by a Release - -The enclosing project's GitHub releases are never updated and no Git tags are created for a quickstart release. - -1. `openziti/quickstart` container image [in Docker Hub](https://hub.docker.com/r/openziti/quickstart) -1. a CloudFront Function in AWS pointing the `get.openziti.io` reverse proxy to the GitHub SHA of the release - -### Release Process - -A quickstart release is created when either of the following conditions are met: - -1. OpenZiti, the enclosing project, is released by the OpenZiti team -1. A pull request is merged into the trunk branch `release-next` with the label `quickstartrelease` - -### Release Machinery - -The release process is encoded in [a GitHub workflow](../.github/workflows/release-quickstart.yml). - -### GitHub Raw Reverse Proxy - -The `get.openziti.io` reverse proxy is a CloudFront distribution that points to a CloudFront Function and serves as a -shorter HTTP URL getter for raw GitHub source files, e.g. `https://get.openziti.io/dock/simplified-docker-compose.yml`. -The CloudFront Function is a JavaScript function that looks at the URI path of the incoming request and forwards it to -the appropriate GitHub raw download path. The CloudFront Function is updated by the release process, and the CloudFront -Distribution itself is hand-maintained in the AWS Console. The Distribution has these characteristics: - -* Viewer Domain Name: `get.openziti.io` (frontend) -* Route Origin: `raw.githubusercontent.com` (backend, upstream) -* Auto-renewing TLS certificate from ACM -* Cache Policy `CachingOptimized` (default) -* Routes to Origin based on Javascript Function deployed by quickstart release - -You can add or change a GitHub raw shortcut route by modifying the [routes.yml](../dist/cloudfront/get.openziti.io/routes.yml) file. +The Ziti quickstart documentation is here: [Ziti Network Quickstarts](https://openziti.io/docs/category/network).