Overview
Tyk is an open-source API gateway that fronts your APIs with authentication, rate limiting, quotas and analytics. This template deploys the open-source Tyk Gateway as a stateless, autoscaling workload whose API definitions and policies come from Control Plane secrets you control, backed by the bundled Redis template running Redis with Sentinel as the token, rate-limit and quota store. There is no dashboard: APIs are defined as JSON files and keys are managed through the Gateway Control API.What Gets Created
Prerequisites
Three secrets are referenced by name, and each one named in your values must exist before you install. Secrets are org-level, so no--gvc flag is involved.
Create the admin API key secret (required)
/tyk/, 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 this name. The chart refuses to render without it.Create the API definitions secret
*.json filenames and whose values are Tyk API definitions, mounted at /opt/tyk-gateway/apps. Each definition’s proxy.target_url points at the upstream it fronts — for a workload in the same GVC, use its fully qualified internal address. Because the values are multi-line JSON, write a manifest:apiSecretName to this name. Setting it to "" omits the mount — but then the gateway serves the demo API baked into the image instead of nothing (see Troubleshooting).Create the policies secret
plain, holding a single JSON object of policies keyed by policy ID, mounted at /opt/tyk-gateway/policies/policies.json:policySecretName to this name, or set it to "" to run with no policies.Choose the Redis and Sentinel passwords
change-me-tyk-redis and change-me-tyk-sentinel and are used exactly as written, so set redis.redis.auth.password.value and redis.sentinel.auth.password.value to values of your own.Installation
Once the secrets exist, install the template into your GVC, naming the secrets and replacing the two password placeholders:-f) over --set for the passwords if you do not want them in your shell history.
UI
CLI
Terraform
Pulumi
Configuration
Image and Port
listenPort is one of the container ports Control Plane reserves.
API Definitions and Policies
Master Keys
false, every key created through /tyk/keys must carry an access_rights entry naming the APIs it may reach. Requests that omit it are refused — see Troubleshooting for the exact responses.
Resources and Autoscaling
Access
externalAccess: false and internalAccess.type: none together, since nothing could reach the gateway. An access change takes up to a few minutes to take effect after an upgrade.
Redis and Sentinel
change-me-… passwords before installing. Keys under redis are passed to the bundled Redis template; see its page for the full set.
Outbound Connectivity
The gateway’s outbound firewall is closed and there is no value to open it. Every API’starget_url must point at an upstream in the same GVC, addressed by its fully qualified internal name — for example http://WORKLOAD_NAME.GVC_NAME.cpln.local:8080, where the port is the upstream workload’s container port. The upstream workload’s own internal firewall must admit the gateway. Proxying to an API on the public internet requires adding outboundAllowCIDR or outboundAllowHostname to the gateway workload yourself.
Connecting
payload):
redis as pass in the /hello response, and /tyk/apis lists the definitions from your API secret.
Operations
Backing Up
The API definitions and policies live only in your own secrets, so keep their manifests in version control. Keys issued through the Gateway Control API, plus rate-limit and quota counters, live in the bundled Redis, whose volume sets take a daily snapshot kept for 7 days. Uninstalling the release deletes those volume sets.Restoring a Backup
Restoring the bundled Redis from a volume-set snapshot has not been verified for this template. If you depend on keys issued through the Gateway Control API, keep a record of them outside the gateway so you can reissue them.Updating API Definitions and Policies
Re-apply the edited manifest, then force a redeployment — a running gateway does not pick up a changed secret on its own:Upgrading from 1.2.1 or Earlier
Version 1.3.0 is a security fix. Versions up to 1.2.1 shipped the Gateway Control API key as thevalues.yaml value mysecret, published the gateway to the internet by default, and hardcoded master keys on — so one guessed word yielded a key to every API.
Create the admin key secret
mysecret was published in a public repository, so treat any key minted under it as compromised and plan to reissue it:adminSecretName to that name and drop adminSecret from your values; it no longer exists in the chart. Every client calling /tyk/ needs the new value.Decide whether the gateway stays public
externalAccess: true explicitly, knowing it also publishes /tyk/. If every caller is inside the GVC, the default same-gvc covers them.Audit keys created without access rights
GET /tyk/keys and reissue each with an access_rights entry naming only the APIs it needs.Set the Redis and Sentinel passwords
redis.redis.auth.password.value and redis.sentinel.auth.password.value to values of your own; the placeholders are used verbatim otherwise.Run the upgrade
-f values.yaml or further --set flags.Scaling and Availability
The gateway is stateless and autoscales betweenautoscaling.minScale and autoscaling.maxScale replicas on CPU; raise minScale to 2 or more to keep a replica serving while another restarts. Redis runs 2 replicas behind 3 Sentinels, which promote a new Redis primary if the current one fails. Set multiZone: true to spread gateway replicas across availability zones where the location supports it.
Troubleshooting
The gateway never starts after install while helm reported success
The gateway never starts after install while helm reported success
cpln helm install succeeded, but RELEASE_NAME-tyk-api-gateway has no running containers and cpln logs returns nothing.Cause: A secret named in adminSecretName, apiSecretName or policySecretName does not exist. The defaults my-tyk-apis and my-tyk-policies count — they must exist unless set to "".Fix: Read the message naming the secret, then create it:cpln workload force-redeployment RELEASE_NAME-tyk-api-gateway --gvc GVC_NAME to skip the wait.The gateway serves Tyk Test API instead of my APIs
The gateway serves Tyk Test API instead of my APIs
/tyk/apis lists Tyk Test API and none of your definitions.Cause: apiSecretName is "", so no definitions are mounted and the gateway falls back to the demo API baked into the upstream image.Fix: Create the API definitions secret, set apiSecretName to its name with cpln helm upgrade, and confirm with GET /tyk/apis.Creating a key returns 400 or 500
Creating a key returns 400 or 500
"access_rights": {} is refused:allowMasterKeys is false, so a key with no access rights is rejected. The gateway log names the reason: Master keys disallowed in configuration, key not added.Fix: Give the key an access_rights entry naming the APIs it may reach. Setting allowMasterKeys: true restores blanket keys and the exposure that comes with them. To see the log line:An API pointing at a public upstream fails
An API pointing at a public upstream fails
target_url is outside Control Plane fail, while APIs pointing at workloads in the GVC work.Cause: The gateway’s outbound firewall is closed.Fix: Point target_url at an in-GVC upstream using its fully qualified .GVC_NAME.cpln.local name, or add outboundAllowCIDR or outboundAllowHostname to the gateway workload yourself.Another workload cannot reach the gateway
Another workload cannot reach the gateway
internalAccess.type can reach it.Fix: Widen internalAccess.type, or add the caller to internalAccess.workloads with type: workload-list, then allow a few minutes for the change to take effect.An edited API definition or policy has no effect
An edited API definition or policy has no effect
The workload is ready but requests fail just after start
The workload is ready but requests fail just after start
/hello does not yet report redis as pass and the log shows storage: Redis is either down or was not configured.Cause: The gateway declares no health probes, so ready means the container started, not that it has connected to Redis.Fix: Wait and re-check GET /hello. Expect the same short gap whenever an autoscaled replica starts.Important Notes
- Create the prerequisite secrets before installing, including
apiSecretNameandpolicySecretNameunless you set them to"". - Leave
externalAccessoff unless you need it — enabling it also publishes the Gateway Control API under/tyk/. - Leave
allowMasterKeysoff — with it on, any key created withoutaccess_rightsreaches every API on the gateway. - Change the Redis and Sentinel passwords — they ship as
change-me-…placeholders and are used exactly as written. - Force a redeployment after changing a prerequisite secret, including after rotating the admin key — the running gateway keeps the old value until it restarts.
- Your prerequisite secrets survive
cpln helm uninstall— delete them yourself if you no longer need them.