Skip to main content
Version: Next

Custom Resource Definitions API Reference

This document provides the API resource description for the APISIX Ingress Controller custom resource definitions (CRDs).

Packages#

apisix.apache.org/v1alpha1#

Package v1alpha1 contains API Schema definitions for the apisix.apache.org v1alpha1 API group.

BackendTrafficPolicy#

BackendTrafficPolicy defines configuration for traffic handling policies applied to backend services.

FieldDescription
apiVersion stringapisix.apache.org/v1alpha1
kind stringBackendTrafficPolicy
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec BackendTrafficPolicySpecBackendTrafficPolicySpec defines traffic handling policies applied to backend services, such as load balancing strategy, connection settings, and failover behavior.

Consumer#

Consumer defines configuration for a consumer.

FieldDescription
apiVersion stringapisix.apache.org/v1alpha1
kind stringConsumer
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec ConsumerSpecConsumerSpec defines configuration for a consumer, including consumer name, authentication credentials, and plugin settings.

GatewayProxy#

GatewayProxy defines configuration for the gateway proxy instances used to route traffic to services.

FieldDescription
apiVersion stringapisix.apache.org/v1alpha1
kind stringGatewayProxy
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec GatewayProxySpecGatewayProxySpec defines configuration of gateway proxy instances, including networking settings, global plugins, and plugin metadata.

HTTPRoutePolicy#

HTTPRoutePolicy defines configuration of traffic policies.

FieldDescription
apiVersion stringapisix.apache.org/v1alpha1
kind stringHTTPRoutePolicy
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec HTTPRoutePolicySpecHTTPRoutePolicySpec defines configuration of a HTTPRoutePolicy, including route priority and request matching conditions.

PluginConfig#

PluginConfig defines plugin configuration.

FieldDescription
apiVersion stringapisix.apache.org/v1alpha1
kind stringPluginConfig
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec PluginConfigSpecPluginConfigSpec defines the desired state of a PluginConfig, in which plugins and their configuration are specified.

Types#

This section describes the types used by the CRDs.

AdminKeyAuth#

AdminKeyAuth defines the admin key authentication configuration.

FieldDescription
value stringValue sets the admin key value explicitly (not recommended for production).
valueFrom AdminKeyValueFromValueFrom specifies the source of the admin key.

Appears in:

AdminKeyValueFrom#

AdminKeyValueFrom defines the source of the admin key.

FieldDescription
secretKeyRef SecretKeySelectorSecretKeyRef references a key in a Secret.

Appears in:

AuthType#

Base type: string

AuthType defines the type of authentication.

Appears in:

BackendPolicyTargetReferenceWithSectionName#

Base type: LocalPolicyTargetReferenceWithSectionName

FieldDescription
group GroupGroup is the group of the target resource.
kind KindKind is kind of the target resource.
name ObjectNameName is the name of the target resource.
sectionName SectionNameSectionName is the name of a section within the target resource. When unspecified, this targetRef targets the entire resource. In the following resources, SectionName is interpreted as the following:

• Gateway: Listener name
• HTTPRoute: HTTPRouteRule name
• Service: Port name

If a SectionName is specified, but does not exist on the targeted object, the Policy must fail to attach, and the policy implementation should record a ResolvedRefs or similar Condition in the Policy's status.

Appears in:

BackendTrafficPolicySpec#

