Skip to main content
Version: Next

v2 API Reference

Packages:

apisix.apache.org/v2#

Resource Types:

ApisixGlobalRule#

ApisixGlobalRule is the Schema for the ApisixGlobalRule resource. An ApisixGlobalRule is used to support a group of plugin configs

FieldDescription
apiVersion
string
apisix.apache.org/v2
kind
string
ApisixGlobalRule
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ApisixGlobalRuleSpec

Spec defines the desired state of ApisixGlobalRuleSpec.



plugins
[]ApisixRoutePlugin

Plugins contains a list of ApisixRoutePlugin

status
ApisixStatus

ApisixPluginConfig#

ApisixPluginConfig is the Schema for the ApisixPluginConfig resource. An ApisixPluginConfig is used to support a group of plugin configs

FieldDescription
apiVersion
string
apisix.apache.org/v2
kind
string
ApisixPluginConfig
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ApisixPluginConfigSpec

Spec defines the desired state of ApisixPluginConfigSpec.



plugins
[]ApisixRoutePlugin

Plugins contains a list of ApisixRoutePlugin

status
ApisixStatus

ActiveHealthCheck#

(Appears on:HealthCheck)

ActiveHealthCheck defines the active kind of upstream health check.

FieldDescription
type
string
timeout
time.Duration
concurrency
int
host
string
port
int32
httpPath
string
strictTLS
bool
requestHeaders
[]string
healthy
ActiveHealthCheckHealthy
unhealthy
ActiveHealthCheckUnhealthy

ActiveHealthCheckHealthy#

(Appears on:ActiveHealthCheck)

ActiveHealthCheckHealthy defines the conditions to judge whether an upstream node is healthy with the active manner.

FieldDescription
PassiveHealthCheckHealthy
PassiveHealthCheckHealthy

(Members of PassiveHealthCheckHealthy are embedded into this type.)

interval
Kubernetes meta/v1.Duration

ActiveHealthCheckUnhealthy#

(Appears on:ActiveHealthCheck)

ActiveHealthCheckUnhealthy defines the conditions to judge whether an upstream node is unhealthy with the active manager.

FieldDescription
PassiveHealthCheckUnhealthy
PassiveHealthCheckUnhealthy

(Members of PassiveHealthCheckUnhealthy are embedded into this type.)

interval
Kubernetes meta/v1.Duration

ApisixClusterAdminConfig#

(Appears on:ApisixClusterConfigSpec)

ApisixClusterAdminConfig is the admin config for the corresponding APISIX Cluster.

FieldDescription
baseURL
string

BaseURL is the base URL for the APISIX Admin API. It looks like “http://apisix-admin.default.svc.cluster.local:9080/apisix/admin”

adminKey
string

AdminKey is used to verify the admin API user.

clientTimeout
github.com/apache/apisix-ingress-controller/pkg/types.TimeDuration

ClientTimeout is request timeout for the APISIX Admin API client

ApisixClusterConfig#

ApisixClusterConfig is the Schema for the ApisixClusterConfig resource. An ApisixClusterConfig is used to identify an APISIX cluster, it’s a ClusterScoped resource so the name is unique. It also contains some cluster-level configurations like monitoring.

FieldDescription
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ApisixClusterConfigSpec

Spec defines the desired state of ApisixClusterConfigSpec.



monitoring
ApisixClusterMonitoringConfig
(Optional)

Monitoring categories all monitoring related features.

admin
ApisixClusterAdminConfig
(Optional)

Admin contains the Admin API information about APISIX cluster.

status
ApisixStatus

ApisixClusterConfigSpec#

(Appears on:ApisixClusterConfig)

ApisixClusterConfigSpec defines the desired state of ApisixClusterConfigSpec.

FieldDescription
monitoring
ApisixClusterMonitoringConfig
(Optional)

Monitoring categories all monitoring related features.

admin
ApisixClusterAdminConfig
(Optional)

Admin contains the Admin API information about APISIX cluster.

ApisixClusterMonitoringConfig#

(Appears on:ApisixClusterConfigSpec)

ApisixClusterMonitoringConfig categories all monitoring related features.

FieldDescription
prometheus
ApisixClusterPrometheusConfig
(Optional)

Prometheus is the config for using Prometheus in APISIX Cluster.

skywalking
ApisixClusterSkywalkingConfig
(Optional)

Skywalking is the config for using Skywalking in APISIX Cluster.

ApisixClusterPrometheusConfig#

(Appears on:ApisixClusterMonitoringConfig)

ApisixClusterPrometheusConfig is the config for using Prometheus in APISIX Cluster.

FieldDescription
enable
bool

Enable means whether enable Prometheus or not.

ApisixClusterSkywalkingConfig#

(Appears on:ApisixClusterMonitoringConfig)

ApisixClusterSkywalkingConfig is the config for using Skywalking in APISIX Cluster.

FieldDescription
enable
bool

Enable means whether enable Skywalking or not.

sampleRatio
float64

SampleRatio means the ratio to collect

ApisixConsumer#

ApisixConsumer is the Schema for the ApisixConsumer resource. An ApisixConsumer is used to identify a consumer.

FieldDescription
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ApisixConsumerSpec


authParameter
ApisixConsumerAuthParameter
status
ApisixStatus

ApisixConsumerAuthParameter#

(Appears on:ApisixConsumerSpec)

FieldDescription
basicAuth
ApisixConsumerBasicAuth
keyAuth
ApisixConsumerKeyAuth
wolfRBAC
ApisixConsumerWolfRBAC
jwtAuth
ApisixConsumerJwtAuth
hmacAuth
ApisixConsumerHMACAuth

ApisixConsumerBasicAuth#

(Appears on:ApisixConsumerAuthParameter)

ApisixConsumerBasicAuth defines the configuration for basic auth.

FieldDescription
secretRef
Kubernetes core/v1.LocalObjectReference
value
ApisixConsumerBasicAuthValue

ApisixConsumerBasicAuthValue#

(Appears on:ApisixConsumerBasicAuth)

ApisixConsumerBasicAuthValue defines the in-place username and password configuration for basic auth.

FieldDescription
username
string
password
string

ApisixConsumerHMACAuth#

(Appears on:ApisixConsumerAuthParameter)

ApisixConsumerHMACAuth defines the configuration for the hmac auth.

FieldDescription
secretRef
Kubernetes core/v1.LocalObjectReference
value
ApisixConsumerHMACAuthValue

ApisixConsumerHMACAuthValue#

(Appears on:ApisixConsumerHMACAuth)

ApisixConsumerHMACAuthValue defines the in-place configuration for hmac auth.

FieldDescription
access_key
string
secret_key
string
algorithm
string
clock_skew
int64
signed_headers
[]string
keep_headers
bool
encode_uri_params
bool
validate_request_body
bool
max_req_body
int64

ApisixConsumerJwtAuth#

(Appears on:ApisixConsumerAuthParameter)

ApisixConsumerJwtAuth defines the configuration for the jwt auth.

FieldDescription
secretRef
Kubernetes core/v1.LocalObjectReference
value
ApisixConsumerJwtAuthValue

ApisixConsumerJwtAuthValue#

(Appears on:ApisixConsumerJwtAuth)

ApisixConsumerJwtAuthValue defines the in-place configuration for jwt auth.

FieldDescription
key
string
secret
string
public_key
string
private_key
string
algorithm
string
exp
int64
base64_secret
bool

ApisixConsumerKeyAuth#

(Appears on:ApisixConsumerAuthParameter)

ApisixConsumerKeyAuth defines the configuration for the key auth.

FieldDescription
secretRef
Kubernetes core/v1.LocalObjectReference
value
ApisixConsumerKeyAuthValue

ApisixConsumerKeyAuthValue#

