Skip to content

Commit

Permalink
Merge pull request #31 from TykTechnologies/confs-to-envs
Browse files Browse the repository at this point in the history
Confs to envs
  • Loading branch information
sedkis committed Oct 21, 2021
2 parents 65feae1 + 6d84084 commit e63029b
Show file tree
Hide file tree
Showing 11 changed files with 275 additions and 661 deletions.
41 changes: 14 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,34 @@
# This demo is NOT designed for production use or performance testing
Tyk API Gateway is fully on-premise solution, which include gateway, dashboard and analytics processing pipeline.
This demo will run Tyk On-premise on your machine, which contains 5 containers: Tyk Gateway, Tyk Dashboard, Tyk Pump, Redis and Mongodb.
This repo great for proof of concept and demo purpose, but if you want test performance, you need to move each component to separate machine, following our documentation https://tyk.io/docs/.

# Tyk Pro Demo using Docker

This compose file is designed to provide a quick, simple demo of the Tyk stack, this includes the gateway, the dashboard and the portal.

## Step 1: Map hostnames to IP addresses

Set up your `/etc/hosts` file to include the IP of your docker daemon:

```
127.0.0.1 www.tyk-portal-test.com
127.0.0.1 www.tyk-test.com
```
This compose file is designed to provide a quick, simple demo of the Tyk stack, this includes Tyk Gateway, Tyk Dashboard, Tyk Portal, Mongo, & Redis.

Note that the IP may be different depending on your installation, Windows users may find it running on `10.x.x.x`, it is important the URL stays the same because our `setup.sh` assumes this is the one you are using.
This repo great for proof of concept and demo purpose, but if you want test performance, you need to move each component to separate machine, following our documentation https://tyk.io/docs/.

## Step 2: Add your dashboard license
## Step 1: Add your dashboard license

Open the `tyk_analytics.conf` file in the `confs/` folder and add your license string to the `"license_key": ""` section.
Open the `tyk_analytics.env` file in the `confs/` folder and add your license string to the first line.

## Step 3: Initialise the Docker containers
## Step 2: Initialise the Docker containers

Run docker compose:

```
docker-compose up
$ docker-compose up
```

Please note that this command may take a while to complete, as Docker needs to download and provision all of the containers.

This will run in non-daemonised mode so you can see all the output. For the next step, once this step is complete, open a new shell:
This will run in non-daemonised mode so you can see all the output.

## Step 4: Bootstrap the Tyk installation
## Step 3: Bootstrap the Tyk installation

Bootstrap the instance:

Open your browser to http://www.tyk-test.com:3000. You will be presented with the Bootstrap UI to create your first organisation and admin user.
Open your browser to http://localhost:3000. You will be presented with the Bootstrap UI to create your first organisation and admin user.

Note, if you run into DNS issues with `www.tyk-test.com` while trying to bootstrap through the GUI, you will need to set the `host_config.hostname` value in `tyk_analytics.conf` to the public IP of your Docker daemon or simply use `localhost`
## Bringing down

# Tyk Pro Demo using Docker Swarm

Please refer to [docker-swarm.md](docker-swarm.md) for detailed instructions on running this simple deployment on the Docker Swarm with Tyk cluster. Note that in order to have more than one functional gateway node a corresponding license is required.
To delete all containers as well as remove all volumes from your host:
```
$ docker-compose down -v
```
48 changes: 0 additions & 48 deletions confs/pump.conf

This file was deleted.

30 changes: 30 additions & 0 deletions confs/pump.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
TYK_PMP_OMITCONFIGFILE=true

TYK_PMP_ANALYTICSSTORAGETYPE=redis
TYK_PMP_ANALYTICSSTORAGECONFIG_TYPE=redis
TYK_PMP_ANALYTICSSTORAGECONFIG_HOST=tyk-redis
TYK_PMP_ANALYTICSSTORAGECONFIG_PORT=6379
TYK_PMP_ANALYTICSSTORAGECONFIG_HOSTS=
TYK_PMP_ANALYTICSSTORAGECONFIG_USERNAME=
TYK_PMP_ANALYTICSSTORAGECONFIG_PASSWORD=
TYK_PMP_ANALYTICSSTORAGECONFIG_DATABASE=0
TYK_PMP_ANALYTICSSTORAGECONFIG_MAXIDLE=100
TYK_PMP_ANALYTICSSTORAGECONFIG_MAXACTIVE=100
TYK_PMP_ANALYTICSSTORAGECONFIG_ENABLECLUSTER=false
TYK_PMP_PURGEDELAY=2

TYK_PMP_PUMPS_MONGO_TYPE=mongo
TYK_PMP_PUMPS_MONGO_META_COLLECTIONNAME=tyk_analytics
TYK_PMP_PUMPS_MONGO_META_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_PUMPS_MONGO_META_MAXINSERTBATCHSIZEBYTES=80000
TYK_PMP_PUMPS_MONGO_META_MAXDOCUMENTSIZEBYTES=20112

TYK_PMP_PUMPS_MONGOAGG_TYPE=mongo-pump-aggregate
TYK_PMP_PUMPS_MONGOAGG_META_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_PUMPS_MONGOAGG_META_USEMIXEDCOLLECTION=true

TYK_PMP_UPTIMEPUMPCONFIG_COLLECTIONNAME=tyk_uptime_analytics
TYK_PMP_UPTIMEPUMPCONFIG_MONGOURL=mongodb://tyk-mongo:27017/tyk_analytics
TYK_PMP_UPTIMEPUMPCONFIG_MAXINSERTBATCHSIZEBYTES=500000
TYK_PMP_UPTIMEPUMPCONFIG_MAXDOCUMENTSIZEBYTES=200000
TYK_PMP_DONTPURGEUPTIMEDATA=false
171 changes: 0 additions & 171 deletions confs/tyk.conf

This file was deleted.

0 comments on commit e63029b

Please sign in to comment.