Overview
Tyk is an open-source API management platform that controls, secures, and monitors API traffic. This template deploys a Tyk Gateway workload on Control Plane alongside Redis and Redis Sentinel, which back the gateway’s token, rate-limit, quota, and analytics storage. Your API definitions and policies come from Control Plane secrets you control, and the Gateway Control API key — the credential that creates and revokes every API key on the gateway — comes from an opaque secret you create before installing.This template does not create a GVC. You must deploy it into an existing GVC.
What Gets Created
- Standard Tyk Gateway Workload (
RELEASE_NAME-tyk-api-gateway) — the gateway process, autoscaling betweenminScaleandmaxScalereplicas on CPU. API definitions and policies are mounted from your secrets at startup. - Redis and Redis Sentinel — the Redis template (v3.4.2) is deployed as a subchart, creating a Redis workload, a Sentinel workload, their volume sets, their config and password secrets, and an identity and policy for each (
RELEASE_NAME-redis-identity,RELEASE_NAME-sentinel-identity,RELEASE_NAME-redis-policy,RELEASE_NAME-sentinel-policy). The gateway connects through Sentinel, not to Redis directly. - Identity & Policy — an identity (
RELEASE_NAME-tyk-identity) bound to the gateway withrevealon exactly the secrets it mounts: your admin secret, your API and policy secrets when set, and the bundled Redis and Sentinel password secrets. - No template-created credential secret — the admin API key lives only in the prerequisite secret you create.
Prerequisites
The admin secret must exist before you install, and you will normally want the API and policy secrets too. All are referenced by name only, so none of their contents pass through Helm values or land in the release.1. Admin API Key (Required)
This isTYK_GW_SECRET, the key for the Gateway Control API served under /tyk/* and sent as the X-Tyk-Authorization header. Whoever holds it can create, list, and revoke every API key on the gateway, so generate a strong random value:
adminSecretName to the name you used. The chart refuses to render without it.
2. API Definitions (Optional)
A dictionary secret whose keys are*.json filenames and whose values are Tyk API definitions, mounted at /opt/tyk-gateway/apps. Because the values are multi-line JSON, write a manifest and apply it:
apiSecretName to the name you used.
3. Policies (Optional)
An opaque secret with encodingplain, holding a single JSON object of policies keyed by policy ID, mounted at /opt/tyk-gateway/policies/policies.json:
policySecretName to the name you used, or leave it "" to run with no policies. You can edit both secrets independently after install, as long as their names stay the same.
Installation
To install, follow the instructions for your preferred method:UI
Browse, install, and manage templates visually
CLI
Manage templates from your terminal
Terraform
Declare templates in your Terraform configurations
Pulumi
Declare templates in your Pulumi programs
Configuration
The defaultvalues.yaml for this template:
API Definitions and Policies
apiSecretName— name of the dictionary secret holding your API definitions. Each key is a JSON filename mounted at/opt/tyk-gateway/apps. Set to""to omit the mount — but see the demo-API warning in Prerequisites.policySecretName— name of the opaque secret holding your policies JSON, mounted at/opt/tyk-gateway/policies/policies.json. Set to""to run with no policies.listenPort— the port the gateway listens on. Control Plane reserves a set of container ports; the chart refuses to render on one of them rather than letting the workload be rejected at apply time.
/tyk/reload for the change to take effect.
Master Keys
allowMasterKeys— whentrue, a key created through/tyk/keyswith noaccess_rightssection can call every API on this gateway. Defaults tofalse, matching upstream Tyk.
Access
externalAccess— whentrue, the gateway’s external inbound firewall opens to0.0.0.0/0and Control Plane assigns a*.cpln.appcanonical endpoint. Defaults tofalse.internalAccess.type— which workloads inside Control Plane may reach the gateway. Defaults tosame-gvc.internalAccess.workloads— list of workload links, used only whentypeisworkload-list.
Setting
externalAccess: false together with internalAccess.type: none would leave nothing able to reach the gateway, so the chart fails the render with a message naming both knobs instead of installing something unreachable.An access change takes up to a couple of minutes to take effect. Enabling external access was measured at 30 seconds from upgrade to the first 200, and closing internal access at about 32 seconds; re-poll before concluding a knob did nothing. Note that a request blocked by the internal firewall times out rather than returning 403 — a hang is what a correctly closed internal firewall looks like here, not a sign that the gateway is down.Resources and Autoscaling
resources.cpu/resources.memory— CPU and memory allocated to the gateway workload.autoscaling.minScale/autoscaling.maxScale— minimum and maximum number of gateway replicas.autoscaling.metric— scaling metric (cpuby default).autoscaling.target— target metric value that triggers a scale-up.autoscaling.scaleToZeroDelay— seconds of inactivity before scaling to zero (only applies whenminScaleis0).multiZone— whentrue, spreads replicas across availability zones within the location.
Redis and Sentinel
The bundled Redis is configured under theredis key; see the Redis template for full configuration details.
redis.redis.replicas— number of Redis replicas.redis.sentinel.replicas— number of Sentinel replicas; 3 is the default and the recommended minimum for failover.redis.redis.persistence.enabled/redis.sentinel.persistence.enabled— persist data and Sentinel state to volume sets.redis.redis.auth.password.value/redis.sentinel.auth.password.value— the Redis and Sentinel passwords.
change-me-… placeholders before installing.
Outbound Connectivity
The gateway ships with an empty outbound firewall (outboundAllowCIDR: []), so it cannot open connections to the public internet.
Connecting
Reveal the admin key when you need it:
Ports
Upgrading From 1.2.1 or Earlier
What to do before upgrading:
1
Create the admin key secret
The gateway will not start without it. Use a freshly generated value rather than carrying Set
mysecret forward — it has been published in a public repository for the life of the earlier versions, and any key minted with it should be considered compromised:adminSecretName to that name and remove adminSecret from your values — it no longer exists in the chart. Every client calling /tyk/* needs the new value in its X-Tyk-Authorization header.2
Decide whether the gateway should stay public
If clients outside Control Plane call your APIs, set
externalAccess: true explicitly — and understand that this also republishes /tyk/*. If every caller is inside the GVC, do nothing and the default same-gvc covers them.3
Audit any key created without access rights
Under the old hardcoded setting, such keys reach every API on the gateway. List them with
GET /tyk/keys, then reissue each one with an access_rights entry naming only the APIs it needs. Requests that create bare keys now fail — see Master Keys for the exact responses.4
Set the Redis and Sentinel passwords
The placeholder defaults are used verbatim if you leave them, so set both
redis.redis.auth.password.value and redis.sentinel.auth.password.value to values of your own.Important Notes
- Create the admin secret before installing. A missing secret does not fail the install — Helm reports success and the gateway then sits at zero replicas with no container logs at all.
externalAccess: truepublishes the admin API, because/tyk/*shares the listener with your proxied APIs. The admin secret is then the only control in front of key creation and revocation.allowMasterKeys: truegrants blanket access. Any key created withoutaccess_rightsreaches every API on the gateway. Leave itfalseunless you have a specific reason.- Leaving
apiSecretNameempty serves Tyk’s demo API, not an empty gateway. The install looks healthy while none of your APIs are loaded. - Egress is closed, so every
target_urlmust resolve to an in-GVC*.cpln.localhost. - Change the bundled Redis and Sentinel passwords — they ship as
change-me-…placeholders and are used exactly as written. - The gateway declares no health probes, so
ready: truearrives before it can serve. A workload was ready roughly 30 seconds before it had connected to Redis, loggingstorage: Redis is either down or was not configuredin between. UseGET /helloand check thatredisreportspassrather than trusting the readiness signal, and expect the same gap when an autoscaled replica starts. - Access changes take up to a couple of minutes to propagate. A change that appears to do nothing has usually just not settled yet.
- The first
helm upgradeafter an install restarts the bundled Redis, briefly interrupting rate-limit and key lookups even when nothing changed. Later no-op upgrades do not. - The prerequisite secrets are not owned by the release — your admin, API, and policy secrets survive
cpln helm uninstalland must be deleted manually if you no longer need them.
External References
Tyk Gateway Documentation
Official Tyk API Gateway documentation
Gateway Configuration Options
Every gateway setting and its environment-variable name
Gateway Control API
Reference for the admin endpoints under /tyk/
API Definition Objects
Reference for the API definition JSON structure
Security Policies
Guide for configuring Tyk access policies
Tyk Template
View the source files, default values, and chart definition