(Appears on:ApisixConsumerKeyAuth)

ApisixConsumerKeyAuthValue defines the in-place configuration for basic auth.

FieldDescription
key
string

ApisixConsumerSpec#

(Appears on:ApisixConsumer)

ApisixConsumerSpec defines the desired state of ApisixConsumer.

FieldDescription
authParameter
ApisixConsumerAuthParameter

ApisixConsumerWolfRBAC#

(Appears on:ApisixConsumerAuthParameter)

ApisixConsumerWolfRBAC defines the configuration for the wolf-rbac auth.

FieldDescription
secretRef
Kubernetes core/v1.LocalObjectReference
value
ApisixConsumerWolfRBACValue

ApisixConsumerWolfRBACValue#

(Appears on:ApisixConsumerWolfRBAC)

ApisixConsumerWolfRBAC defines the in-place server and appid and header_prefix configuration for wolf-rbac auth.

FieldDescription
server
string
appid
string
header_prefix
string

ApisixGlobalRuleSpec#

(Appears on:ApisixGlobalRule)

ApisixGlobalRuleSpec defines the desired state of ApisixGlobalRuleSpec.

FieldDescription
plugins
[]ApisixRoutePlugin

Plugins contains a list of ApisixRoutePlugin

ApisixMutualTlsClientConfig#

(Appears on:ApisixTlsSpec)

ApisixMutualTlsClientConfig describes the mutual TLS CA and verify depth

FieldDescription
caSecret
ApisixSecret
depth
int

ApisixPluginConfigSpec#

(Appears on:ApisixPluginConfig)

ApisixPluginConfigSpec defines the desired state of ApisixPluginConfigSpec.

FieldDescription
plugins
[]ApisixRoutePlugin

Plugins contains a list of ApisixRoutePlugin

ApisixRoute#

ApisixRoute is used to define the route rules and upstreams for Apache APISIX.

FieldDescription
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ApisixRouteSpec


http
[]ApisixRouteHTTP
stream
[]ApisixRouteStream
status
ApisixStatus

ApisixRouteAuthentication#

(Appears on:ApisixRouteHTTP)

ApisixRouteAuthentication is the authentication-related configuration in ApisixRoute.

FieldDescription
enable
bool
type
string
keyAuth
ApisixRouteAuthenticationKeyAuth
jwtAuth
ApisixRouteAuthenticationJwtAuth

ApisixRouteAuthenticationJwtAuth#

(Appears on:ApisixRouteAuthentication)

ApisixRouteAuthenticationJwtAuth is the jwt auth related configuration in ApisixRouteAuthentication.

FieldDescription
header
string
query
string
cookie
string

ApisixRouteAuthenticationKeyAuth#

(Appears on:ApisixRouteAuthentication)

ApisixRouteAuthenticationKeyAuth is the keyAuth-related configuration in ApisixRouteAuthentication.

FieldDescription
header
string

ApisixRouteHTTP#

(Appears on:ApisixRouteSpec)

ApisixRouteHTTP represents a single route in for HTTP traffic.

FieldDescription
name
string

The rule name, cannot be empty.

priority
int

Route priority, when multiple routes contains same URI path (for path matching), route with higher priority will take effect.

timeout
UpstreamTimeout
match
ApisixRouteHTTPMatch
backends
[]ApisixRouteHTTPBackend

Backends represents potential backends to proxy after the route rule matched. When number of backends are more than one, traffic-split plugin in APISIX will be used to split traffic based on the backend weight.

upstreams
[]ApisixRouteUpstreamReference

Upstreams refer to ApisixUpstream CRD

websocket
bool
plugin_config_name
string
plugins
[]ApisixRoutePlugin
authentication
ApisixRouteAuthentication

ApisixRouteHTTPBackend#

(Appears on:ApisixRouteHTTP)

ApisixRouteHTTPBackend represents an HTTP backend (a Kubernetes Service).

FieldDescription
serviceName
string

The name (short) of the service, note cross namespace is forbidden, so be sure the ApisixRoute and Service are in the same namespace.

servicePort
k8s.io/apimachinery/pkg/util/intstr.IntOrString

The service port, could be the name or the port number.

resolveGranularity
string

The resolve granularity, can be “endpoints” or “service”, when set to “endpoints”, the pod ips will be used; other wise, the service ClusterIP or ExternalIP will be used, default is endpoints.

weight
int

Weight of this backend.

subset
string

Subset specifies a subset for the target Service. The subset should be pre-defined in ApisixUpstream about this service.

ApisixRouteHTTPMatch#

(Appears on:ApisixRouteHTTP)

ApisixRouteHTTPMatch represents the match condition for hitting this route.

FieldDescription
paths
[]string

URI path predicates, at least one path should be configured, path could be exact or prefix, for prefix path, append “” after it, for instance, “/foo”.

methods
[]string

HTTP request method predicates.

hosts
[]string

HTTP Host predicates, host can be a wildcard domain or an exact domain. For wildcard domain, only one generic level is allowed, for instance, “.foo.com” is valid but “.*.foo.com” is not.

remoteAddrs
[]string

Remote address predicates, items can be valid IPv4 address or IPv6 address or CIDR.

exprs
[]ApisixRouteHTTPMatchExpr

NginxVars represents generic match predicates, it uses Nginx variable systems, so any predicate like headers, querystring and etc can be leveraged here to match the route. For instance, it can be: nginxVars: - subject: “$remote_addr” op: in value: - “127.0.0.1” - “10.0.5.11”

filter_func
string

Matches based on a user-defined filtering function. These functions can accept an input parameter varswhich can be used to access the Nginx variables.

ApisixRouteHTTPMatchExpr#

(Appears on:ApisixRouteHTTPMatch)

ApisixRouteHTTPMatchExpr represents a binary route match expression .

FieldDescription
subject
ApisixRouteHTTPMatchExprSubject

Subject is the expression subject, it can be any string composed by literals and nginx vars.

op
string

Op is the operator.

set
[]string

Set is an array type object of the expression. It should be used when the Op is “in” or “not_in”;

value
string

Value is the normal type object for the expression, it should be used when the Op is not “in” and “not_in”. Set and Value are exclusive so only of them can be set in the same time.

ApisixRouteHTTPMatchExprSubject#

(Appears on:ApisixRouteHTTPMatchExpr)

ApisixRouteHTTPMatchExprSubject describes the route match expression subject.

FieldDescription
scope
string

The subject scope, can be: ScopeQuery, ScopeHeader, ScopePath when subject is ScopePath, Name field will be ignored.

name
string

The name of subject.

ApisixRoutePlugin#

(Appears on:ApisixGlobalRuleSpec, ApisixPluginConfigSpec, ApisixRouteHTTP, ApisixRouteStream)

ApisixRoutePlugin represents an APISIX plugin.

FieldDescription
name
string

The plugin name.

enable
bool

Whether this plugin is in use, default is true.

config
ApisixRoutePluginConfig

Plugin configuration.

secretRef
string

Plugin configuration secretRef.

ApisixRoutePluginConfig (map[string]interface alias)#

(Appears on:ApisixRoutePlugin)

ApisixRoutePluginConfig is the configuration for any plugins.

ApisixRouteSpec#

(Appears on:ApisixRoute)

ApisixRouteSpec is the spec definition for ApisixRouteSpec.

FieldDescription
http
[]ApisixRouteHTTP
stream
[]ApisixRouteStream

ApisixRouteStream#

(Appears on:ApisixRouteSpec)

ApisixRouteStream is the configuration for level 4 route

FieldDescription
name
string

The rule name, cannot be empty.

protocol
string
match
ApisixRouteStreamMatch
backend
ApisixRouteStreamBackend
plugins
[]ApisixRoutePlugin

