Kind | Group | Version | Description |
---|---|---|---|
TykOasApiDefinition | tyk.tyk.io | v1alpha1 | Defines configuration of Tyk OAS API Definition object |
ApiDefinition | tyk.tyk.io | v1alpha1 | Defines configuration of Tyk Classic API Definition object |
TykStreamsApiDefinition | tyk.tyk.io | v1alpha1 | Defines configuration of Tyk Streams |
SecurityPolicy | tyk.tyk.io | v1alpha1 | Defines configuration of security policies. Operator supports linking ApiDefinition custom resources in SecurityPolicy’s access list so that API IDs do not need to be hardcoded in the resource manifest. |
SubGraph | tyk.tyk.io | v1alpha1 | Defines a GraphQL federation subgraph. |
SuperGraph | tyk.tyk.io | v1alpha1 | Defines a GraphQL federation supergraph. |
OperatorContext | tyk.tyk.io | v1alpha1 | Manages the context in which the Tyk Operator operates, affecting its overall behavior and environment. See Operator Context for details. |
Kind | Group | Version | Description |
---|---|---|---|
APIDescription | tyk.tyk.io | v1alpha1 | Configures Portal Documentation. |
PortalAPICatalogue | tyk.tyk.io | v1alpha1 | Configures Portal API Catalogue. |
PortalConfig | tyk.tyk.io | v1alpha1 | Configures Portal Configuration. |
A Kubernetes operator is an application-specific controller that extends the functionality of the Kubernetes API to create, configure, and manage instances of complex applications on behalf of a Kubernetes user.
v1alpha1
version, no breaking changes will be introduced to existing Custom Resources without a version bump. This means that any significant changes or updates that could impact existing resources will result in a new version (e.g., v1beta1
or v1
) and Operator will continue supporting all CRD versions for a reasonable time before deprecating an older version. This ensures a smooth transition and compatibility, allowing you to upgrade without disrupting your current configurations and workflows.
For more details on Kubernetes CRD versioning practices, refer to the Kubernetes Custom Resource Definition Versioning documentation.
tyk-operator-conf
secret or from the environment variables (listed in the table below).
Key or Environment Variable | Description |
---|---|
TYK_MODE | ”ce” for OSS or “pro” for licensed users |
TYK_URL | URL of Tyk Gateway or Dashboard API |
TYK_ORG | Organization ID of Operator user |
TYK_AUTH | API key of Operator user |
OperatorContext
in Tyk Operator allows you to create isolated management environments by defining specific access parameters for different teams or departments within a shared Tyk Operator instance. It helps you specify:
OperatorContext
configurations, you can define unique access and management contexts for different teams. These contexts can then be referenced directly in your ApiDefinition
, TykOasApiDefinition
, TykStreamsApiDefinition
or SecurityPolicy
custom resource definitions (CRDs) using the contextRef
field, enabling precise control over API configurations.
OperatorContext
is defined, Tyk Operator defaults to using credentials from the tyk-operator-conf
secret or from environment variables. This means all API management actions are performed under the system’s default user credentials, with no specific contextual isolation.OperatorContext
is defined but not referenced in an API configuration, Tyk Operator continues to use the default credentials from tyk-operator-conf
. The specified OperatorContext
is ignored, resulting in API operations being managed under default credentials.OperatorContext
is both defined and referenced in an API or policy, Tyk Operator utilizes the credentials and parameters from the referenced OperatorContext
to perform API operations. This allows each API or policy to be managed with isolated configurations, enabling team-based or department-specific API management within the same Kubernetes cluster.OperatorContext
offers flexibility for multi-tenancy, helping organizations manage and isolate API configurations based on their specific team or departmental needs.
Certificate Type | Supported in ApiDefinition | Supported in TykOasApiDefinition | Supported in TykStreamsApiDefinition |
---|---|---|---|
Client certifates | ✅ Client mTLS | ✅ Client mTLS | Certificate ID can be set in the API Definition but configuring certificates from Secrets in CRD is not supported. |
Custom domain certificates | ✅ TLS and SSL | ✅ TLS and SSL | Certificate ID can be set in the API Definition but configuring certificates from Secrets in CRD is not supported. |
Public keys pinning | ✅ Certificate pinning | ✅ Certificate pinning | Certificate ID can be set in the API Definition but configuring certificates from Secrets in CRD is not supported. |
Upstream mTLS | ✅ Upstream mTLS via Operator | ✅ Upstream mTLS via Operator | Certificate ID can be set in the API Definition but configuring certificates from Secrets in CRD is not supported. |
Type | Support | Supported From | Comments |
---|---|---|---|
HTTP | ✅ | v0.1 | Standard HTTP proxy for API requests. |
HTTPS | ✅ | v0.4 | Secure HTTP proxy using SSL/TLS encryption. |
TCP | ✅ | v0.1 | Handles raw TCP traffic, useful for non-HTTP APIs. |
TLS | ✅ | v0.1 | Handles encrypted TLS traffic for secure communication. |
GraphQL - Proxy | ✅ | v0.1 | Proxy for GraphQL APIs, routing queries to the appropriate service. |
Universal Data Graph v1 | ✅ | v0.1 | Supports Universal Data Graph v1 for unified data access. |
Universal Data Graph v2 | ✅ | v0.12 | Supports the newer Universal Data Graph v2 for more advanced data handling. |
GraphQL - Federation | ✅ | v0.12 | Supports GraphQL Federation for querying multiple services as one API. |
Type | Support | Supported From | Comments |
---|---|---|---|
API Name | ✅ | v0.1 | Assign and manage names for your APIs. |
API Status (inactive/active) | ✅ | v0.2 | Toggle API status between active and inactive. |
API Categories | ✅ | v0.1 | Categorize APIs for easier management. |
API ID | ✅ | v0.1 | Assign unique IDs to APIs for tracking and management. |
API Ownership | ✅ | v0.12 | Define ownership of APIs within teams or organizations. |
API Versioning | ✅ | v0.1 | Enable version control for APIs. |
Type | Supported | Supported From | Comments |
---|---|---|---|
Path-Based Proxy | ✅ | v0.1 | Route traffic based on URL path. |
Host-Based Proxy | ✅ | v0.1 | Route traffic based on the request host. |
Target URL | ✅ | v0.1 | Redirect traffic to a specific target URL. |
Type | Supported | Supported From | Comments |
---|---|---|---|
Keyless | ✅ | v0.1 | No authentication required, open access. |
Auth Token | ✅ | v0.1 | Requires an authentication token (Bearer token). |
JWT | ✅️ | v0.5 | Uses JSON Web Tokens for secure authentication. |
OpenID Connect | ❌ | - | Recommended to use JWT for OIDC authentication. |
OAuth2 | ❌ | - | OAuth2 not supported, JWT is recommended. |
Client mTLS | ✅ | v0.11 | Supports static client mutual TLS authentication. |
HMAC | ❌ | - | HMAC authentication is not implemented. |
Basic Authentication | ✅ | v0.12 | Only supports enabling with default metadata. |
Custom Authentication Plugin (Go) | ✅ | v0.11 | Custom authentication plugin written in Go. |
Custom Authentication Plugin (gRPC) | ✅ | v0.1 | Custom authentication plugin using gRPC. |
Multiple Authentication | ✅ | v0.14 | Chain multiple authentication methods. |
IP Allowlist | ✅ | v0.5 | Allows access only from specific IP addresses. |
IP Blocklist | ✅ | v0.5 | Blocks access from specific IP addresses. |
Type | Supported | Supported From | |
---|---|---|---|
Mutual TLS for upstream connectioons | ✅ | v0.9 | Mutual TLS authentication for upstream connections. |
Public Key Certificate Pinning | ✅ | v0.9 | Ensures that the upstream certificate matches a known key. |
Upstream Request Signing using HMAC | ✅ | v1.2.0 | Attach an encrypted signature to requests to verify the gateway as the sender. |
Feature | Supported | Supported From | Comments |
---|---|---|---|
Detailed recording (in Log Browser) | ✅ | v0.4.0 | Records detailed API traffic logs for analysis. |
Config Data | ✅ | v0.8.2 | Stores additional configuration data for APIs. |
Context Variables | ✅ | v0.1 | Enables dynamic context-based variables in APIs. |
Cross Origin Resource Sharing (CORS) | ✅ | v0.2 | Manages CORS settings for cross-domain requests. |
Service Discovery | ⚠️ | - | Service discovery is untested in this version. |
Segment Tags | ✅ | v0.1 | Tags APIs for segmentation across environments. |
Internal API (not exposed by Gateway) | ✅ | v0.6.0 | Internal APIs are not exposed via the Gateway. |
Global (API-level) Header Transform | ✅ | v0.1.0 | Transforms request and response headers at the API level. |
Global (API-level) Rate Limit | ✅ | v0.10 | Sets rate limits globally for APIs. |
Custom Plugins | ✅ | v0.1 | Supports the use of custom plugins for API processing. |
Analytics Plugin | ✅ | v0.16.0 | Integrates analytics plugins for API monitoring. |
Batch Requests | ❌ | - | Batch requests are not supported. |
Custom Analytics Tags (Tag Headers) | ✅ | v0.10.0 | Custom tags for API analytics data. |
Expire Analytics After | ❌ | - | Not supported in this version. |
Do not track Analytics (per API) | ✅ | v0.1.0 | Disable analytics tracking on specific APIs. |
Webhooks | ❌ | - | Webhook support is not available. |
Looping | ✅ | v0.6 | Enables internal looping of API requests. |
Round Robin Load Balancing | ✅ | - | Supports round-robin load balancing across upstream servers. |
Endpoint Middleware | Supported | Supported From | Comments |
---|---|---|---|
Allow list | ✅️ | v0.8.2 | Allows requests only from approved sources. |
Block list | ✅️ | v0.8.2 | Blocks requests from disapproved sources. |
Cache | ✅ | v0.1 | Caches responses to reduce latency. |
Advance Cache | ✅ | v0.1 | Provides advanced caching capabilities. |
Circuit Breaker | ✅ | v0.5 | Prevents service overload by breaking circuits. |
Track Endpoint | ✅ | v0.1 | Tracks API endpoint usage for analysis. |
Do Not Track Endpoint | ✅ | v0.1 | Disables tracking for specific endpoints. |
Enforced Timeouts | ✅ | v0.1 | Ensures timeouts for long-running requests. |
Ignore Authentication | ✅ | v0.8.2 | Bypasses authentication for selected endpoints. |
Internal Endpoint | ✅ | v0.1 | Restricts access to internal services. |
URL Rewrite | ✅️ | v0.1 | Modifies request URLs before processing. |
Validate Request | ✅ | v0.8.2 | Validates incoming requests before forwarding. |
Rate Limit | ❌ | - | Rate limiting is not supported per endpoint. |
Request Size Limit | ✅️ | v0.1 | Limits the size of requests to prevent overload. |
Request Method Transform | ✅ | v0.5 | Modifies HTTP methods for incoming requests. |
Request Header Transform | ✅ | v0.1 | Transforms request headers. |
Request Body Transform | ✅ | v0.1 | Transforms request bodies for processing. |
Request Body JQ Transform | ⚠️ | v0.1 | Requires JQ support on the Gateway Docker image. |
Response Header Transform | ✅ | v0.1 | Transforms response headers. |
Response Body Transform | ✅ | v0.1 | Transforms response bodies. |
Response Body JQ Transform | ⚠️ | v0.1 | Requires JQ support on the Gateway Docker image. |
Mock Response | ✅ | v0.1 | Simulates API responses for testing. |
Virtual Endpoint | ✅ | v0.1 | Allows creation of dynamic virtual endpoints. |
Per-Endpoint Plugin | ❌ | - | Plugin support per endpoint is not available. |
Persist Graphql | ❌ | - | Not supported in this version. |
TykOasApiDefinition
can support all features of the Tyk OAS API definition. You just need to provide the Tyk OAS API definition via a ConfigMap. In addition to managing the CRUD (Create, Read, Update, Delete) of Tyk OAS API resources, the Tyk Operator helps you better manage resources through object linking to Ingress, Security Policies, and certificates stored as Kubernetes secrets. See below for a list of Operator features and examples:
Features | Support | Supported From | Comments | Example |
---|---|---|---|---|
API Category | ✅ | v1.0 | - | Manage API Categories |
API Version | ✅ | v1.0 | - | Manage API versioning |
API Ownership via OperatorContext | ✅ | v1.0 | - | API Ownership |
Client Certificates | ✅ | v1.0 | - | Manage TLS certificate |
Custom Domain Certificates | ✅ | v1.0 | - | Manage TLS certificate |
Public keys pinning | ✅ | v1.0 | - | Manage TLS certificate |
Upstream mTLS | ✅ | v1.0 | - | Manage TLS certificate |
Kubernetes Ingress | ✅ | v1.0 | - | Kubernetes Ingress Controller |
Link with SecurityPolicy | ✅ | v1.0 | - | Protect an API |
TykStreamsApiDefinition
can support all features of Tyk Streams. You just need to provide the Tyk Streams API definition via a ConfigMap. In addition to managing the CRUD (Create, Read, Update, Delete) of Tyk Streams API resources, the Tyk Operator helps you better manage resources through object linking to Security Policies. See below for a list of Operator features and examples:
Features | Support | Supported From | Comments | Example |
---|---|---|---|---|
API Ownership via OperatorContext | ✅ | v1.0 | - | API Ownership |
Link with SecurityPolicy | ✅ | v1.0 | - | Protect an API |
Tyk Version | 3.2 | 4.0 | 4.1 | 4.2 | 4.3 | 5.0 | 5.2 | 5.3 | 5.4 | 5.5 | 5.6 | 5.7 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Tyk Operator v0.13 | Y | Y | ||||||||||
Tyk Operator v0.14 | Y | Y | Y | Y | ||||||||
Tyk Operator v0.14.1 | Y | Y | Y | Y | ||||||||
Tyk Operator v0.15.0 | Y | Y | Y | Y | ||||||||
Tyk Operator v0.15.1 | Y | Y | Y | Y | ||||||||
Tyk Operator v0.16.0 | Y | Y | Y | Y | Y | |||||||
Tyk Operator v0.17.0 | Y | Y | Y | Y | Y | Y | ||||||
Tyk Operator v0.17.1 | Y | Y | Y | Y | Y | |||||||
Tyk Operator v0.18.0 | Y | Y | Y | Y | Y | Y | ||||||
Tyk Operator v1.0.0 | Y | Y | Y | Y | Y | Y | ||||||
Tyk Operator v1.1.0 | Y | Y | Y | Y | Y | Y | Y |
Kubernetes Version | 1.19 | 1.20 | 1.21 | 1.22 | 1.23 | 1.24 | 1.25 | 1.26 | 1.27 | 1.28 | 1.29 | 1.30 |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Tyk Operator v0.13 | Y | Y | Y | Y | Y | Y | Y | |||||
Tyk Operator v0.14 | Y | Y | Y | Y | Y | Y | Y | |||||
Tyk Operator v0.14.1 | Y | Y | Y | Y | Y | Y | Y | |||||
Tyk Operator v0.15.0 | Y | Y | Y | Y | Y | Y | Y | |||||
Tyk Operator v0.15.1 | Y | Y | Y | Y | Y | Y | Y | |||||
Tyk Operator v0.16.0 | Y | Y | Y | Y | Y | Y | Y | |||||
Tyk Operator v0.17.0 | Y | Y | Y | Y | Y | |||||||
Tyk Operator v0.17.1 | Y | Y | Y | Y | Y | |||||||
Tyk Operator v0.18.0 | Y | Y | Y | Y | Y | |||||||
Tyk Operator v1.0.0 | Y | Y | Y | Y | Y | Y | ||||||
Tyk Operator v1.1.0 | Y | Y | Y | Y | Y | Y |
Features | Support | Supported From | Example |
---|---|---|---|
API Access | ✅ | v0.1 | API Access |
Rate Limit, Throttling, Quotas | ✅ | v0.1 | Rate Limit, Throttling, Quotas |
Meta Data & Tags | ✅ | v0.1 | Tags and Meta-data |
Path and Method based permissions | ✅ | v0.1 | Path based permission |
Partitions | ✅ | v0.1 | Partitioned policies |
Per API limit | ✅ | v1.0 | Per API Limit |
Per-Endpoint limit | ✅ | v1.0 | Per Endpoint Limit |
x-tyk-api-gateway.info.name
field in Tyk OAS API Definition object.
ApiDefinition
, use the spec.name
string field. This name is displayed on the Tyk Dashboard and should concisely describe what the API represents.
Example:
x-tyk-api-gateway.info.state.active
field in Tyk OAS API Definition object.
spec.active
configuration parameter. When set to true
, this enables the API so that Tyk will listen for and process requests made to the listenPath
.
x-tyk-api-gateway.info.state.internal
field in Tyk OAS API Definition object.
spec.internal
configuration parameter as shown in the example below.
status.id
field. Run the following command to inspect generated API ID of a Tyk OAS API.
ZGVmYXVsdC9wZXRzdG9yZQ
.
status.api_id
field. Run the following command to inspect generated API ID of a Tyk Classic API.
ZGVmYXVsdC90ZXN0
.
x-tyk-api-gateway.info.id
field in Tyk OAS API Definition object.
spec.api_id
field. This way, when you apply the manifest, Tyk Operator will not create a new API in the Dashboard. Instead, it will update the original API with the Kubernetes spec.
Example
12345
will be updated according to the provided spec instead of creating a new API.
categories
field in TykOasApiDefinition
CRD.
Here’s an example:
TykStreamsApiDefinition
CRD.
name
field with a #
qualifier. This will categorize the API in the Tyk Dashboard. See How API categories work to learn about limitations on API names.
Example
x-tyk-api-gateway.versioning
object of the Base API, where the child API’s IDs are specified. In the Kubernetes environment with Tyk Operator, where we reference API resources through its Kubernetes name and namespace, this is not desired. Therefore, we add support for versioning configurations through the field versioning
in TykOasApiDefinition
custom resource definition (CRD).
Here’s an example:
order-api
(v1) and order-api-v2
(v2).
versioning
is configured at order-api
(v1), the Base API, and it has similiar structure as Tyk OAS API Definition:
versioning
: This object configures API versioning for the order-api
.
enabled
: Set to true to enable versioning.name
: an identifier for this version of the API (v1).default
: Specifies the default version (v1), which will be used if no version is specified in the request.location
: Specifies where the version key is expected (in this case, in the header). It can be set to header
or url-param
.key
: Specifies the versioning identifier key (x-api-version
) to identify the version. In this example, the version is determined by an HTTP header named x-api-version
.fallbackToDefault
: When set to true, if an unspecified or invalid version is requested, the default version (v1) will be used.stripVersioningData
: When true, removes versioning identifier (like headers or query parameters) from the upstream request to avoid exposing internal versioning details.urlVersioningPattern
: Specifies a regex that matches the format that you use for the versioning identifier (name) if you are using stripVersioningData and fallBackToDefault with location=url with Tyk 5.5.0 or laterversions
: Defines the list of API versions available:
name
: an identifier for this version of the API (v2).tykOasApiDefinitionRef
: Refers to a separate TykOasApiDefinition resource that represent a new API version.
name
: Kubernetes metadata name of the resource (order-api-v2
).namespace
: Kubernetes metadata namespace of the resource (default
).x-tyk-api-gateway.versioning
object), which typically requires referencing specific API IDs. Instead, the Operator allows you to manage versioning declaratively in the TykOasApiDefinition
CRD, using the versioning
field to specify versions and their Kubernetes references (names and namespaces).
When using the CRD for versioning configuration, you don’t have to worry about knowing or managing the unique API IDs within Tyk. The Tyk Operator handles the actual API definition configuration behind the scenes, reducing the complexity of version management.
In case if there is original versioning information in the base API Definition, the versioning information will be kept and be merged with what is specified in CRD. If there are conflicts between the Tyk OAS API Definition and CRD, we will make use of CRD values as the final configuration.
Tyk Operator would also protect you from accidentally deleting a version of an API that is being referenced by another API, maintaining your API integrity.
TykStreamsApiDefinition
CRD. This can be configured natively in the Tyk Streams API Definition.
ApiDefinition
custom resource definition (CRD). See Tyk Classic versioning for a comprehensive example of configuring API versioning for Tyk Classic API with Tyk Operator.
contextRef
in TykOasApiDefinition
or ApiDefinition
objects to ensure configurations are applied within specific organizations. The provided YAML examples illustrate how to set up these configurations.
OperatorContext
comes into play. Users can define different OperatorContext
objects that act as different agents to connect to Tyk Dashboard. Each OperatorContext
can specify different access parameters, including the user access key and organization it belongs to. Within OperatorContext
, users can specify the IDs of owner users or owner user groups. All APIs managed through that OperatorContext
will be owned by the specified users and user groups, ensuring compliance with Tyk Dashboard’s API ownership model.
OperatorContext
allows Tyk Operator to manage APIs under different ownerships:
OperatorContext
is defined, you can reference it in your Tyk OAS or Tyk Streams API Definition objects using contextRef
. Below is an example with TykOasApiDefinition:
TykOasApiDefinition
object references the team-alpha
context, ensuring that it is managed under the ownership of the specified users and user groups.
contextRef
. Below is an example:
ApiDefinition
object references the team-alpha
context, ensuring that it is managed under the ownership of the specified users and user groups.
Can I use Tyk Operator with non-Kubernetes Tyk installations?
tyk-operator-conf
, environment variable, or OperatorContext:Tyk Operator changes not applied?
The Status subresource in Kubernetes is a specialized endpoint that allows developers and operators to retrieve the real-time status of a specific Kubernetes resource. By querying this subresource, users can efficiently access essential information about a resource’s current state, conditions, and other relevant details without fetching the entire resource, simplifying monitoring and aiding in prompt decision-making and issue resolution.The new status subresource latestTransaction consists of a couple of fields that show the latest result of the reconciliation:
.status.latestTransaction.status
: shows the status of the latest reconciliation, either Successful or Failed;.status.latestTransaction.time
: shows the time of the latest reconciliation;.status.latestTransaction.error
: shows the message of an error if observed in the latest transaction.kubectl describe
or kubectl get
:.status.latestTransaction
field. As .status.latestTransaction.error
implies, the error is related to SecurityPolicy dependency.Can I use Tyk Operator with multiple Tyk installations?
OperatorContext
resources for each installation: