Skip to content

Commit f7060fe

Browse files
committed
update CRD docs
1 parent ae9fbc3 commit f7060fe

17 files changed

+270
-274
lines changed

api/adc/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ type TrafficSplitConfigRuleWeightedUpstream struct {
316316
// UpstreamID is the identifier of a pre-defined upstream.
317317
UpstreamID string `json:"upstream_id,omitempty"`
318318

319-
// Upstream specifies an inline upstream configuration.
319+
// Upstream specifies upstream configuration.
320320
// If provided, it overrides UpstreamID.
321321
Upstream *Upstream `json:"upstream,omitempty"`
322322

api/v1alpha1/backendtrafficpolicy_types.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,10 @@ type BackendTrafficPolicySpec struct {
6262

6363
// PassHost configures how the host header should be determined when a
6464
// request is forwarded to the upstream.
65-
// Default is `pass`.
66-
// Can be `pass`, `node` or `rewrite`.
67-
// - `pass`: preserve the original Host header
68-
// - `node`: use the upstream node’s host
69-
// - `rewrite`: set to a custom host via upstreamHost
65+
// Default is `pass`. Can be `pass`, `node` or `rewrite`:
66+
// * `pass`: preserve the original Host header
67+
// * `node`: use the upstream node’s host
68+
// * `rewrite`: set to a custom host via `upstreamHost`
7069
//
7170
// +kubebuilder:validation:Enum=pass;node;rewrite;
7271
// +kubebuilder:default=pass
@@ -80,7 +79,7 @@ type BackendTrafficPolicySpec struct {
8079
// LoadBalancer describes the load balancing parameters.
8180
// +kubebuilder:validation:XValidation:rule="!(has(self.key) && self.type != 'chash')"
8281
type LoadBalancer struct {
83-
// Type specifies the load balancing algorithms.
82+
// Type specifies the load balancing algorithms to route traffic to the backend.
8483
// Default is `roundrobin`.
8584
// Can be `roundrobin`, `chash`, `ewma`, or `least_conn`.
8685
// +kubebuilder:validation:Enum=roundrobin;chash;ewma;least_conn;

api/v2/apisixconsumer_types.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ import (
2525
// ApisixConsumerSpec defines the desired state of ApisixConsumer.
2626
type ApisixConsumerSpec struct {
2727
// IngressClassName is the name of an IngressClass cluster resource.
28-
// controller implementations use this field to know whether they should be
29-
// serving this ApisixConsumer resource, by a transitive connection
30-
// (controller -> IngressClass -> ApisixConsumer resource).
28+
// The controller uses this field to decide whether the resource should be managed.
3129
IngressClassName string `json:"ingressClassName,omitempty" yaml:"ingressClassName,omitempty"`
3230

31+
// AuthParameter defines the authentication credentials and configuration for this consumer.
3332
AuthParameter ApisixConsumerAuthParameter `json:"authParameter" yaml:"authParameter"`
3433
}
3534

@@ -78,7 +77,7 @@ type ApisixConsumerAuthParameter struct {
7877
type ApisixConsumerBasicAuth struct {
7978
// SecretRef references a Kubernetes Secret containing the basic authentication credentials.
8079
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
81-
// Value specifies the basic auth credentials.
80+
// Value specifies the basic authentication credentials.
8281
Value *ApisixConsumerBasicAuthValue `json:"value,omitempty" yaml:"value,omitempty"`
8382
}
8483
// ApisixConsumerBasicAuthValue defines the username and password configuration for basic authentication.
@@ -125,7 +124,7 @@ type ApisixConsumerWolfRBACValue struct {
125124
type ApisixConsumerJwtAuth struct {
126125
// SecretRef references a Kubernetes Secret containing JWT authentication credentials.
127126
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
128-
// Value specifies the inline JWT authentication credentials.
127+
// Value specifies JWT authentication credentials.
129128
Value *ApisixConsumerJwtAuthValue `json:"value,omitempty" yaml:"value,omitempty"`
130129
}
131130

@@ -141,7 +140,7 @@ type ApisixConsumerJwtAuthValue struct {
141140
PrivateKey string `json:"private_key" yaml:"private_key,omitempty"`
142141
// Algorithm specifies the signing algorithm.
143142
// Can be `HS256`, `HS384`, `HS512`, `RS256`, `RS384`, `RS512`, `ES256`, `ES384`, `ES512`, `PS256`, `PS384`, `PS512`, or `EdDSA`.
144-
// Currently APISIX only supports `HS256`, `HS512`, `RS256`, and `ES256`. Enterprise supports all algorithms.
143+
// Currently APISIX only supports `HS256`, `HS512`, `RS256`, and `ES256`. API7 Enterprise supports all algorithms.
145144
Algorithm string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
146145
// Exp is the token expiration period in seconds.
147146
Exp int64 `json:"exp,omitempty" yaml:"exp,omitempty"`
@@ -155,7 +154,7 @@ type ApisixConsumerJwtAuthValue struct {
155154
type ApisixConsumerHMACAuth struct {
156155
// SecretRef references a Kubernetes Secret containing the HMAC credentials.
157156
SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
158-
// Value specifies the inline HMAC authentication credentials.
157+
// Value specifies HMAC authentication credentials.
159158
Value *ApisixConsumerHMACAuthValue `json:"value,omitempty" yaml:"value,omitempty"`
160159
}
161160

@@ -185,7 +184,7 @@ type ApisixConsumerHMACAuthValue struct {
185184
type ApisixConsumerLDAPAuth struct {
186185
// SecretRef references a Kubernetes Secret containing the LDAP credentials.
187186
SecretRef *corev1.LocalObjectReference `json:"secretRef" yaml:"secret"`
188-
// Value specifies the inline LDAP authentication credentials.
187+
// Value specifies LDAP authentication credentials.
189188
Value *ApisixConsumerLDAPAuthValue `json:"value,omitempty" yaml:"value,omitempty"`
190189
}
191190

api/v2/apisixglobalrule_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ import (
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
2323

24-
// ApisixGlobalRuleSpec defines the desired state of ApisixGlobalRule.
24+
// ApisixGlobalRuleSpec defines configuration for global plugins.
2525
type ApisixGlobalRuleSpec struct {
2626
// IngressClassName is the name of an IngressClass cluster resource.
27-
// The controller uses this field to decide whether the resource should be managed or not.
27+
// The controller uses this field to decide whether the resource should be managed.
2828
IngressClassName string `json:"ingressClassName,omitempty" yaml:"ingressClassName,omitempty"`
29-
// Plugins contains a list of ApisixRoutePlugin
29+
// Plugins contain a list of global plugins.
3030
// +kubebuilder:validation:Required
3131
Plugins []ApisixRoutePlugin `json:"plugins" yaml:"plugins"`
3232
}

api/v2/apisixpluginconfig_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
// ApisixPluginConfigSpec defines the desired state of ApisixPluginConfigSpec.
2525
type ApisixPluginConfigSpec struct {
2626
// IngressClassName is the name of an IngressClass cluster resource.
27-
// The controller uses this field to decide whether the resource should be managed or not.
27+
// The controller uses this field to decide whether the resource should be managed.
2828
// +kubebuilder:validation:Optional
2929
IngressClassName string `json:"ingressClassName,omitempty" yaml:"ingressClassName,omitempty"`
3030
// Plugins contain a list of plugins.

api/v2/apisixroute_types.go

Lines changed: 56 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type ApisixRouteSpec struct {
3838
// Each rule specifies conditions to match HTTP requests and how to forward them.
3939
HTTP []ApisixRouteHTTP `json:"http,omitempty" yaml:"http,omitempty"`
4040
// Stream defines a list of stream route rules.
41-
// Each rule specifies conditions to match TCP/UDP traffic and how to forward it.
41+
// Each rule specifies conditions to match TCP/UDP traffic and how to forward them.
4242
Stream []ApisixRouteStream `json:"stream,omitempty" yaml:"stream,omitempty"`
4343
}
4444

@@ -86,7 +86,7 @@ type ApisixRouteHTTP struct {
8686
// Match defines the HTTP request matching criteria.
8787
Match ApisixRouteHTTPMatch `json:"match,omitempty" yaml:"match,omitempty"`
8888
// Backends lists potential backend services to proxy requests to.
89-
// If more than one backend is specified, the traffic-split plugin is used
89+
// If more than one backend is specified, the `traffic-split` plugin is used
9090
// to distribute traffic according to backend weights.
9191
Backends []ApisixRouteHTTPBackend `json:"backends,omitempty" yaml:"backends,omitempty"`
9292
// Upstreams references ApisixUpstream CRDs.
@@ -106,17 +106,17 @@ type ApisixRouteHTTP struct {
106106
Authentication ApisixRouteAuthentication `json:"authentication,omitempty" yaml:"authentication,omitempty"`
107107
}
108108

109-
// ApisixRouteStream defines configuration for a Layer 4 (TCP/UDP) route.
109+
// ApisixRouteStream defines the configuration for a Layer 4 (TCP/UDP) route.
110110
type ApisixRouteStream struct {
111-
// Name is the unique rule name and cannot be empty.
111+
// Name is a unique identifier for the route. This field must not be empty.
112112
Name string `json:"name" yaml:"name"`
113-
// Protocol specifies the network protocol (e.g., "tcp", "udp").
113+
// Protocol specifies the L4 protocol to match. Can be `tcp` or `udp`.
114114
Protocol string `json:"protocol" yaml:"protocol"`
115-
// Match defines the matching criteria for the stream route.
115+
// Match defines the criteria used to match incoming TCP or UDP connections.
116116
Match ApisixRouteStreamMatch `json:"match" yaml:"match"`
117-
// Backend specifies the backend service to proxy traffic to.
117+
// Backend specifies the destination service to which traffic should be forwarded.
118118
Backend ApisixRouteStreamBackend `json:"backend" yaml:"backend"`
119-
// Plugins lists additional plugins applied to this stream route.
119+
// Plugins defines a list of plugins to apply to this route.
120120
Plugins []ApisixRoutePlugin `json:"plugins,omitempty" yaml:"plugins,omitempty"`
121121
}
122122

@@ -130,42 +130,33 @@ type UpstreamTimeout struct {
130130
Read metav1.Duration `json:"read,omitempty" yaml:"read,omitempty"`
131131
}
132132

133-
// ApisixRouteHTTPMatch represents the matching conditions for routing HTTP traffic.
133+
// ApisixRouteHTTPMatch defines the conditions used to match incoming HTTP requests.
134134
type ApisixRouteHTTPMatch struct {
135-
// Paths is a list of URI path predicates.
136-
// At least one path is required.
137-
// Paths can be exact or prefix matches.
138-
// For prefix matches, append "*" to the path, e.g., "/foo*".
135+
// Paths is a list of URI path patterns to match.
136+
// At least one path must be specified.
137+
// Supports exact matches and prefix matches.
138+
// For prefix matches, append `*` to the path, such as `/foo*`.
139139
Paths []string `json:"paths" yaml:"paths"`
140140

141-
// Methods specifies HTTP request methods to match, e.g., GET, POST.
141+
// Methods specifies the HTTP methods to match.
142142
Methods []string `json:"methods,omitempty" yaml:"methods,omitempty"`
143143

144-
// Hosts defines HTTP Host header predicates.
145-
// Hosts can be exact domains or wildcard domains.
146-
// Only one generic wildcard level is allowed, e.g., "*.foo.com" is valid, "*.*.foo.com" is not.
144+
// Hosts specifies Host header values to match.
145+
// Supports exact and wildcard domains.
146+
// Only one level of wildcard is allowed (e.g., `*.example.com` is valid,
147+
// but `*.*.example.com` is not).
147148
Hosts []string `json:"hosts,omitempty" yaml:"hosts,omitempty"`
148149

149-
// RemoteAddrs is a list of remote IP addresses or CIDR ranges to match.
150+
// RemoteAddrs is a list of source IP addresses or CIDR ranges to match.
150151
// Supports both IPv4 and IPv6 formats.
151152
RemoteAddrs []string `json:"remoteAddrs,omitempty" yaml:"remoteAddrs,omitempty"`
152153

153-
// NginxVars represents predicates based on standard Nginx variables.
154-
// These include variables for request headers, query parameters, remote IP, and other Nginx runtime data.
155-
// For example:
156-
// ```
157-
// nginxVars:
158-
// - subject: "$remote_addr"
159-
// op: in
160-
// value:
161-
// - "127.0.0.1"
162-
// - "10.0.5.11"
163-
// ```
154+
// NginxVars defines match conditions based on Nginx variables.
164155
NginxVars ApisixRouteHTTPMatchExprs `json:"exprs,omitempty" yaml:"exprs,omitempty"`
165156

166-
// FilterFunc is a user-defined filtering function for advanced matching.
167-
// The function receives `vars` parameter that can access Nginx variables.
168-
// This configuration option is only available in APISIX, not in API7 Enterprise.
157+
// FilterFunc is a user-defined function for advanced request filtering.
158+
// The function can use Nginx variables through the `vars` parameter.
159+
// This field is supported in APISIX but not in API7 Enterprise.
169160
FilterFunc string `json:"filter_func,omitempty" yaml:"filter_func,omitempty"`
170161
}
171162

@@ -184,23 +175,24 @@ type ApisixRoutePlugin struct {
184175
SecretRef string `json:"secretRef" yaml:"secretRef"`
185176
}
186177

187-
// ApisixRouteHTTPBackend represents an HTTP backend (a Kubernetes Service).
178+
// ApisixRouteHTTPBackend represents an HTTP backend (Kubernetes Service).
188179
type ApisixRouteHTTPBackend struct {
189-
// The name (short) of the service, note cross namespace is forbidden,
190-
// so be sure the ApisixRoute and Service are in the same namespace.
180+
// ServiceName is the name of the Kubernetes Service.
181+
// Cross-namespace references are not supported—ensure the ApisixRoute
182+
// and the Service are in the same namespace.
191183
ServiceName string `json:"serviceName" yaml:"serviceName"`
192-
// The service port, could be the name or the port number.
184+
// ServicePort is the port of the Kubernetes Service.
185+
// This can be either the port name or port number.
193186
ServicePort intstr.IntOrString `json:"servicePort" yaml:"servicePort"`
194-
// The resolve granularity, can be "endpoints" or "service",
195-
// when set to "endpoints", the pod ips will be used; other
196-
// wise, the service ClusterIP or ExternalIP will be used,
197-
// default is endpoints.
187+
// ResolveGranularity determines how the backend service is resolved.
188+
// Valid values are `endpoints` and `service`. When set to `endpoints`,
189+
// individual pod IPs will be used; otherwise, the Service's ClusterIP or ExternalIP is used.
190+
// The default is `endpoints`.
198191
ResolveGranularity string `json:"resolveGranularity,omitempty" yaml:"resolveGranularity,omitempty"`
199-
// Weight of this backend.
200-
// +kubebuilder:validation:Optional
192+
// Weight specifies the relative traffic weight for this backend.
201193
Weight *int `json:"weight" yaml:"weight"`
202-
// Subset specifies a subset for the target Service. The subset should be pre-defined
203-
// in ApisixUpstream about this service.
194+
// Subset specifies a named subset of the target Service.
195+
// The subset must be pre-defined in the corresponding ApisixUpstream resource.
204196
Subset string `json:"subset,omitempty" yaml:"subset,omitempty"`
205197
}
206198

@@ -228,7 +220,7 @@ type ApisixRouteAuthentication struct {
228220
LDAPAuth ApisixRouteAuthenticationLDAPAuth `json:"ldapAuth,omitempty" yaml:"ldapAuth,omitempty"`
229221
}
230222

231-
// ApisixRouteStreamMatch represents the match conditions for a stream route.
223+
// ApisixRouteStreamMatch represents the matching conditions for a stream route.
232224
type ApisixRouteStreamMatch struct {
233225
// IngressPort is the port on which the APISIX Ingress proxy server listens.
234226
// This must be a statically configured port, as APISIX does not support dynamic port binding.
@@ -237,40 +229,43 @@ type ApisixRouteStreamMatch struct {
237229
Host string `json:"host,omitempty" yaml:"host,omitempty"`
238230
}
239231

240-
// ApisixRouteStreamBackend represents a TCP backend (a Kubernetes Service).
232+
// ApisixRouteStreamBackend represents the backend service for a TCP or UDP stream route.
241233
type ApisixRouteStreamBackend struct {
242-
// The name (short) of the service, note cross namespace is forbidden,
243-
// so be sure the ApisixRoute and Service are in the same namespace.
234+
// ServiceName is the name of the Kubernetes Service.
235+
// Cross-namespace references are not supported—ensure the ApisixRoute
236+
// and the Service are in the same namespace.
244237
ServiceName string `json:"serviceName" yaml:"serviceName"`
245-
// The service port, could be the name or the port number.
238+
// ServicePort is the port of the Kubernetes Service.
239+
// This can be either the port name or port number.
246240
ServicePort intstr.IntOrString `json:"servicePort" yaml:"servicePort"`
247-
// The resolve granularity, can be "endpoints" or "service",
248-
// when set to "endpoints", the pod ips will be used; other
249-
// wise, the service ClusterIP or ExternalIP will be used,
250-
// default is endpoints.
241+
// ResolveGranularity determines how the backend service is resolved.
242+
// Valid values are `endpoints` and `service`. When set to `endpoints`,
243+
// individual pod IPs will be used; otherwise, the Service's ClusterIP or ExternalIP is used.
244+
// The default is `endpoints`.
251245
ResolveGranularity string `json:"resolveGranularity,omitempty" yaml:"resolveGranularity,omitempty"`
252-
// Subset specifies a subset for the target Service. The subset should be pre-defined
253-
// in ApisixUpstream about this service.
246+
// Subset specifies a named subset of the target Service.
247+
// The subset must be pre-defined in the corresponding ApisixUpstream resource.
254248
Subset string `json:"subset,omitempty" yaml:"subset,omitempty"`
255249
}
256250

257251
// ApisixRouteHTTPMatchExpr represents a binary expression used to match requests based on Nginx variables.
258252
type ApisixRouteHTTPMatchExpr struct {
259253
// Subject defines the left-hand side of the expression.
260-
// It can be any Nginx variable or literal string, such as `$remote_addr` or `$http_user_agent`.
254+
// It can be any [built-in variable](/apisix/reference/built-in-variables) or string literal.
261255
Subject ApisixRouteHTTPMatchExprSubject `json:"subject" yaml:"subject"`
262256

263257
// Op specifies the operator used in the expression.
264-
// See [APISIX expressions](/apisix/reference/apisix-expressions) for more information.
258+
// Can be `Equal`, `NotEqual`, `GreaterThan`, `GreaterThanEqual`, `LessThan`, `LessThanEqual`, `RegexMatch`,
259+
// `RegexNotMatch`, `RegexMatchCaseInsensitive`, `RegexNotMatchCaseInsensitive`, `In`, or `NotIn`.
265260
Op string `json:"op" yaml:"op"`
266261

267262
// Set provides a list of acceptable values for the expression.
268-
// This should be used when Op is `in` or `not_in`.
263+
// This should be used when Op is `In` or `NotIn`.
269264
// +kubebuilder:validation:Optional
270265
Set []string `json:"set" yaml:"set"`
271266

272267
// Value defines a single value to compare against the subject.
273-
// This should be used when Op is not `in` or `not_in`.
268+
// This should be used when Op is not `In` or `NotIn`.
274269
// Set and Value are mutually exclusive—only one should be set at a time.
275270
// +kubebuilder:validation:Optional
276271
Value *string `json:"value" yaml:"value"`
@@ -399,10 +394,10 @@ type ApisixRouteAuthenticationLDAPAuth struct {
399394
UID string `json:"uid,omitempty" yaml:"uid,omitempty"`
400395
}
401396

402-
// ApisixRouteHTTPMatchExprSubject describes the subject of a route match expression.
397+
// ApisixRouteHTTPMatchExprSubject describes the subject of a route matching expression.
403398
type ApisixRouteHTTPMatchExprSubject struct {
404399
// Scope specifies the subject scope and can be `Header`, `Query`, or `Path`.
405-
// When Scope is `Path`, `Name` will be ignored.
400+
// When Scope is `Path`, Name will be ignored.
406401
Scope string `json:"scope" yaml:"scope"`
407402
// Name is the name of the header or query parameter.
408403
Name string `json:"name" yaml:"name"`

api/v2/apisixtls_types.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ import (
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
2323

24-
// ApisixTlsSpec defines the desired state of an ApisixTls resource,
25-
// which configures TLS termination for specified hosts in Apache APISIX.
24+
// ApisixTlsSpec defines configurations for TLS and mutual TLS.
2625
type ApisixTlsSpec struct {
2726
// IngressClassName specifies which IngressClass this resource is associated with.
2827
// The APISIX controller only processes this resource if the class matches its own.
@@ -97,7 +96,7 @@ type ApisixMutualTlsClientConfig struct {
9796
CASecret ApisixSecret `json:"caSecret,omitempty" yaml:"caSecret,omitempty"`
9897
// Depth specifies the maximum verification depth for the client certificate chain.
9998
Depth int `json:"depth,omitempty" yaml:"depth,omitempty"`
100-
// SkipMTLSUriRegex contains regex patterns for URIs to skip mutual TLS verification.
99+
// SkipMTLSUriRegex contains RegEx patterns for URIs to skip mutual TLS verification.
101100
SkipMTLSUriRegex []string `json:"skip_mtls_uri_regex,omitempty" yaml:"skip_mtls_uri_regex,omitempty"`
102101
}
103102

0 commit comments

Comments
 (0)