ApisixRouteStreamBackend#

(Appears on:ApisixRouteStream)

ApisixRouteStreamBackend represents a TCP backend (a Kubernetes Service).

FieldDescription
serviceName
string

The name (short) of the service, note cross namespace is forbidden, so be sure the ApisixRoute and Service are in the same namespace.

servicePort
k8s.io/apimachinery/pkg/util/intstr.IntOrString

The service port, could be the name or the port number.

resolveGranularity
string

The resolve granularity, can be “endpoints” or “service”, when set to “endpoints”, the pod ips will be used; other wise, the service ClusterIP or ExternalIP will be used, default is endpoints.

subset
string

Subset specifies a subset for the target Service. The subset should be pre-defined in ApisixUpstream about this service.

ApisixRouteStreamMatch#

(Appears on:ApisixRouteStream)

ApisixRouteStreamMatch represents the match conditions of stream route.

FieldDescription
ingressPort
int32

IngressPort represents the port listening on the Ingress proxy server. It should be pre-defined as APISIX doesn’t support dynamic listening.

host
string

ApisixRouteUpstreamReference#

(Appears on:ApisixRouteHTTP)

ApisixRouteUpstreamReference contains a ApisixUpstream CRD reference

FieldDescription
name
string
weight
int
(Optional)

ApisixSecret#

(Appears on:ApisixMutualTlsClientConfig, ApisixTlsSpec, ApisixUpstreamConfig)

ApisixSecret describes the Kubernetes Secret name and namespace.

FieldDescription
name
string
namespace
string

ApisixStatus#

(Appears on:ApisixGlobalRule, ApisixPluginConfig, ApisixClusterConfig, ApisixConsumer, ApisixRoute, ApisixTls, ApisixUpstream)

ApisixStatus is the status report for Apisix ingress Resources

FieldDescription
conditions
[]Kubernetes meta/v1.Condition

ApisixTls#

ApisixTls defines SSL resource in APISIX.

FieldDescription
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ApisixTlsSpec


status
ApisixStatus
(Optional)

ApisixTlsSpec#

(Appears on:ApisixTls)

ApisixTlsSpec is the specification of ApisixSSL.

FieldDescription
hosts
[]HostType
secret
ApisixSecret
client
ApisixMutualTlsClientConfig
(Optional)

ApisixUpstream#

ApisixUpstream is a decorator for Kubernetes Service, it arms the Service with rich features like health check, retry policies, load balancer and others. It’s designed to have same name with the Kubernetes Service and can be customized for individual port.

FieldDescription
metadata
Kubernetes meta/v1.ObjectMeta
Refer to the Kubernetes API documentation for the fields of themetadata field.
spec
ApisixUpstreamSpec


status
ApisixStatus

ApisixUpstreamConfig#

(Appears on:ApisixUpstreamSpec, PortLevelSettings)

ApisixUpstreamConfig contains rich features on APISIX Upstream, for instance load balancer, health check, etc.

FieldDescription
loadbalancer
LoadBalancer
(Optional)

LoadBalancer represents the load balancer configuration for Kubernetes Service. The default strategy is round robin.

scheme
string
(Optional)

The scheme used to talk with the upstream. Now value can be http, grpc.

retries
int
(Optional)

How many times that the proxy (Apache APISIX) should do when errors occur (error, timeout or bad http status codes like 500, 502).

timeout
UpstreamTimeout
(Optional)

Timeout settings for the read, send and connect to the upstream.

healthCheck
HealthCheck
(Optional)

The health check configurations for the upstream.

tlsSecret
ApisixSecret
(Optional)

Set the client certificate when connecting to TLS upstream.

subsets
[]ApisixUpstreamSubset
(Optional)

Subsets groups the service endpoints by their labels. Usually used to differentiate service versions.

discovery
Discovery
(Optional)

Discovery is used to configure service discovery for upstream.

ApisixUpstreamExternalNode#

(Appears on:ApisixUpstreamSpec)

