Skip to content

Commit 94dd401

Browse files
committed
update CRD
1 parent 2647195 commit 94dd401

30 files changed

+1187
-789
lines changed

api/adc/types.go

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ type ClientTLS struct {
235235
Key string `json:"client_key,omitempty" yaml:"client_key,omitempty"`
236236
}
237237

238-
// UpstreamActiveHealthCheck defines the active kind of upstream health check.
238+
// UpstreamActiveHealthCheck defines the active upstream health check configuration.
239239
// +k8s:deepcopy-gen=true
240240
type UpstreamActiveHealthCheck struct {
241241
Type string `json:"type,omitempty" yaml:"type,omitempty"`
@@ -250,33 +250,35 @@ type UpstreamActiveHealthCheck struct {
250250
Unhealthy UpstreamActiveHealthCheckUnhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"`
251251
}
252252

253-
// UpstreamPassiveHealthCheck defines the passive kind of upstream health check.
253+
// UpstreamPassiveHealthCheck defines the passive health check configuration for an upstream.
254+
// Passive health checks rely on analyzing live traffic to determine the health status of upstream nodes.
254255
// +k8s:deepcopy-gen=true
255256
type UpstreamPassiveHealthCheck struct {
256-
Type string `json:"type,omitempty" yaml:"type,omitempty"`
257-
Healthy UpstreamPassiveHealthCheckHealthy `json:"healthy,omitempty" yaml:"healthy,omitempty"`
257+
// Type is the passive health check type. For example: `http`.
258+
Type string `json:"type,omitempty" yaml:"type,omitempty"`
259+
// Healthy defines the conditions under which an upstream node is considered healthy.
260+
Healthy UpstreamPassiveHealthCheckHealthy `json:"healthy,omitempty" yaml:"healthy,omitempty"`
261+
// Unhealthy defines the conditions under which an upstream node is considered unhealthy.
258262
Unhealthy UpstreamPassiveHealthCheckUnhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"`
259263
}
260264

261-
// UpstreamActiveHealthCheckHealthy defines the conditions to judge whether
262-
// an upstream node is healthy with the active manner.
265+
// UpstreamActiveHealthCheckHealthy defines the conditions used to actively determine whether an upstream node is healthy.
263266
// +k8s:deepcopy-gen=true
264267
type UpstreamActiveHealthCheckHealthy struct {
265268
UpstreamPassiveHealthCheckHealthy `json:",inline" yaml:",inline"`
266269

270+
// Interval defines the time interval for checking targets, in seconds.
267271
Interval int `json:"interval,omitempty" yaml:"interval,omitempty"`
268272
}
269273

270-
// UpstreamPassiveHealthCheckHealthy defines the conditions to judge whether
271-
// an upstream node is healthy with the passive manner.
274+
// UpstreamPassiveHealthCheckHealthy defines the conditions used to passively determine whether an upstream node is healthy.
272275
// +k8s:deepcopy-gen=true
273276
type UpstreamPassiveHealthCheckHealthy struct {
274277
HTTPStatuses []int `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"`
275278
Successes int `json:"successes,omitempty" yaml:"successes,omitempty"`
276279
}
277280

278-
// UpstreamPassiveHealthCheckUnhealthy defines the conditions to judge whether
279-
// an upstream node is unhealthy with the passive manager.
281+
// UpstreamPassiveHealthCheckUnhealthy defines the conditions used to passively determine whether an upstream node is unhealthy.
280282
// +k8s:deepcopy-gen=true
281283
type UpstreamPassiveHealthCheckUnhealthy struct {
282284
HTTPStatuses []int `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"`
@@ -285,12 +287,12 @@ type UpstreamPassiveHealthCheckUnhealthy struct {
285287
Timeouts int `json:"timeouts,omitempty" yaml:"timeouts,omitempty"`
286288
}
287289

288-
// UpstreamActiveHealthCheckUnhealthy defines the conditions to judge whether
289-
// an upstream node is unhealthy with the active manager.
290+
// UpstreamActiveHealthCheckHealthy defines the conditions used to actively determine whether an upstream node is unhealthy.
290291
// +k8s:deepcopy-gen=true
291292
type UpstreamActiveHealthCheckUnhealthy struct {
292293
UpstreamPassiveHealthCheckUnhealthy `json:",inline" yaml:",inline"`
293294

295+
// Interval defines the time interval for checking targets, in seconds.
294296
Interval int `json:"interval,omitempty" yaml:"interval,omitempty"`
295297
}
296298

@@ -306,21 +308,38 @@ type TrafficSplitConfigRule struct {
306308
WeightedUpstreams []TrafficSplitConfigRuleWeightedUpstream `json:"weighted_upstreams"`
307309
}
308310

309-
// TrafficSplitConfigRuleWeightedUpstream is the weighted upstream config in
310-
// the traffic split plugin rule.
311+
// TrafficSplitConfigRuleWeightedUpstream defines a weighted backend in a traffic split rule.
312+
// This is used by the APISIX traffic-split plugin to distribute traffic
313+
// across multiple upstreams based on weight.
311314
// +k8s:deepcopy-gen=true
312315
type TrafficSplitConfigRuleWeightedUpstream struct {
313-
UpstreamID string `json:"upstream_id,omitempty"`
314-
Upstream *Upstream `json:"upstream,omitempty"`
315-
Weight int `json:"weight"`
316+
// UpstreamID is the identifier of a pre-defined upstream.
317+
UpstreamID string `json:"upstream_id,omitempty"`
318+
319+
// Upstream specifies an inline upstream configuration.
320+
// If provided, it overrides UpstreamID.
321+
Upstream *Upstream `json:"upstream,omitempty"`
322+
323+
// Weight defines the percentage of traffic routed to this upstream.
324+
// The final routing decision is based on relative weights.
325+
Weight int `json:"weight"`
316326
}
317327

328+
// TLSClass defines the client TLS configuration for mutual TLS (mTLS) authentication.
318329
// +k8s:deepcopy-gen=true
319330
type TLSClass struct {
320-
ClientCERT string `json:"client_cert,omitempty"`
331+
// ClientCERT is the PEM-encoded client certificate.
332+
ClientCERT string `json:"client_cert,omitempty"`
333+
334+
// ClientCERTID is the reference ID to a stored client certificate.
321335
ClientCERTID string `json:"client_cert_id,omitempty"`
322-
ClientKey string `json:"client_key,omitempty"`
323-
Verify *bool `json:"verify,omitempty"`
336+
337+
// ClientKey is the PEM-encoded private key for the client certificate.
338+
ClientKey string `json:"client_key,omitempty"`
339+
340+
// Verify indicates whether the server's certificate should be verified.
341+
// If false, TLS verification is skipped.
342+
Verify *bool `json:"verify,omitempty"`
324343
}
325344

326345
// +k8s:deepcopy-gen=true

api/dashboard/v1/types.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ type UpstreamHealthCheck struct {
431431
Passive *UpstreamPassiveHealthCheck `json:"passive,omitempty" yaml:"passive,omitempty"`
432432
}
433433

434-
// UpstreamActiveHealthCheck defines the active kind of upstream health check.
434+
// UpstreamActiveHealthCheck defines the active upstream health check.
435435
// +k8s:deepcopy-gen=true
436436
type UpstreamActiveHealthCheck struct {
437437
Type string `json:"type,omitempty" yaml:"type,omitempty"`
@@ -446,42 +446,40 @@ type UpstreamActiveHealthCheck struct {
446446
Unhealthy UpstreamActiveHealthCheckUnhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"`
447447
}
448448

449-
// UpstreamPassiveHealthCheck defines the passive kind of upstream health check.
449+
// UpstreamPassiveHealthCheck defines the passive upstream health check.
450450
// +k8s:deepcopy-gen=true
451451
type UpstreamPassiveHealthCheck struct {
452452
Type string `json:"type,omitempty" yaml:"type,omitempty"`
453453
Healthy UpstreamPassiveHealthCheckHealthy `json:"healthy,omitempty" yaml:"healthy,omitempty"`
454454
Unhealthy UpstreamPassiveHealthCheckUnhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"`
455455
}
456456

457-
// UpstreamActiveHealthCheckHealthy defines the conditions to judge whether
458-
// an upstream node is healthy with the active manner.
457+
// UpstreamActiveHealthCheckHealthy defines the conditions used to actively determine whether an upstream node is healthy.
459458
// +k8s:deepcopy-gen=true
460459
type UpstreamActiveHealthCheckHealthy struct {
461460
UpstreamPassiveHealthCheckHealthy `json:",inline" yaml:",inline"`
462461

462+
// Interval defines the time interval for checking targets, in seconds.
463463
Interval int `json:"interval,omitempty" yaml:"interval,omitempty"`
464464
}
465465

466-
// UpstreamPassiveHealthCheckHealthy defines the conditions to judge whether
467-
// an upstream node is healthy with the passive manner.
466+
// UpstreamPassiveHealthCheckHealthy defines the conditions used to passively determine whether an upstream node is unhealthy.
468467
// +k8s:deepcopy-gen=true
469468
type UpstreamPassiveHealthCheckHealthy struct {
470469
HTTPStatuses []int `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"`
471470
Successes int `json:"successes,omitempty" yaml:"successes,omitempty"`
472471
}
473472

474-
// UpstreamActiveHealthCheckUnhealthy defines the conditions to judge whether
475-
// an upstream node is unhealthy with the active manager.
473+
// UpstreamActiveHealthCheckUnhealthy defines the conditions used to actively determine whether an upstream node is unhealthy.
476474
// +k8s:deepcopy-gen=true
477475
type UpstreamActiveHealthCheckUnhealthy struct {
478476
UpstreamPassiveHealthCheckUnhealthy `json:",inline" yaml:",inline"`
479477

478+
// Interval defines the time interval for checking targets, in seconds.
480479
Interval int `json:"interval,omitempty" yaml:"interval,omitempty"`
481480
}
482481

483-
// UpstreamPassiveHealthCheckUnhealthy defines the conditions to judge whether
484-
// an upstream node is unhealthy with the passive manager.
482+
// UpstreamPassiveHealthCheckUnhealthy defines the conditions used to passively determine whether an upstream node is unhealthy.
485483
// +k8s:deepcopy-gen=true
486484
type UpstreamPassiveHealthCheckUnhealthy struct {
487485
HTTPStatuses []int `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"`

api/v1alpha1/backendtrafficpolicy_types.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323

2424
// +kubebuilder:object:root=true
2525
// +kubebuilder:subresource:status
26+
// BackendTrafficPolicy defines configuration for traffic handling policies applied to backend services.
2627
type BackendTrafficPolicy struct {
2728
metav1.TypeMeta `json:",inline"`
2829
metav1.ObjectMeta `json:"metadata,omitempty"`
@@ -46,7 +47,7 @@ type BackendTrafficPolicySpec struct {
4647
LoadBalancer *LoadBalancer `json:"loadbalancer,omitempty" yaml:"loadbalancer,omitempty"`
4748
// Scheme is the protocol used to communicate with the upstream.
4849
// Default is `http`.
49-
// Can be one of `http`, `https`, `grpc`, or `grpcs`.
50+
// Can be `http`, `https`, `grpc`, or `grpcs`.
5051
// +kubebuilder:validation:Enum=http;https;grpc;grpcs;
5152
// +kubebuilder:default=http
5253
Scheme string `json:"scheme,omitempty" yaml:"scheme,omitempty"`
@@ -62,7 +63,10 @@ type BackendTrafficPolicySpec struct {
6263
// PassHost configures how the host header should be determined when a
6364
// request is forwarded to the upstream.
6465
// Default is `pass`.
65-
// Can be one of `pass`, `node` or `rewrite`.
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
6670
//
6771
// +kubebuilder:validation:Enum=pass;node;rewrite;
6872
// +kubebuilder:default=pass
@@ -78,18 +82,18 @@ type BackendTrafficPolicySpec struct {
7882
type LoadBalancer struct {
7983
// Type specifies the load balancing algorithms.
8084
// Default is `roundrobin`.
81-
// Can be one of `roundrobin`, `chash`, `ewma`, or `least_conn`.
85+
// Can be `roundrobin`, `chash`, `ewma`, or `least_conn`.
8286
// +kubebuilder:validation:Enum=roundrobin;chash;ewma;least_conn;
8387
// +kubebuilder:default=roundrobin
8488
// +kubebuilder:validation:Required
8589
Type string `json:"type" yaml:"type"`
86-
// HashOn specified the type of field used for hashing, required when Type is `chash`.
90+
// HashOn specified the type of field used for hashing, required when type is `chash`.
8791
// Default is `vars`.
88-
// Can be one of `vars`, `header`, `cookie`, `consumer`, or `vars_combinations`.
92+
// Can be `vars`, `header`, `cookie`, `consumer`, or `vars_combinations`.
8993
// +kubebuilder:validation:Enum=vars;header;cookie;consumer;vars_combinations;
9094
// +kubebuilder:default=vars
9195
HashOn string `json:"hashOn,omitempty" yaml:"hashOn,omitempty"`
92-
// Key is used with HashOn, generally required when Type is `chash`.
96+
// Key is used with HashOn, generally required when type is `chash`.
9397
// When HashOn is `header` or `cookie`, specifies the name of the header or cookie.
9498
// When HashOn is `consumer`, key is not required, as the consumer name is used automatically.
9599
// When HashOn is `vars` or `vars_combinations`, key refers to one or a combination of

api/v1alpha1/consumer_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ import (
2424

2525
// +kubebuilder:object:root=true
2626
// +kubebuilder:subresource:status
27+
// Consumer defines configuration for a consumer.
2728
type Consumer struct {
2829
metav1.TypeMeta `json:",inline"`
2930
metav1.ObjectMeta `json:"metadata,omitempty"`
3031

31-
// ConsumerSpec defines the configuration for a consumer, including consumer name,
32+
// ConsumerSpec defines configuration for a consumer, including consumer name,
3233
// authentication credentials, and plugin settings.
3334
Spec ConsumerSpec `json:"spec,omitempty"`
3435
Status ConsumerStatus `json:"status,omitempty"`
@@ -65,7 +66,7 @@ type Credential struct {
6566
// +kubebuilder:validation:Required
6667
// +kubebuilder:validation:Enum=jwt-auth;basic-auth;key-auth;hmac-auth;
6768
// Type specifies the type of authentication to configure credentials for.
68-
// Can be one of `jwt-auth`, `basic-auth`, `key-auth`, or `hmac-auth`.
69+
// Can be `jwt-auth`, `basic-auth`, `key-auth`, or `hmac-auth`.
6970
Type string `json:"type"`
7071
// Config specifies the credential details for authentication.
7172
Config apiextensionsv1.JSON `json:"config,omitempty"`

api/v1alpha1/gatewayproxy_types.go

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ type GatewayProxySpec struct {
4040
Provider *GatewayProxyProvider `json:"provider,omitempty"`
4141
// Plugins configure global plugins.
4242
Plugins []GatewayProxyPlugin `json:"plugins,omitempty"`
43-
// PluginMetadata configures common configurations shared by all plugin instances of the same name.
43+
// PluginMetadata configures common configuration shared by all plugin instances of the same name.
4444
PluginMetadata map[string]apiextensionsv1.JSON `json:"pluginMetadata,omitempty"`
4545
}
4646

@@ -115,7 +115,7 @@ type ControlPlaneAuth struct {
115115
AdminKey *AdminKeyAuth `json:"adminKey,omitempty"`
116116
}
117117

118-
// ControlPlaneProvider defines the configuration for control plane provider.
118+
// ControlPlaneProvider defines configuration for control plane provider.
119119
type ControlPlaneProvider struct {
120120
// Endpoints specifies the list of control plane endpoints.
121121
// +kubebuilder:validation:Required
@@ -127,26 +127,28 @@ type ControlPlaneProvider struct {
127127
// +optional
128128
TlsVerify *bool `json:"tlsVerify,omitempty"`
129129

130-
// Auth specifies the authentication configurations.
130+
// Auth specifies the authentication configuration.
131131
// +kubebuilder:validation:Required
132132
Auth ControlPlaneAuth `json:"auth"`
133133
}
134134

135135
type ProviderService struct {
136+
// Name is the name of the provider.
136137
Name string `json:"name"`
137138

138139
// +kubebuilder:validation:Minimum=1
139140
// +kubebuilder:validation:Maximum=65535
141+
// Port is the port of the provider.
140142
Port int32 `json:"port,omitempty"`
141143
}
142144

143145
// +kubebuilder:object:root=true
144-
// GatewayProxy is the Schema for the gatewayproxies API.
146+
// GatewayProxy defines configuration for the gateway proxy instances used to route traffic to services.
145147
type GatewayProxy struct {
146148
metav1.TypeMeta `json:",inline"`
147149
metav1.ObjectMeta `json:"metadata,omitempty"`
148150

149-
// GatewayProxySpec defines the desired state and configuration of a GatewayProxy,
151+
// GatewayProxySpec defines configuration of gateway proxy instances,
150152
// including networking settings, global plugins, and plugin metadata.
151153
Spec GatewayProxySpec `json:"spec,omitempty"`
152154
}
@@ -159,7 +161,7 @@ type GatewayProxyList struct {
159161
Items []GatewayProxy `json:"items"`
160162
}
161163

162-
// GatewayProxyPlugin contains plugin configurations.
164+
// GatewayProxyPlugin contains plugin configuration.
163165
type GatewayProxyPlugin struct {
164166
// Name is the name of the plugin.
165167
Name string `json:"name,omitempty"`

api/v1alpha1/groupversion_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// specific language governing permissions and limitations
1616
// under the License.
1717

18-
// Package v1alpha1 contains API Schema definitions for the apisix.apache.org v1alpha1 API group
18+
// Package v1alpha1 contains API Schema definitions for the apisix.apache.org v1alpha1 API group.
1919
// +kubebuilder:object:generate=true
2020
// +groupName=apisix.apache.org
2121
package v1alpha1

api/v1alpha1/httproutepolicy_types.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ type HTTPRoutePolicySpec struct {
2929
// +kubebuilder:validation:MinItems=1
3030
// +kubebuilder:validation:MaxItems=16
3131
TargetRefs []gatewayv1alpha2.LocalPolicyTargetReferenceWithSectionName `json:"targetRefs"`
32-
// Priority sets the priority for route. A higher value sets a higher priority in route matching.
32+
// Priority sets the priority for route. when multiple routes have the same URI path,
33+
// a higher value sets a higher priority in route matching.
3334
Priority *int64 `json:"priority,omitempty" yaml:"priority,omitempty"`
3435
// Vars sets the request matching conditions.
3536
Vars []apiextensionsv1.JSON `json:"vars,omitempty" yaml:"vars,omitempty"`
@@ -38,12 +39,12 @@ type HTTPRoutePolicySpec struct {
3839
// +kubebuilder:object:root=true
3940
// +kubebuilder:subresource:status
4041

41-
// HTTPRoutePolicy is the Schema for the httproutepolicies API.
42+
// HTTPRoutePolicy defines configuration of traffic policies.
4243
type HTTPRoutePolicy struct {
4344
metav1.TypeMeta `json:",inline"`
4445
metav1.ObjectMeta `json:"metadata,omitempty"`
4546

46-
// HTTPRoutePolicySpec defines the desired state and configuration of a HTTPRoutePolicy,
47+
// HTTPRoutePolicySpec defines configuration of a HTTPRoutePolicy,
4748
// including route priority and request matching conditions.
4849
Spec HTTPRoutePolicySpec `json:"spec,omitempty"`
4950
Status PolicyStatus `json:"status,omitempty"`

api/v1alpha1/pluginconfig_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ import (
2727

2828
// +kubebuilder:object:root=true
2929

30-
// PluginConfig is the Schema for the PluginConfigs API.
30+
// PluginConfig defines plugin configuration.
3131
type PluginConfig struct {
3232
metav1.TypeMeta `json:",inline"`
3333
metav1.ObjectMeta `json:"metadata,omitempty"`
3434

3535
// PluginConfigSpec defines the desired state of a PluginConfig,
36-
// in which plugins and their configurations are specified.
36+
// in which plugins and their configuration are specified.
3737
Spec PluginConfigSpec `json:"spec,omitempty"`
3838
}
3939

4040
// PluginConfigSpec defines the desired state of PluginConfig.
4141
type PluginConfigSpec struct {
42-
// Plugins are an array of plugins and their configurations to be applied.
42+
// Plugins are an array of plugins and their configuration to be applied.
4343
Plugins []Plugin `json:"plugins"`
4444
}
4545

0 commit comments

Comments
 (0)