RequirementsAnsible is required to run the following commands.

Getting Started

  1. clone the tyk-ansible repositry
$ git clone https://github.com/TykTechnologies/tyk-ansible
  1. cd into the directory
$ cd tyk-ansible
  1. Run initialisation script to initialise environment
$ sh scripts/init.sh
  1. Modify hosts.yml file to update ssh variables to your server(s). You can learn more about the hosts file here
  2. Run ansible-playbook to install the following:
  • Redis
  • MongoDB or PostgreSQL
  • Tyk Dashboard
  • Tyk Gateway
  • Tyk Pump
$ ansible-playbook playbook.yaml -t tyk-pro -t redis -t `mongodb` or `pgsql`
You can choose to not install Redis, MongoDB or PostgreSQL by removing the -t redis or -t mongodb or -t pgsql However Redis and MongoDB or PostgreSQL are a requirement and need to be installed for the Tyk Pro installation to run.
For a production environment, we recommend that the Gateway, Dashboard and Pump are installed on separate machines. If installing multiple Gateways, you should install each on a separate machine. See Planning for Production For more details.

Supported Distributions

DistributionVersionSupported
Amazon Linux2
CentOS8
CentOS7
Debian10
Debian9
RHEL8
RHEL7
Ubuntu21
Ubuntu20
Ubuntu18
Ubuntu16

Variables

  • vars/tyk.yaml
VariableDefaultComments
secrets.APISecret352d20ee67be67f6340b4c0605b044b7API secret
secrets.AdminSecret12345Admin secret
redis.hostRedis server host if different than the hosts url
redis.port6379Redis server listening port
redis.passRedis server password
redis.enableClusterfalseEnable if redis is running in cluster mode
redis.storage.database0Redis server database
redis.tlsfalseEnable if redis connection is secured with SSL
mongo.hostMongoDB server host if different than the hosts url
mongo.port27017MongoDB server listening port
mongo.tlsfalseEnable if mongo connection is secured with SSL
pgsql.hostPGSQL server host if different than the hosts url
pgsql.port5432PGSQL server listening port
pgsql.tlsfalseEnable if pgsql connection is secured with SSL
dash.licenseDashboard license
dash.service.hostDashboard server host if different than the hosts url
dash.service.port3000Dashboard server listening port
dash.service.protohttpDashboard server protocol
dash.service.tlsfalseSet to true to enable SSL connections
gateway.service.hostGateway server host if different than the hosts url
gateway.service.port8080Gateway server listening port
gateway.service.protohttpGateway server protocol
gateway.service.tlsfalseSet to true to enable SSL connections
gateway.sharding.enabledfalseSet to true to enable filtering (sharding) of APIs
gateway.sharding.tagsThe tags to use when filtering (sharding) Tyk Gateway nodes. Tags are processed as OR operations. If you include a non-filter tag (e.g. an identifier such as node-id-1, this will become available to your Dashboard analytics)
gateway.rpc.connStringUse this setting to add the URL for your MDCB or load balancer host
gateway.rpc.useSSLtrueSet this option to true to use an SSL RPC connection
gateway.rpc.sslInsecureSkipVerifytrueSet this option to true to allow the certificate validation (certificate chain and hostname) to be skipped. This can be useful if you use a self-signed certificate
gateway.rpc.rpcKeyYour organization ID to connect to the MDCB installation
gateway.rpc.apiKeyThis the API key of a user used to authenticate and authorize the Gateway’s access through MDCB. The user should be a standard Dashboard user with minimal privileges so as to reduce any risk if the user is compromised. The suggested security settings are read for Real-time notifications and the remaining options set to deny
gateway.rpc.groupIdThis is the zone that this instance inhabits, e.g. the cluster/data-center the Gateway lives in. The group ID must be the same across all the Gateways of a data-center/cluster which are also sharing the same Redis instance. This ID should also be unique per cluster (otherwise another Gateway cluster can pick up your keyspace events and your cluster will get zero updates).
  • vars/redis.yaml
VariableDefaultComments
redis_bind_interface0.0.0.0Binding address of Redis
Read more about Redis configuration here.
  • vars/mongodb.yaml
VariableDefaultComments
bind_ip0.0.0.0Binding address of MongoDB
mongodb_version4.4MongoDB version
Read more about MongoDB configuration here.
  • vars/pgsql.yaml
VariableDefaultComments
postgresql_databases[][]Array of DBs to be created
postgresql_databases[].nametyk_analyticsDatabase name
postgresql_users[][]Array of users to be created
postgresql_users[0].namedefaultUser name
postgresql_users[0].passwordtopsecretpasswordUser password
postgresql_global_config_options[][]Postgres service config options
postgresql_global_config_options[1].optionlisten_addressesListen address binding for the service
postgresql_global_config_options[1].value*Default value to listen to all addresses
postgresql_hba_entries[][]Host based authenticaiton list
postgresql_hba_entries[4].typehostEntry type
postgresql_hba_entries[4].databasetyk_analyticsWhich database this entry will give access to
postgresql_hba_entries[4].userdefaultWhat users this gain access from this entry
postgresql_hba_entries[4].address0.0.0.0/0What addresses this gain access from this entry
postgresql_hba_entries[4].auth_methodmd5What authentication method to to use for the users
Read more about PostgreSQL configuration here.