ApisixUpstreamExternalNode is the external node conf

FieldDescription
name
string
type
ApisixUpstreamExternalType
weight
int
(Optional)
port
int
(Optional)

Port defines the port of the external node

ApisixUpstreamExternalType (string alias)#

(Appears on:ApisixUpstreamExternalNode)

ApisixUpstreamExternalType is the external service type

ValueDescription

"Domain"

ExternalTypeDomain type is a domain

"Service"

ExternalTypeService type is a K8s ExternalName service

ApisixUpstreamSpec#

(Appears on:ApisixUpstream)

ApisixUpstreamSpec describes the specification of ApisixUpstream.

FieldDescription
externalNodes
[]ApisixUpstreamExternalNode
(Optional)

ExternalNodes contains external nodes the Upstream should use If this field is set, the upstream will use these nodes directly without any further resolves

ApisixUpstreamConfig
ApisixUpstreamConfig

(Members of ApisixUpstreamConfig are embedded into this type.)

portLevelSettings
[]PortLevelSettings

ApisixUpstreamSubset#

(Appears on:ApisixUpstreamConfig)

ApisixUpstreamSubset defines a single endpoints group of one Service.

FieldDescription
name
string

Name is the name of subset.

labels
map[string]string

Labels is the label set of this subset.

Config (map[string]interface alias)#

(Appears on:Plugin)

ConfigSet ([]interface alias)#

(Appears on:Plugin)

Discovery#

(Appears on:ApisixUpstreamConfig)

Discovery defines Service discovery related configuration.

FieldDescription
serviceName
string
type
string
args
map[string]string

HealthCheck#

(Appears on:ApisixUpstreamConfig)

HealthCheck describes the upstream health check parameters.

FieldDescription
active
ActiveHealthCheck
passive
PassiveHealthCheck

HostType (string alias)#

(Appears on:ApisixTlsSpec)

LoadBalancer#

(Appears on:ApisixUpstreamConfig)

LoadBalancer describes the load balancing parameters.

FieldDescription
type
string
hashOn
string

The HashOn and Key fields are required when Type is “chash”. HashOn represents the key fetching scope.

key
string

Key represents the hash key.

PassiveHealthCheck#

(Appears on:HealthCheck)

PassiveHealthCheck defines the conditions to judge whether an upstream node is healthy with the passive manager.

FieldDescription
type
string
healthy
PassiveHealthCheckHealthy
unhealthy
PassiveHealthCheckUnhealthy

PassiveHealthCheckHealthy#

(Appears on:ActiveHealthCheckHealthy, PassiveHealthCheck)

PassiveHealthCheckHealthy defines the conditions to judge whether an upstream node is healthy with the passive manner.

FieldDescription
httpCodes
[]int
successes
int

PassiveHealthCheckUnhealthy#

(Appears on:ActiveHealthCheckUnhealthy, PassiveHealthCheck)

PassiveHealthCheckUnhealthy defines the conditions to judge whether an upstream node is unhealthy with the passive manager.

FieldDescription
httpCodes
[]int
httpFailures
int
tcpFailures
int
timeout
int

Plugin#

FieldDescription
name
string
enable
bool
config
Config
config_set
ConfigSet

PortLevelSettings#

(Appears on:ApisixUpstreamSpec)

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

FieldDescription
ApisixUpstreamConfig
ApisixUpstreamConfig

(Members of ApisixUpstreamConfig are embedded into this type.)

port
int32

Port is a Kubernetes Service port, it should be already defined.

UpstreamTimeout#

(Appears on:ApisixRouteHTTP, ApisixUpstreamConfig)

UpstreamTimeout is settings for the read, send and connect to the upstream.

FieldDescription
connect
Kubernetes meta/v1.Duration
send
Kubernetes meta/v1.Duration
read
Kubernetes meta/v1.Duration

Generated with gen-crd-api-reference-docson git commit fa57ff5.