FieldDescription
targetRefs BackendPolicyTargetReferenceWithSectionName arrayTargetRef identifies an API object to apply policy to. Currently, Backends (i.e. Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references.
loadbalancer LoadBalancerLoadBalancer represents the load balancer configuration for Kubernetes Service. The default strategy is round robin.
scheme stringScheme is the protocol used to communicate with the upstream. Default is http. Can be http, https, grpc, or grpcs.
retries integerRetries specify the number of times the gateway should retry sending requests when errors such as timeouts or 502 errors occur.
timeout TimeoutTimeout sets the read, send, and connect timeouts to the upstream.
passHost stringPassHost configures how the host header should be determined when a request is forwarded to the upstream. Default is pass. Can be pass, node or rewrite:
pass: preserve the original Host header
node: use the upstream node’s host
rewrite: set to a custom host via upstreamHost
upstreamHost HostnameUpstreamHost specifies the host of the Upstream request. Used only if passHost is set to rewrite.

Appears in:

ConsumerSpec#

FieldDescription
gatewayRef GatewayRefGatewayRef specifies the gateway details.
credentials Credential arrayCredentials specifies the credential details of a consumer.
plugins Plugin arrayPlugins define the plugins associated with a consumer.

Appears in:

ControlPlaneAuth#

ControlPlaneAuth defines the authentication configuration for control plane.

FieldDescription
type AuthTypeType specifies the type of authentication. Can only be AdminKey.
adminKey AdminKeyAuthAdminKey specifies the admin key authentication configuration.

Appears in:

ControlPlaneProvider#

ControlPlaneProvider defines configuration for control plane provider.

FieldDescription
endpoints string arrayEndpoints specifies the list of control plane endpoints.
service ProviderService
tlsVerify booleanTlsVerify specifies whether to verify the TLS certificate of the control plane.
auth ControlPlaneAuthAuth specifies the authentication configuration.

Appears in:

Credential#

FieldDescription
type stringType specifies the type of authentication to configure credentials for. Can be jwt-auth, basic-auth, key-auth, or hmac-auth.
config JSONConfig specifies the credential details for authentication.
secretRef SecretReferenceSecretRef references to the Secret that contains the credentials.
name stringName is the name of the credential.

Appears in:

GatewayProxyPlugin#

GatewayProxyPlugin contains plugin configuration.

FieldDescription
name stringName is the name of the plugin.
enabled booleanEnabled defines whether the plugin is enabled.
config JSONConfig defines the plugin's configuration details.

Appears in:

GatewayProxyProvider#

GatewayProxyProvider defines the provider configuration for GatewayProxy.

FieldDescription
type ProviderTypeType specifies the type of provider. Can only be ControlPlane.
controlPlane ControlPlaneProviderControlPlane specifies the configuration for control plane provider.

Appears in:

GatewayProxySpec#

GatewayProxySpec defines the desired state of GatewayProxy.

FieldDescription
publishService stringPublishService specifies the LoadBalancer-type Service whose external address the controller uses to update the status of Ingress resources.
statusAddress string arrayStatusAddress specifies the external IP addresses that the controller uses to populate the status field of GatewayProxy or Ingress resources for developers to access.
provider GatewayProxyProviderProvider configures the provider details.
plugins GatewayProxyPlugin arrayPlugins configure global plugins.
pluginMetadata object (keys:string, values:JSON)PluginMetadata configures common configuration shared by all plugin instances of the same name.

Appears in:

GatewayRef#

FieldDescription
name stringName is the name of the gateway.
kind stringKind is the type of Kubernetes object. Default is Gateway.
group stringGroup is the API group the resource belongs to. Default is gateway.networking.k8s.io.
namespace stringNamespace is namespace of the resource.

Appears in:

HTTPRoutePolicySpec#

HTTPRoutePolicySpec defines the desired state of HTTPRoutePolicy.

FieldDescription
targetRefs LocalPolicyTargetReferenceWithSectionName arrayTargetRef identifies an API object (i.e. HTTPRoute, Ingress) to apply HTTPRoutePolicy to.
priority integerPriority sets the priority for route. when multiple routes have the same URI path, a higher value sets a higher priority in route matching.
vars JSON arrayVars sets the request matching conditions.

Appears in:

Hostname#

Base type: string

Appears in:

LoadBalancer#

LoadBalancer describes the load balancing parameters.

FieldDescription
type stringType specifies the load balancing algorithms to route traffic to the backend. Default is roundrobin. Can be roundrobin, chash, ewma, or least_conn.
hashOn stringHashOn specified the type of field used for hashing, required when type is chash. Default is vars. Can be vars, header, cookie, consumer, or vars_combinations.
key stringKey is used with HashOn, generally required when type is chash. When HashOn is header or cookie, specifies the name of the header or cookie. When HashOn is consumer, key is not required, as the consumer name is used automatically. When HashOn is vars or vars_combinations, key refers to one or a combination of APISIX variable.

Appears in:

Plugin#

FieldDescription
name stringName is the name of the plugin.
config JSONConfig is plugin configuration details.

Appears in:

PluginConfigSpec#

PluginConfigSpec defines the desired state of PluginConfig.

FieldDescription
plugins Plugin arrayPlugins are an array of plugins and their configuration to be applied.

Appears in:

ProviderService#

FieldDescription
name stringName is the name of the provider.
port integerPort is the port of the provider.

Appears in:

ProviderType#

Base type: string

ProviderType defines the type of provider.

Appears in:

SecretKeySelector#

SecretKeySelector defines a reference to a specific key within a Secret.

FieldDescription
name stringName is the name of the secret.
key stringKey is the key in the secret to retrieve the secret from.

Appears in:

SecretReference#

FieldDescription
name stringName is the name of the secret.
namespace stringNamespace is the namespace of the secret.

Appears in:

Status#

FieldDescription
conditions Condition array

Appears in:

Timeout#

FieldDescription
connect DurationConnection timeout. Default is 60s.
send DurationSend timeout. Default is 60s.
read DurationRead timeout. Default is 60s.

Appears in:

apisix.apache.org/v2#

Package v2 contains API Schema definitions for the apisix.apache.org v2 API group.

ApisixConsumer#

ApisixConsumer defines configuration of a consumer and their authentication details.

FieldDescription
apiVersion stringapisix.apache.org/v2
kind stringApisixConsumer
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec ApisixConsumerSpecApisixConsumerSpec defines the consumer authentication configuration.

ApisixGlobalRule#

ApisixGlobalRule defines configuration for global plugins.

FieldDescription
apiVersion stringapisix.apache.org/v2
kind stringApisixGlobalRule
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec ApisixGlobalRuleSpecApisixGlobalRuleSpec defines the global plugin configuration.

ApisixPluginConfig#

ApisixPluginConfig defines a reusable set of plugin configuration that can be referenced by routes.

FieldDescription
apiVersion stringapisix.apache.org/v2
kind stringApisixPluginConfig
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec ApisixPluginConfigSpecApisixPluginConfigSpec defines the plugin config configuration.

ApisixRoute#

ApisixRoute is defines configuration for HTTP and stream routes.

FieldDescription
apiVersion stringapisix.apache.org/v2
kind stringApisixRoute
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec ApisixRouteSpecApisixRouteSpec defines HTTP and stream route configuration.

ApisixTls#

ApisixTls defines configuration for TLS and mutual TLS (mTLS).

FieldDescription
apiVersion stringapisix.apache.org/v2
kind stringApisixTls
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec ApisixTlsSpecApisixTlsSpec defines the TLS configuration.

ApisixUpstream#

ApisixUpstream defines configuration for upstream services.

FieldDescription
apiVersion stringapisix.apache.org/v2
kind stringApisixUpstream
metadata ObjectMetaPlease refer to the Kubernetes API documentation for details on the metadata field.
spec ApisixUpstreamSpecApisixUpstreamSpec defines the upstream configuration.

Types#

This section describes the types used by the CRDs.

ActiveHealthCheck#

ActiveHealthCheck defines the active upstream health check configuration.

FieldDescription
type stringType is the health check type. Can be http, https, or tcp.
timeout DurationTimeout sets health check timeout in seconds.
concurrency integerConcurrency sets the number of targets to be checked at the same time.
host stringHost sets the upstream host.
port integerPort sets the upstream port.
httpPath stringHTTPPath sets the HTTP probe request path.
strictTLS booleanStrictTLS sets whether to enforce TLS.
requestHeaders string arrayRequestHeaders sets the request headers.
healthy ActiveHealthCheckHealthyHealthy configures the rules that define an upstream node as healthy.
unhealthy ActiveHealthCheckUnhealthyUnhealthy configures the rules that define an upstream node as unhealthy.

Appears in:

ActiveHealthCheckHealthy#

UpstreamActiveHealthCheckHealthy defines the conditions used to actively determine whether an upstream node is healthy.

FieldDescription
httpCodes integer arrayHTTPCodes define a list of HTTP status codes that are considered healthy.
successes integerSuccesses define the number of successful probes to define a healthy target.
interval DurationInterval defines the time interval for checking targets, in seconds.

Appears in:

ActiveHealthCheckUnhealthy#

UpstreamActiveHealthCheckHealthy defines the conditions used to actively determine whether an upstream node is unhealthy.

FieldDescription
httpCodes integer arrayHTTPCodes define a list of HTTP status codes that are considered unhealthy.
httpFailures integerHTTPFailures define the number of HTTP failures to define an unhealthy target.
tcpFailures integerTCPFailures define the number of TCP failures to define an unhealthy target.
timeout integerTimeout sets health check timeout in seconds.
interval DurationInterval defines the time interval for checking targets, in seconds.

Appears in:

ApisixConsumerAuthParameter#

FieldDescription
basicAuth ApisixConsumerBasicAuthBasicAuth configures the basic authentication details.
keyAuth ApisixConsumerKeyAuthKeyAuth configures the key authentication details.
wolfRBAC ApisixConsumerWolfRBACWolfRBAC configures the Wolf RBAC authentication details.
jwtAuth ApisixConsumerJwtAuthJwtAuth configures the JWT authentication details.
hmacAuth ApisixConsumerHMACAuthHMACAuth configures the HMAC authentication details.
ldapAuth ApisixConsumerLDAPAuthLDAPAuth configures the LDAP authentication details.

Appears in:

ApisixConsumerBasicAuth#

ApisixConsumerBasicAuth defines configuration for basic authentication.

FieldDescription
secretRef LocalObjectReferenceSecretRef references a Kubernetes Secret containing the basic authentication credentials.
value ApisixConsumerBasicAuthValueValue specifies the basic authentication credentials.

Appears in:

ApisixConsumerBasicAuthValue#

ApisixConsumerBasicAuthValue defines the username and password configuration for basic authentication.

FieldDescription
username stringUsername is the basic authentication username.
password stringPassword is the basic authentication password.

Appears in:

ApisixConsumerHMACAuth#

ApisixConsumerHMACAuth defines configuration for the HMAC authentication.

FieldDescription
secretRef LocalObjectReferenceSecretRef references a Kubernetes Secret containing the HMAC credentials.
value ApisixConsumerHMACAuthValueValue specifies HMAC authentication credentials.

Appears in:

ApisixConsumerHMACAuthValue#

ApisixConsumerHMACAuthValue defines configuration for HMAC authentication.

FieldDescription
access_key stringAccessKey is the identifier used to look up the HMAC secret.
secret_key stringSecretKey is the HMAC secret used to sign the request.
algorithm stringAlgorithm specifies the hashing algorithm (e.g., "hmac-sha256").
clock_skew integerClockSkew is the allowed time difference (in seconds) between client and server clocks.
signed_headers string arraySignedHeaders lists the headers that must be included in the signature.
keep_headers booleanKeepHeaders determines whether the HMAC signature headers are preserved after verification.
encode_uri_params booleanEncodeURIParams indicates whether URI parameters are encoded when calculating the signature.
validate_request_body booleanValidateRequestBody enables HMAC validation of the request body.
max_req_body integerMaxReqBody sets the maximum size (in bytes) of the request body that can be validated.

Appears in:

ApisixConsumerJwtAuth#

ApisixConsumerJwtAuth defines configuration for JWT authentication.

FieldDescription
secretRef LocalObjectReferenceSecretRef references a Kubernetes Secret containing JWT authentication credentials.
value ApisixConsumerJwtAuthValueValue specifies JWT authentication credentials.

Appears in:

ApisixConsumerJwtAuthValue#

ApisixConsumerJwtAuthValue defines configuration for JWT authentication.

FieldDescription
key stringKey is the unique identifier for the JWT credential.
secret stringSecret is the shared secret used to sign the JWT (for symmetric algorithms).
public_key stringPublicKey is the public key used to verify JWT signatures (for asymmetric algorithms).
private_key stringPrivateKey is the private key used to sign the JWT (for asymmetric algorithms).
algorithm stringAlgorithm specifies the signing algorithm. Can be HS256, HS512, RS256, or ES256.
exp integerExp is the token expiration period in seconds.
base64_secret booleanBase64Secret indicates whether the secret is base64-encoded.
lifetime_grace_period integerLifetimeGracePeriod is the allowed clock skew in seconds for token expiration.

Appears in:

ApisixConsumerKeyAuth#

ApisixConsumerKeyAuth defines configuration for the key auth.

FieldDescription
secretRef LocalObjectReferenceSecretRef references a Kubernetes Secret containing the key authentication credentials.
value ApisixConsumerKeyAuthValueValue specifies the key authentication credentials.

Appears in:

ApisixConsumerKeyAuthValue#

ApisixConsumerKeyAuthValue defines configuration for key authentication.

FieldDescription
key stringKey is the credential used for key authentication.

Appears in:

ApisixConsumerLDAPAuth#

ApisixConsumerLDAPAuth defines configuration for the LDAP authentication.

FieldDescription
secretRef LocalObjectReferenceSecretRef references a Kubernetes Secret containing the LDAP credentials.
value ApisixConsumerLDAPAuthValueValue specifies LDAP authentication credentials.

Appears in:

ApisixConsumerLDAPAuthValue#

ApisixConsumerLDAPAuthValue defines configuration for LDAP authentication.

FieldDescription
user_dn stringUserDN is the distinguished name (DN) of the LDAP user.

Appears in:

ApisixConsumerSpec#

ApisixConsumerSpec defines the desired state of ApisixConsumer.

FieldDescription
ingressClassName stringIngressClassName is the name of an IngressClass cluster resource. The controller uses this field to decide whether the resource should be managed.
authParameter ApisixConsumerAuthParameterAuthParameter defines the authentication credentials and configuration for this consumer.

Appears in:

ApisixConsumerWolfRBAC#

ApisixConsumerWolfRBAC defines configuration for the Wolf RBAC authentication.

FieldDescription
secretRef LocalObjectReferenceSecretRef references a Kubernetes Secret containing the Wolf RBAC token.
value ApisixConsumerWolfRBACValueValue specifies the Wolf RBAC token.

Appears in:

ApisixConsumerWolfRBACValue#

ApisixConsumerWolfRBACValue defines configuration for Wolf RBAC authentication.

FieldDescription
server stringServer is the URL of the Wolf RBAC server.
appid stringAppid is the application identifier used when communicating with the Wolf RBAC server.
header_prefix stringHeaderPrefix is the prefix added to request headers for RBAC enforcement.

Appears in:

ApisixGlobalRuleSpec#

ApisixGlobalRuleSpec defines configuration for global plugins.

FieldDescription
ingressClassName stringIngressClassName is the name of an IngressClass cluster resource. The controller uses this field to decide whether the resource should be managed.
plugins ApisixRoutePlugin arrayPlugins contain a list of global plugins.

Appears in:

ApisixMutualTlsClientConfig#

ApisixMutualTlsClientConfig describes the mutual TLS CA and verification settings.

FieldDescription
caSecret ApisixSecretCASecret references the secret containing the CA certificate for client certificate validation.
depth integerDepth specifies the maximum verification depth for the client certificate chain.
skip_mtls_uri_regex string arraySkipMTLSUriRegex contains RegEx patterns for URIs to skip mutual TLS verification.

Appears in:

ApisixPluginConfigSpec#

ApisixPluginConfigSpec defines the desired state of ApisixPluginConfigSpec.

FieldDescription
ingressClassName stringIngressClassName is the name of an IngressClass cluster resource. The controller uses this field to decide whether the resource should be managed.
plugins ApisixRoutePlugin arrayPlugins contain a list of plugins.

Appears in:

ApisixRouteAuthentication#

ApisixRouteAuthentication represents authentication-related configuration in ApisixRoute.

FieldDescription
enable booleanEnable toggles authentication on or off.
type stringType specifies the authentication type.
keyAuth ApisixRouteAuthenticationKeyAuthKeyAuth defines configuration for key authentication.
jwtAuth ApisixRouteAuthenticationJwtAuthJwtAuth defines configuration for JWT authentication.
ldapAuth ApisixRouteAuthenticationLDAPAuthLDAPAuth defines configuration for LDAP authentication.

Appears in:

ApisixRouteAuthenticationJwtAuth#

ApisixRouteAuthenticationJwtAuth defines JWT authentication configuration in ApisixRouteAuthentication.

FieldDescription
header stringHeader specifies the HTTP header name to look for the JWT token.
query stringQuery specifies the URL query parameter name to look for the JWT token.
cookie stringCookie specifies the cookie name to look for the JWT token.

Appears in:

ApisixRouteAuthenticationKeyAuth#

ApisixRouteAuthenticationKeyAuth defines key authentication configuration in ApisixRouteAuthentication.

FieldDescription
header stringHeader specifies the HTTP header name to look for the key authentication token.

Appears in:

ApisixRouteAuthenticationLDAPAuth#

ApisixRouteAuthenticationLDAPAuth defines LDAP authentication configuration in ApisixRouteAuthentication.

FieldDescription
base_dn stringBaseDN is the base distinguished name (DN) for LDAP searches.
ldap_uri stringLDAPURI is the URI of the LDAP server.
use_tls booleanUseTLS indicates whether to use TLS for the LDAP connection.
uid stringUID is the user identifier attribute in LDAP.

Appears in:

ApisixRouteHTTP#

ApisixRouteHTTP represents a single HTTP route configuration.

FieldDescription
name stringName is the unique rule name and cannot be empty.
priority integerPriority defines the route priority when multiple routes share the same URI path. Higher values mean higher priority in route matching.
timeout UpstreamTimeoutTimeout specifies upstream timeout settings.
match ApisixRouteHTTPMatchMatch defines the HTTP request matching criteria.
backends ApisixRouteHTTPBackend arrayBackends lists potential backend services to proxy requests to. If more than one backend is specified, the traffic-split plugin is used to distribute traffic according to backend weights.
upstreams ApisixRouteUpstreamReference arrayUpstreams references ApisixUpstream CRDs.
websocket booleanWebsocket enables or disables websocket support for this route.
plugin_config_name stringPluginConfigName specifies the name of the plugin config to apply.
plugin_config_namespace stringPluginConfigNamespace specifies the namespace of the plugin config. Defaults to the namespace of the ApisixRoute if not set.
plugins ApisixRoutePlugin arrayPlugins lists additional plugins applied to this route.
authentication ApisixRouteAuthenticationAuthentication holds authentication-related configuration for this route.

Appears in:

ApisixRouteHTTPBackend#

ApisixRouteHTTPBackend represents an HTTP backend (Kubernetes Service).

FieldDescription
serviceName stringServiceName is the name of the Kubernetes Service. Cross-namespace references are not supported—ensure the ApisixRoute and the Service are in the same namespace.
servicePort IntOrStringServicePort is the port of the Kubernetes Service. This can be either the port name or port number.
resolveGranularity stringResolveGranularity determines how the backend service is resolved. Valid values are endpoints and service. When set to endpoints, individual pod IPs will be used; otherwise, the Service's ClusterIP or ExternalIP is used. The default is endpoints.
weight integerWeight specifies the relative traffic weight for this backend.
subset stringSubset specifies a named subset of the target Service. The subset must be pre-defined in the corresponding ApisixUpstream resource.

Appears in:

ApisixRouteHTTPMatch#

ApisixRouteHTTPMatch defines the conditions used to match incoming HTTP requests.

FieldDescription
paths string arrayPaths is a list of URI path patterns to match. At least one path must be specified. Supports exact matches and prefix matches. For prefix matches, append * to the path, such as /foo*.
methods string arrayMethods specifies the HTTP methods to match.
hosts string arrayHosts specifies Host header values to match. Supports exact and wildcard domains. Only one level of wildcard is allowed (e.g., *.example.com is valid, but *.*.example.com is not).
remoteAddrs string arrayRemoteAddrs is a list of source IP addresses or CIDR ranges to match. Supports both IPv4 and IPv6 formats.
exprs ApisixRouteHTTPMatchExprsNginxVars defines match conditions based on Nginx variables.
filter_func stringFilterFunc is a user-defined function for advanced request filtering. The function can use Nginx variables through the vars parameter.

Appears in:

ApisixRouteHTTPMatchExpr#

ApisixRouteHTTPMatchExpr represents a binary expression used to match requests based on Nginx variables.

FieldDescription
subject ApisixRouteHTTPMatchExprSubjectSubject defines the left-hand side of the expression. It can be any APISIX variable or string literal.
op stringOp specifies the operator used in the expression. Can be Equal, NotEqual, GreaterThan, GreaterThanEqual, LessThan, LessThanEqual, RegexMatch, RegexNotMatch, RegexMatchCaseInsensitive, RegexNotMatchCaseInsensitive, In, or NotIn.
set string arraySet provides a list of acceptable values for the expression. This should be used when Op is In or NotIn.
value stringValue defines a single value to compare against the subject. This should be used when Op is not In or NotIn. Set and Value are mutually exclusive—only one should be set at a time.

Appears in:

ApisixRouteHTTPMatchExprSubject#

ApisixRouteHTTPMatchExprSubject describes the subject of a route matching expression.

FieldDescription
scope stringScope specifies the subject scope and can be Header, Query, or Path. When Scope is Path, Name will be ignored.
name stringName is the name of the header or query parameter.

Appears in:

ApisixRouteHTTPMatchExprs#

Base type: [ApisixRouteHTTPMatchExpr](#apisixroutehttpmatchexpr)

FieldDescription
subject ApisixRouteHTTPMatchExprSubjectSubject defines the left-hand side of the expression. It can be any APISIX variable or string literal.
op stringOp specifies the operator used in the expression. Can be Equal, NotEqual, GreaterThan, GreaterThanEqual, LessThan, LessThanEqual, RegexMatch, RegexNotMatch, RegexMatchCaseInsensitive, RegexNotMatchCaseInsensitive, In, or NotIn.
set string arraySet provides a list of acceptable values for the expression. This should be used when Op is In or NotIn.
value stringValue defines a single value to compare against the subject. This should be used when Op is not In or NotIn. Set and Value are mutually exclusive—only one should be set at a time.

Appears in:

ApisixRoutePlugin#

ApisixRoutePlugin represents an APISIX plugin.

FieldDescription
name stringThe plugin name.
enable booleanWhether this plugin is in use, default is true.
config JSONPlugin configuration.
secretRef stringPlugin configuration secretRef.

Appears in:

ApisixRouteSpec#

ApisixRouteSpec is the spec definition for ApisixRoute. It defines routing rules for both HTTP and stream traffic.

FieldDescription
ingressClassName stringIngressClassName is the name of the IngressClass this route belongs to. It allows multiple controllers to watch and reconcile different routes.
http ApisixRouteHTTP arrayHTTP defines a list of HTTP route rules. Each rule specifies conditions to match HTTP requests and how to forward them.
stream ApisixRouteStream arrayStream defines a list of stream route rules. Each rule specifies conditions to match TCP/UDP traffic and how to forward them.

Appears in:

ApisixRouteStream#

ApisixRouteStream defines the configuration for a Layer 4 (TCP/UDP) route.

FieldDescription
name stringName is a unique identifier for the route. This field must not be empty.
protocol stringProtocol specifies the L4 protocol to match. Can be tcp or udp.
match ApisixRouteStreamMatchMatch defines the criteria used to match incoming TCP or UDP connections.
backend ApisixRouteStreamBackendBackend specifies the destination service to which traffic should be forwarded.
plugins ApisixRoutePlugin arrayPlugins defines a list of plugins to apply to this route.

Appears in:

ApisixRouteStreamBackend#

ApisixRouteStreamBackend represents the backend service for a TCP or UDP stream route.

FieldDescription
serviceName stringServiceName is the name of the Kubernetes Service. Cross-namespace references are not supported—ensure the ApisixRoute and the Service are in the same namespace.
servicePort IntOrStringServicePort is the port of the Kubernetes Service. This can be either the port name or port number.
resolveGranularity stringResolveGranularity determines how the backend service is resolved. Valid values are endpoints and service. When set to endpoints, individual pod IPs will be used; otherwise, the Service's ClusterIP or ExternalIP is used. The default is endpoints.
subset stringSubset specifies a named subset of the target Service. The subset must be pre-defined in the corresponding ApisixUpstream resource.

Appears in:

ApisixRouteStreamMatch#

ApisixRouteStreamMatch represents the matching conditions for a stream route.

FieldDescription
ingressPort integerIngressPort is the port on which the APISIX Ingress proxy server listens. This must be a statically configured port, as APISIX does not support dynamic port binding.
host stringHost is the destination host address used to match the incoming TCP/UDP traffic.

Appears in:

ApisixRouteUpstreamReference#

ApisixRouteUpstreamReference references an ApisixUpstream CRD to be used as a backend. It can be used in traffic-splitting scenarios or to select a specific upstream configuration.

FieldDescription
name stringName is the name of the ApisixUpstream resource.
weight integerWeight is the weight assigned to this upstream.

Appears in:

ApisixSecret#

ApisixSecret describes a reference to a Kubernetes Secret, including its name and namespace. This is used to locate secrets such as certificates or credentials for plugins or TLS configuration.

FieldDescription
name stringName is the name of the Kubernetes Secret.
namespace stringNamespace is the namespace where the Kubernetes Secret is located.

Appears in:

ApisixTlsSpec#

ApisixTlsSpec defines configurations for TLS and mutual TLS.

FieldDescription
ingressClassName stringIngressClassName specifies which IngressClass this resource is associated with. The APISIX controller only processes this resource if the class matches its own.
hosts HostType arrayHosts lists the SNI (Server Name Indication) hostnames that this TLS configuration applies to. Must contain at least one host.
secret ApisixSecretSecret refers to the Kubernetes TLS secret containing the certificate and private key. This secret must exist in the specified namespace and contain valid TLS data.
client ApisixMutualTlsClientConfigClient defines mutual TLS (mTLS) settings, such as the CA certificate and verification depth.

Appears in:

ApisixUpstreamConfig#

ApisixUpstreamConfig defines configuration for upstream services.

FieldDescription
loadbalancer LoadBalancerLoadBalancer specifies the load balancer configuration for Kubernetes Service.
scheme stringScheme is the protocol used to communicate with the upstream. Default is http. Can be http, https, grpc, or grpcs.
retries integerRetries defines the number of retry attempts APISIX should make when a failure occurs. Failures include timeouts, network errors, or 5xx status codes.
timeout UpstreamTimeoutTimeout specifies the connection, send, and read timeouts for upstream requests.
healthCheck HealthCheckHealthCheck defines the active and passive health check configuration for the upstream. Deprecated: no longer supported in standalone mode.
tlsSecret ApisixSecretTLSSecret references a Kubernetes Secret that contains the client certificate and key for mutual TLS when connecting to the upstream.
subsets ApisixUpstreamSubset arraySubsets defines labeled subsets of service endpoints, typically used for service versioning or canary deployments.
passHost stringPassHost configures how the host header should be determined when a request is forwarded to the upstream. Default is pass. Can be pass, node or rewrite:
pass: preserve the original Host header
node: use the upstream node’s host
rewrite: set to a custom host via upstreamHost
upstreamHost stringUpstreamHost sets a custom Host header when passHost is set to rewrite.
discovery DiscoveryDiscovery configures service discovery for the upstream. Deprecated: no longer supported in standalone mode.

Appears in:

ApisixUpstreamExternalNode#

ApisixUpstreamExternalNode defines configuration for an external upstream node. This allows referencing services outside the cluster.

FieldDescription
name stringName is the hostname or IP address of the external node.
type ApisixUpstreamExternalTypeType indicates the kind of external node. Can be Domain, or Service.
weight integerWeight defines the load balancing weight of this node. Higher values increase the share of traffic sent to this node.
port integerPort specifies the port number on which the external node is accepting traffic.

Appears in:

ApisixUpstreamExternalType#

Base type: string

ApisixUpstreamExternalType is the external service type

Appears in:

ApisixUpstreamSpec#

ApisixUpstreamSpec describes the desired configuration of an ApisixUpstream resource. It defines how traffic should be routed to backend services, including upstream node definitions and custom configuration.

FieldDescription
ingressClassName stringIngressClassName is the name of an IngressClass cluster resource. Controller implementations use this field to determine whether they should process this ApisixUpstream resource.
externalNodes ApisixUpstreamExternalNode arrayExternalNodes defines a static list of backend nodes located outside the cluster. When this field is set, the upstream will route traffic directly to these nodes without DNS resolution or service discovery.
loadbalancer LoadBalancerLoadBalancer specifies the load balancer configuration for Kubernetes Service.
scheme stringScheme is the protocol used to communicate with the upstream. Default is http. Can be http, https, grpc, or grpcs.
retries integerRetries defines the number of retry attempts APISIX should make when a failure occurs. Failures include timeouts, network errors, or 5xx status codes.
timeout UpstreamTimeoutTimeout specifies the connection, send, and read timeouts for upstream requests.
healthCheck HealthCheckHealthCheck defines the active and passive health check configuration for the upstream. Deprecated: no longer supported in standalone mode.
tlsSecret ApisixSecretTLSSecret references a Kubernetes Secret that contains the client certificate and key for mutual TLS when connecting to the upstream.
subsets ApisixUpstreamSubset arraySubsets defines labeled subsets of service endpoints, typically used for service versioning or canary deployments.
passHost stringPassHost configures how the host header should be determined when a request is forwarded to the upstream. Default is pass. Can be pass, node or rewrite:
pass: preserve the original Host header
node: use the upstream node’s host
rewrite: set to a custom host via upstreamHost
upstreamHost stringUpstreamHost sets a custom Host header when passHost is set to rewrite.
discovery DiscoveryDiscovery configures service discovery for the upstream. Deprecated: no longer supported in standalone mode.
portLevelSettings PortLevelSettings arrayPortLevelSettings allows fine-grained upstream configuration for specific ports, useful when a backend service exposes multiple ports with different behaviors or protocols.

Appears in:

ApisixUpstreamSubset#

ApisixUpstreamSubset defines a single endpoints group of one Service.

FieldDescription
name stringName is the name of subset.
labels object (keys:string, values:string)Labels is the label set of this subset.

Appears in:

Discovery#

Discovery defines the service discovery configuration for dynamically resolving upstream nodes. This is used when APISIX integrates with a service registry such as Nacos, Consul, or Eureka.

FieldDescription
serviceName stringServiceName is the name of the service to discover.
type stringType is the name of the service discovery provider.
args object (keys:string, values:string)Args contains additional configuration parameters required by the discovery provider. These are passed as key-value pairs.

Appears in:

HealthCheck#

HealthCheck defines the health check configuration for upstream nodes. It includes active checks (proactively probing the nodes) and optional passive checks (monitoring based on traffic).

FieldDescription
active ActiveHealthCheckActive health checks proactively send requests to upstream nodes to determine their availability.
passive PassiveHealthCheckPassive health checks evaluate upstream health based on observed traffic, such as timeouts or errors.

Appears in:

HostType#

Base type: string

Appears in:

LoadBalancer#

LoadBalancer defines the load balancing strategy for distributing traffic across upstream nodes.

FieldDescription
type stringType specifies the load balancing algorithms to route traffic to the backend. Default is roundrobin. Can be roundrobin, chash, ewma, or least_conn.
hashOn stringHashOn specified the type of field used for hashing, required when type is chash. Default is vars. Can be vars, header, cookie, consumer, or vars_combinations.
key stringKey is used with HashOn, generally required when type is chash. When HashOn is header or cookie, specifies the name of the header or cookie. When HashOn is consumer, key is not required, as the consumer name is used automatically. When HashOn is vars or vars_combinations, key refers to one or a combination of APISIX variables.

Appears in:

PassiveHealthCheck#

PassiveHealthCheck defines the conditions used to determine whether an upstream node is healthy or unhealthy based on passive observations. Passive health checks rely on real traffic responses instead of active probes.

FieldDescription
type stringType specifies the type of passive health check. Can be http, https, or tcp.
healthy PassiveHealthCheckHealthyHealthy defines the conditions under which an upstream node is considered healthy.
unhealthy PassiveHealthCheckUnhealthyUnhealthy defines the conditions under which an upstream node is considered unhealthy.

Appears in:

PassiveHealthCheckHealthy#

PassiveHealthCheckHealthy defines the conditions used to passively determine whether an upstream node is healthy.

FieldDescription
httpCodes integer arrayHTTPCodes define a list of HTTP status codes that are considered healthy.
successes integerSuccesses define the number of successful probes to define a healthy target.

Appears in:

PassiveHealthCheckUnhealthy#

UpstreamPassiveHealthCheckUnhealthy defines the conditions used to passively determine whether an upstream node is unhealthy.

FieldDescription
httpCodes integer arrayHTTPCodes define a list of HTTP status codes that are considered unhealthy.
httpFailures integerHTTPFailures define the number of HTTP failures to define an unhealthy target.
tcpFailures integerTCPFailures define the number of TCP failures to define an unhealthy target.
timeout integerTimeout sets health check timeout in seconds.

Appears in:

PortLevelSettings#

PortLevelSettings configures the ApisixUpstreamConfig for each individual port. It inherits configuration from the outer level (the whole Kubernetes Service) and overrides some of them if they are set on the port level.

FieldDescription
loadbalancer LoadBalancerLoadBalancer specifies the load balancer configuration for Kubernetes Service.
scheme stringScheme is the protocol used to communicate with the upstream. Default is http. Can be http, https, grpc, or grpcs.
retries integerRetries defines the number of retry attempts APISIX should make when a failure occurs. Failures include timeouts, network errors, or 5xx status codes.
timeout UpstreamTimeoutTimeout specifies the connection, send, and read timeouts for upstream requests.
healthCheck HealthCheckHealthCheck defines the active and passive health check configuration for the upstream. Deprecated: no longer supported in standalone mode.
tlsSecret ApisixSecretTLSSecret references a Kubernetes Secret that contains the client certificate and key for mutual TLS when connecting to the upstream.
subsets ApisixUpstreamSubset arraySubsets defines labeled subsets of service endpoints, typically used for service versioning or canary deployments.
passHost stringPassHost configures how the host header should be determined when a request is forwarded to the upstream. Default is pass. Can be pass, node or rewrite:
pass: preserve the original Host header
node: use the upstream node’s host
rewrite: set to a custom host via upstreamHost
upstreamHost stringUpstreamHost sets a custom Host header when passHost is set to rewrite.
discovery DiscoveryDiscovery configures service discovery for the upstream. Deprecated: no longer supported in standalone mode.
port integerPort is a Kubernetes Service port.

Appears in:

UpstreamTimeout#

UpstreamTimeout defines timeout settings for connecting, sending, and reading from the upstream.

FieldDescription
connect DurationConnect timeout for establishing a connection to the upstream.
send DurationSend timeout for sending data to the upstream.
read DurationRead timeout for reading data from the upstream.

Appears in: