tyk-stack
chart provides the default deployment of Tyk Self Managed on a Kubernetes cluster. It will deploy all required Tyk components with the settings provided in the values.yaml file.
What components are deployed with Tyk Stack Chart?
It includes:- Tyk Gateway, an Open Source Enterprise API Gateway (supporting REST, GraphQL, TCP and gRPC protocols).
- Tyk Pump, an analytics purger that moves the data generated by your Tyk nodes to any back-end. Furthermore, it has all the required modifications to easily connect to Tyk Cloud or Multi Data Center (MDCB) control plane.
- Tyk Dashboard, a license based component that provides a graphical management interface and analytics platform for Tyk.
- Tyk Developer Portal, a full-fledged CMS-like system for API providers to publish, monetize and drive the adoption of APIs.
Component | Enabled by Default | Flag |
---|---|---|
Tyk Gateway | true | n/a |
Tyk Dashboard | true | n/a |
Tyk Pump | false | global.components.pump |
Tyk Enterprise Developer Portal | false | global.components.devPortal |
Tyk Operator | false | global.components.operator |
image.tag
. You can find the list of version tags available from Docker hub.
For quick start guide, please see Quick Start with Helm Chart and PostgreSQL or Quick Start with Helm Chart and MongoDB.
Prerequisites
- Kubernetes 1.19+
- Helm 3+
- Redis should already be installed or accessible by the gateway and dashboard.
-
MongoDB or PostgreSQL should already be installed or accessible by dashboard. Please consult the list of supported versions that are compatible with Tyk.
If you want to enable Tyk Developer Portal, please use PostgreSQL. MongoDB is not supported in Developer Portal.
Tyk Stack Installations
Installing The Chart
To install the chart from Helm repository in namespacetyk
with the release name tyk-stack
:
Uninstalling The Chart
Upgrading Chart
Configuration
To list all configurable options with detailed comments:values.yaml
file and use -f [filename]
flag to override default values during installation.
Alternatively, you can use --set
flag to set it in Tyk installation. See Using Helm for examples.
To configure Tyk components, users can utilize both config files and environment variables. Notably, environment variables take precedence over config files. To maintain simplicity and consistency, the Tyk Helm Charts deploy components with an empty config file while setting container environment variables based on user-defined values. This approach ensures seamless integration with Kubernetes practices, allowing for efficient management of configurations. For a comprehensive overview of available configurations, please refer to the configuration documentation.
Bootstrapping
By default, the chart executes a bootstrapping job immediately after installation. This process ensures the presence of a valid dashboard license and initializes key components such as tyk-dashboard, tyk-portal, and tyk-operator, enabling them for immediate use. The bootstrapping job uses three distinct applications acting as Helm chart hooks:Bootstrapping Component | Description |
---|---|
bootstrap-pre-install | - Runs as a pre-install hook. - Validates the Tyk Dashboard license key to ensure proper installation prerequisites. |
bootstrap-post-install | - Executes post-installation. - Sets up an organization and admin user in the Tyk Dashboard. - Creates Kubernetes secrets required by Tyk Operator and Tyk Enterprise Portal. Note: If an existing organization and admin user are found in the database, the bootstrapping job will not set up a new organization and user. The Kubernetes secrets will not contain the expected Org ID or API key. Please update the Secret with existing credentials in this case. |
bootstrap-pre-delete | - Functions as a pre-delete hook. - Cleans up resources, ensuring no residual configurations remain post-uninstallation. |
- Bootstrapping is triggered only during a
helm install
and does not run during ahelm upgrade
. - If
global.components.bootstrap
is set tofalse
, only the dashboard license check will be performed.
- If the bootstrapping process fails, check the logs from the bootstrap pods to diagnose the issue.
- Once reviewed, you can safely delete the bootstrap pods.
- To re-trigger the bootstrapping process after a failure, you must run
helm uninstall
and start the installation process anew.
Setting Environment Variables
Should any environment variables not be set by the Helm Chart, users can easily add them under theextraEnvs
section within the charts for further customization. Values set under extraEnvs
would take precedence over all configurations.
Example of setting extra environment variable to gateway:
SECRET_USERNAME
will be added to the Gateway container, with a value of backend-username
associated with the secret backend-user
. It is useful if you want to access secret data from Tyk Gateway configuration file (tyk.conf) or API definitions.
Set Redis Connection Details (Required)
Tyk uses Redis for distributed rate-limiting and token storage. You may use the Bitnami chart to install or Tyk’ssimple-redis
chart for POC purpose.
Set the following values after installing Redis:
Name | Description |
---|---|
global.redis.addrs | Redis addresses |
global.redis.pass | Redis password in plain text |
global.redis.passSecret.name | If global.redis.pass is not provided, you can store it in a secret and provide the secret name here |
global.redis.passSecret.keyName | key name to retrieve redis password from the secret |
Please make sure you are installing Redis versions that are supported by Tyk. Please refer to Tyk docs to get list of supported versions.
tyk-redis-master.tyk.svc.cluster.local:6379
You can reference the password secret generated by Bitnami chart by --set global.redis.passSecret.name=tyk-redis
and --set global.redis.passSecret.keyName=redis-password
, or just set global.redis.pass=$REDIS_PASSWORD
Evaluation only: via simple-redis chart
Another option for Redis, to get started quickly, is to use our simple-redis chart.
Please note that these provided charts must never be used in production or for anything
but a quick start evaluation only. Use Bitnami Redis or Official Redis installation guides in any other case.
We provide this chart, so you can quickly deploy Tyk gateway, but it is not meant for long term storage of data.
simple-redis
in the same namespace by default. You do not need to set Redis address and password in values.yaml
.
Set Mongo or PostgresSQL Connection Details (Required)
If you have already installed MongoDB or PostgreSQL, you can set the connection details in theglobal.mongo
and global.postgres
sections of the values.yaml file respectively.
If not, you can use these rather excellent charts provided by Bitnami to install MongoDB or PostgreSQL:
Mongo Installation
Bitnami MongoDB image is not supported on darwin/arm64 architecture.
values.yaml
file.
Please make sure you are installing MongoDB versions that are supported by Tyk. Please refer to Tyk docs to get list of supported versions.
Important Note regarding MongoDB:This helm chart enables the
PodDisruptionBudget
for MongoDB with an arbiter replica-count of 1. If you intend to perform system maintenance on the node where the MongoDB pod is running and this maintenance requires the node to be drained, then this action will be prevented due to the the replica count being 1.Increase the replica count in the helm chart deployment to a minimum of 2 to remedy this issue.global.mongo.mongoURL
and global.storageType
as below. You should replace password in the connection string with the MONGODB_ROOT_PASSWORD you obtain from the installation output notes.
Please make sure you are installing PostgreSQL versions that are supported by Tyk. Please refer to Tyk docs to get list of supported versions.
Protect Confidential Fields with Kubernetes Secrets
In thevalues.yaml
file, some fields are considered confidential, such as APISecret
, connection strings, etc.
Declaring values for such fields as plain text might not be desired. Instead, for certain fields,
Kubernetes secrets can be referenced and the chart will define container environment variables using secret data.
This section describes how to use Kubernetes secrets to declare confidential fields.
Tyk Dashboard and Developer Portal Admin
If Tyk Dashboard bootstrapping is enabled, the admin user will be created according to the global.adminUser
field.
All admin credentials can also be set through Kubernetes secret.
Once
global.adminUser.useSecretName
is declared, it takes precedence over global.adminUser.firstName
,
global.adminUser.lastName
, global.adminUser.email
and global.adminUser.password
.If global.adminUser.useSecretName
is in use, please add all keys mentioned below to the secret.global.adminUser.firstName
as a plain text or Kubernetes secret which includes adminUserFirstName
key in it. Then, this secret must be referenced via global.adminUser.useSecretName
.
Tyk Dashboard Admin Last Name
It can be configured via global.adminUser.lastName
as a plain text or Kubernetes secret which includes adminUserLastName
key in it. Then, this secret must be referenced via global.adminUser.useSecretName
.
Tyk Dashboard and Developer Portal Admin Email
It can be configured via global.adminUser.email
as a plain text or Kubernetes secret which includes adminUserEmail
key in it. Then, this secret must be referenced via global.adminUser.useSecretName
.
Tyk Dashboard and Developer Portal Admin Password
It can be configured via global.adminUser.password
as a plain text or Kubernetes secret which includes adminUserPassword
key in it. Then, this secret must be referenced via global.adminUser.useSecretName
.
APISecret
The global.secrets.APISecret
field configures a header value used in every interaction with Tyk Gateway API.
It can be configured via global.secrets.APISecret
as a plain text or Kubernetes secret which includes APISecret
key in it. Then, this secret must be referenced via global.secrets.useSecretName
.
global.secrets.AdminSecret
field sets a secret for Admin API.
It can be configured via global.secrets.AdminSecret
as a plain text or Kubernetes secret which includes AdminSecret
key in it. Then, this secret must be referenced via global.secrets.useSecretName
.
Once
global.secrets.useSecretName
is declared, it takes precedence over global.secrets.APISecret
and global.secrets.AdminSecret
.global.secrets.useSecretName
, where the secret should contain a key called DashLicense
.
Tyk Developer Portal License
In order to refer Tyk Developer Portal license using a Kubernetes secret, please use
tyk-dev-portal.useSecretName
, where the secret should contain a key called DevPortalLicense
.
Tyk Developer Portal Admin Password
In order to refer Tyk Developer Portal’s admin password using a Kubernetes secret,
please use global.adminUser.useSecretName
, where the secret should contain a key called adminUserPassword
.
Tyk Developer Portal Storage Connection String
In order to refer Tyk Developer Portal connection string to the selected database using a Kubernetes secret, please use tyk-dev-portal.useSecretName
, where the secret should contain a key called
DevPortalStorageConnectionString
.
If
tyk-dev-portal.useSecretName
is in use, please add all keys mentioned to the secret.tyk-dev-portal.useSecretName
, where the secret should contain a key called DevPortalAwsAccessKeyId
.
If
tyk-dev-portal.useSecretName
is in use, please add all keys mentioned to the secret.tyk-dev-portal.useSecretName
, where the secret should contain a key called
DevPortalAwsSecretAccessKey
.
If
tyk-dev-portal.useSecretName
is in use, please add all keys mentioned to the secret.global.{mongo,postgres}.connectionURLSecret.name
and global.{mongo,postgres}.connectionURLSecret.keyName
field, as follows:
- MongoDB:
- PostgreSQL:
global.license.operator
as a plain text or Kubernetes secret which includes OperatorLicense
key in it. Then, this secret must be referenced via global.secrets.useSecretName
.
Note: If you are using global.secrets.useSecretName
, you must configure the operator license in the referenced Kubernetes secret. global.license.operator
will not be used in this case.
Gateway Configurations
This section explains how to configure thetyk-gateway
section for updating the Gateway version, enabling TLS, enabling autoscaling etc.
Update Tyk Gateway Version
Set version of gateway attyk-gateway.gateway.image.tag
. You can find the list of version tags available from Docker hub. Please check Tyk Release notes carefully while upgrading or downgrading.
Enabling TLS
Enable TLS We have provided an easy way to enable TLS via theglobal.tls.gateway
flag. Setting this value to true will
automatically enable TLS using the certificate provided under tyk-gateway/certs/.
Configure TLS secret
If you want to use your own key/cert pair, please follow the following steps:
- Create a TLS secret using your cert and key pair.
- Set
global.tls.gateway
to true. - Set
tyk-gateway.gateway.tls.useDefaultTykCertificate
to false. - Set
tyk-gateway.gateway.tls.secretName
to the name of the newly created secret.
Enabling gateway autoscaling
You can enable autoscaling of the gateway by--set tyk-gateway.gateway.autoscaling.enabled=true
. By default, it will enable the Horizontal Pod Autoscaler
resource with target average CPU utilization at 60%, scaling between 1 and 3 instances. To customize those values you can modify the tyk-gateway section of the values.yaml
file as shown below:
tyk-gateway.gateway.autoscaling.averageCpuUtilization
for CPU utilization (set by default at 60%) and tyk-gateway.gateway.autoscaling.averageMemoryUtilization
for memory (disabled by default). In addition to that you can define rules for custom metrics using tyk-gateway.gateway.autoscaling.autoscalingTemplate
list:
Accessing Gateway
Service port Default service port of gateway is 8080. You can change this atglobal.servicePorts.gateway
.
Ingress
An Ingress resource is created if tyk-gateway.gateway.ingress.enabled
is set to true.
tyk-gateway.gateway.control.enabled
to true will allow you to run the Gateway API on a separate port and protect it behind a firewall if needed.
Sharding
Configure the gateways to load APIs with specific tags only by enablingtyk-gateway.gateway.sharding.enabled
, and set tags
to comma separated lists of matching tags.
Deploy additional gateway groups
Thetyk-stack
chart manages one Gateway deployment in the same namespace as Tyk Dashboard. You can flexibly deploy additional gateways using tyk-gateway
component chart. With gateway sharding, it is useful for:
- Deploying Gateways in different networks,
- Deploying Gateways with different resources and autoscaling parameters,
- Allow different teams to manage their own Gateway instances in their own namespace.
tyk-gateway
values.yaml
.
another-namespace
.
OpenTelemetry
To enable OpenTelemetry for Gateway setgateway.opentelemetry.enabled
flag to true. It is disabled by default.
You can also configure connection settings for it’s exporter. By default grpc
exporter is enabled on localhost:4317
endpoint.
To enable TLS settings for the exporter, you can set gateway.opentelemetry.tls.enabled
to true.
Liveness and readiness probes
Gateway liveness probes can be customised viagateway.livenessProbe
field. All fields from PodLivenessProbe object can be added here. If set to empty or nil, the default health check on /health will be performed.
Gateway readiness probes can be customised via gateway.readinessProbe
field. All fields from PodReadinessProbe object can be added here. If set to empty or nil, the default health check on /health will be performed.
Pump Configurations
To enable Pump, setglobal.components.pump
to true, and configure below inside tyk-pump
section.
Pump | Configuration |
---|---|
Prometheus Pump (Default) | Add the value prometheus to the tyk-pump.pump.backend entry, and add connection details for Prometheus under tyk-pump.pump.prometheusPump . |
Mongo Pump | Add mongo to tyk-pump.pump.backend , and add connection details for mongo under global.mongo . |
Mongo Selective Pump | Add mongo-selective to tyk-pump.pump.backend , and add connection details for mongo under global.mongo . |
Mongo Aggregate Pump | Add mongo-aggregate to tyk-pump.pump.backend , and add connection details for mongo under global.mongo . |
Postgres Pump | Add postgres to tyk-pump.pump.backend , and add connection details for postgres under global.postgres . |
Postgres Aggregate Pump | Add postgres-aggregate to tyk-pump.pump.backend , and add connection details for postgres under global.postgres . |
Uptime Pump | Set tyk-pump.pump.uptimePumpBackend to mongo or postgres or "" |
Other Pumps | Add the required environment variables in tyk-pump.pump.extraEnvs |
For additional information on Tyk Pump configurations, refer to the
Setup Dashboard Analytics documentation.To explore the list of supported backends for Tyk Pump, please visit Pump Backends.
Prometheus Pump
Addprometheus
to tyk-pump.pump.backend
, and add connection details for Prometheus under tyk-pump.pump.prometheusPump
.
We also support monitoring using Prometheus Operator. All you have to do is set tyk-pump.pump.prometheusPump.prometheusOperator.enabled
to true.
This will create a PodMonitor resource for your Pump instance.
Mongo pump
To enable Mongo pump, addmongo
to tyk-pump.pump.backend
, and add connection details for mongo under global.mongo
. See Mongo Installation section above.
By default, it will enable Mongo Aggregate, Mongo Graph Pump and Mongo Selective Pump.
SQL pump
To enable SQL pump, addpostgres
to tyk-pump.pump.backend
, and add connection details for postgres under global.postgres
. See PostgresSQL Installation section above.
By default, it will enable Postgres Aggregate, Postgres Graph Aggregate, SQL Pump and SQL graph pump.
Uptime Pump
Uptime Pump can be configured by settingpump.uptimePumpBackend
in values.yaml file. It supports the following values
- mongo: Used to set Mongo Pump for uptime analytics. Mongo Pump should be enabled.
- postgres: Used to set Postgres Pump for uptime analytics. Postgres Pump should be enabled.
- empty: Used to disable uptime analytics.
Other Pumps
To setup other backends for pump, refer to this document and add the required environment variables inpump.extraEnvs
Tyk Dashboard Configurations
Tyk Dashboard License (Required)
Tyk Dashboard License is required. It can be set up inglobal.license.dashboard
or through secret global.secrets.useSecretName
. The secret should contain a key called DashLicense.
Enabling Dashboard TLS
Assuming that TLS certificates for the Tyk Dashboard are available in the Kubernetes Secrettyk-dashboard-tls
,
follow these steps to enable TLS:
- Set
global.tls.dashboard
totrue
. - Set
tyk-dashboard.dashboard.tls.secretName
to the name of the Kubernetes secret containing TLS certificates for the Tyk Dashboard, in this case,tyk-dashboard-tls
. - Define certificate configurations in
tyk-dashboard.dashboard.tls.certificates
, which generatesTYK_DB_HTTPSERVEROPTIONS_CERTIFICATES
for the Tyk Dashboard.
- Modify the secret mount path on the Tyk Dashboard Pod via
tyk-dashboard.dashboard.tls.certificatesMountPath
. - If necessary, either enable
insecureSkipVerify
viatyk-dashboard.dashboard.tls.certificates
, or mount CA information throughtyk-dashboard.dashboard.extraVolumes
andtyk-dashboard.dashboard.extraVolumeMounts
. - If the
tyk-bootstrap
chart is used to bootstrap the Tyk Dashboard, ensure that it has certificates to send requests to the Tyk Dashboard or enableinsecureSkipVerify
in thetyk-bootstrap
chart. - If the Tyk Gateway connects to the Tyk Dashboard, confirm that the Tyk Gateway has appropriate certificates for connecting to the Tyk Dashboard
Audit Log Configurations
You can manage audit logging for Tyk Dashboard viaauditLogs
:
auditLogs.enabled
: Enables or disables audit logging. It sets corresponding Dashboard environment variableTYK_DB_AUDIT_ENABLED
. Disabled by default.auditLogs.type
: Specifies the storage type for audit logs (db
orfile
). It sets corresponding Dashboard environment variableTYK_DB_AUDIT_STORETYPE
. Set tofile
by default.auditLogs.format
: Defines the format of audit log files (json
ortext
). It sets corresponding Dashboard environment variableTYK_DB_AUDIT_FORMAT
. Set totext
by default.auditLogs.path
: Sets the path to the audit log file. It sets corresponding Dashboard environment variableTYK_DB_AUDIT_PATH
. Set to "" by default.auditLogs.enableDetailedRecording
: Enables detailed logging, including HTTP requests (headers only) and full HTTP responses. It sets corresponding Dashboard environment variableTYK_DB_AUDIT_DETAILEDRECORDING
. Disabled by default.
OPA Configurations
You can manage OPA (Open Agent Policy) for Tyk Dashboard viaopa
:
opa.enabled
: Enables OPA support. It sets corresponding Dashboard environmentTYK_DB_SECURITY_OPENPOLICY_ENABLED
. Disabled by default.opa.debug
: Activates OPA debug mode for detailed logging of policy execution. It sets corresponding Dashboard environmentTYK_DB_SECURITY_OPENPOLICY_DEBUG
. Disabled by default.opa.api
: Enables OPA API mode to manage policies via the Dashboard API. It sets corresponding Dashboard environmentTYK_DB_SECURITY_OPENPOLICY_ENABLEAPI
. Disabled by default.opa.allowAdminPasswordReset
: Required if OPA is enabled with its default policies. It sets corresponding Dashboard environmentTYK_DB_SECURITY_ALLOWADMINRESETPASSWORD
. Enabled by default.
Tyk Bootstrap Configurations
To enable bootstrapping, setglobal.components.bootstrap
to true
. It would run tyk-k8s-bootstrap to bootstrap tyk-stack
and to create Kubernetes secrets that can be utilized in Tyk Operator and Tyk Developer Portal.
During bootstrapping, admin user needs to reset its password. It may be denied by Dashboard OPA rules if OPA was enabled. Please disable OPA during the initial bootstrapping or set Dashboard configuration TYK_DB_SECURITY_ALLOWADMINRESETPASSWORD to true.
Bootstrapped Environments
If Tyk is already bootstrapped, the application will bypass the creation of the Tyk Organization and Admin User, proceeding directly with the creation of Kubernetes Secrets. Given that the Kubernetes Secrets require values forTYK_AUTH
and TYK_ORG
, it is essential to provide these values through the respective environment variables, called TYK_K8SBOOTSTRAP_TYK_ADMIN_AUTH
for TYK_AUTH
and TYK_K8SBOOTSTRAP_TYK_ORG_ID
for TYK_ORG
.
Ensure that these environment variables are set appropriately to postInstall
hook for bootstrapped environments.
Tyk Developer Portal Configurations
To enable Tyk Developer Portal, setglobal.components.devPortal
to true, and configure below inside tyk-dev-portal
section.
Tyk Developer Portal License (Required)
Tyk Developer Portal License is required. It can be set up intyk-dev-portal.license
or through secret global.secrets.useSecretName
. The secret should contain a key called DevPortalLicense
.
Tyk Developer Portal Database
Tyk no longer supports SQLite as of Tyk 5.7.0. To avoid disruption, please transition to PostgreSQL, MongoDB, or one of the listed compatible alternatives.
sqlite3
to store portal metadata. If you want to use other SQL Database, please modify the section below.
Storage Settings
Tyk Developer Portal supports different storage options for storing the portal’s CMS assets such as images, theme files and Open API Specification files. Please see the Developer Portal storage settings page for all the available options. If you use the file system as storage, please settyk-dev-portal.storage.type
to fs
, and configure tyk-dev-portal.storage.persistence
to mount an existing persistent volume to Tyk Developer Portal.
If you use AWS S3 as storage, please set tyk-dev-portal.storage.type
to s3
, and configure tyk-dev-portal.storage.s3
section with credentials to access AWS S3 bucket.
If you use database as storage, please set tyk-dev-portal.storage.type
to db
, and configure the tyk-dev-portal.database
section with database connection details.
Other Configurations
Other Developer Portal configurations can be set by using environment variables withextraEnvs
fields, e.g.:
Tyk Operator Configurations
Tyk Operator is a licensed component that requires a valid key for operation. Please refer to the Tyk Operator Installation Guide for detailed information on the installation and upgrade processes. Prior to installing Tyk Operator, ensure that a valid license key is provided by settingglobal.license.operator
field in values.yaml file. You can set license key via a Kubernetes secret using global.secrets.useSecretName
field. The secret should contain a key called OperatorLicense
.
In order to enable installing Tyk Operator along-side Tyk Stack installation, please set global.components.operator
to true
.
All other configurations related to Tyk Operator are available under tyk-operator
section of values.yaml
file.
Tyk Operator needs a cert-manager to be installed. Ensure that cert-manager is installed as described in the official documentation: Installing Tyk Operator.