Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions api/adc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,12 +692,22 @@ const (
)

type SyncResult struct {
Status string `json:"status"`
TotalResources int `json:"total_resources"`
SuccessCount int `json:"success_count"`
FailedCount int `json:"failed_count"`
Success []SyncStatus `json:"success"`
Failed []SyncStatus `json:"failed"`
Status string `json:"status"`
TotalResources int `json:"total_resources"`
SuccessCount int `json:"success_count"`
FailedCount int `json:"failed_count"`
Success []SyncStatus `json:"success"`
Failed []SyncStatus `json:"failed"`
EndpointStatus []EndpointStatus `json:"endpoint_status,omitempty"`
}

// EndpointStatus represents the synchronization status of an APISIX standalone endpoint.
// This is only used in apisix-standalone mode where endpoint-level status is reported
// instead of resource-level status.
type EndpointStatus struct {
Server string `json:"server"`
Success bool `json:"success"`
Reason string `json:"reason,omitempty"`
}

type SyncStatus struct {
Expand Down Expand Up @@ -778,6 +788,7 @@ type Config struct {
ServerAddrs []string
Token string
TlsVerify bool
BackendType string
}

// MarshalJSON implements custom JSON marshaling for adcConfig
Expand Down
6 changes: 6 additions & 0 deletions api/v1alpha1/gatewayproxy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,13 @@ type ControlPlaneAuth struct {

// ControlPlaneProvider defines configuration for control plane provider.
// +kubebuilder:validation:XValidation:rule="has(self.endpoints) != has(self.service)"
// +kubebuilder:validation:XValidation:rule="oldSelf == null || (!has(self.mode) && !has(oldSelf.mode)) || self.mode == oldSelf.mode",message="mode is immutable"
type ControlPlaneProvider struct {
// Mode specifies the mode of control plane provider.
// Can be `apisix` or `apisix-standalone`.
//
// +kubebuilder:validation:Optional
Mode string `json:"mode,omitempty"`
// Endpoints specifies the list of control plane endpoints.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:MinItems=1
Expand Down
4 changes: 2 additions & 2 deletions api/v2/apisixroute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ type ApisixRouteStatus = ApisixStatus
// +kubebuilder:printcolumn:name="Target Service (TCP)",type="string",JSONPath=".spec.tcp[].match.backend.serviceName",description="Backend Service for TCP",priority=1
// +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp",description="Creation time",priority=0

// ApisixRoute is defines configuration for HTTP and stream routes.
// ApisixRoute defines configuration for HTTP and stream routes.
type ApisixRoute struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Expand Down Expand Up @@ -112,7 +112,7 @@ type ApisixRouteHTTP struct {
Authentication ApisixRouteAuthentication `json:"authentication,omitempty" yaml:"authentication,omitempty"`
}

// ApisixRouteStream defines the configuration for a Layer 4 (TCP/UDP) route. Currently not supported.
// ApisixRouteStream defines the configuration for a Layer 4 (TCP/UDP) route.
type ApisixRouteStream struct {
// Name is a unique identifier for the route. This field must not be empty.
Name string `json:"name" yaml:"name"`
Expand Down
4 changes: 2 additions & 2 deletions config/crd/bases/apisix.apache.org_apisixroutes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
name: v2
schema:
openAPIV3Schema:
description: ApisixRoute is defines configuration for HTTP and stream routes.
description: ApisixRoute defines configuration for HTTP and stream routes.
properties:
apiVersion:
description: |-
Expand Down Expand Up @@ -361,7 +361,7 @@ spec:
Each rule specifies conditions to match TCP/UDP traffic and how to forward them.
items:
description: ApisixRouteStream defines the configuration for a Layer
4 (TCP/UDP) route. Currently not supported.
4 (TCP/UDP) route.
properties:
backend:
description: Backend specifies the destination service to which
Expand Down
8 changes: 8 additions & 0 deletions config/crd/bases/apisix.apache.org_gatewayproxies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ spec:
type: string
minItems: 1
type: array
mode:
description: |-
Mode specifies the mode of control plane provider.
Can be `apisix` or `apisix-standalone`.
type: string
service:
properties:
name:
Expand All @@ -150,6 +155,9 @@ spec:
type: object
x-kubernetes-validations:
- rule: has(self.endpoints) != has(self.service)
- message: mode is immutable
rule: oldSelf == null || (!has(self.mode) && !has(oldSelf.mode))
|| self.mode == oldSelf.mode
type:
description: Type specifies the type of provider. Can only be
`ControlPlane`.
Expand Down
24 changes: 12 additions & 12 deletions config/webhook/manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-apisix-apache-org-v2-apisixconsumer
failurePolicy: Fail
failurePolicy: Ignore
name: vapisixconsumer-v2.kb.io
rules:
- apiGroups:
Expand All @@ -31,7 +31,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-apisix-apache-org-v2-apisixroute
failurePolicy: Fail
failurePolicy: Ignore
name: vapisixroute-v2.kb.io
rules:
- apiGroups:
Expand All @@ -51,7 +51,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-apisix-apache-org-v2-apisixtls
failurePolicy: Fail
failurePolicy: Ignore
name: vapisixtls-v2.kb.io
rules:
- apiGroups:
Expand All @@ -71,7 +71,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-apisix-apache-org-v1alpha1-consumer
failurePolicy: Fail
failurePolicy: Ignore
name: vconsumer-v1alpha1.kb.io
rules:
- apiGroups:
Expand All @@ -91,7 +91,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-gateway-networking-k8s-io-v1-gateway
failurePolicy: Fail
failurePolicy: Ignore
name: vgateway-v1.kb.io
rules:
- apiGroups:
Expand All @@ -111,7 +111,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-apisix-apache-org-v1alpha1-gatewayproxy
failurePolicy: Fail
failurePolicy: Ignore
name: vgatewayproxy-v1alpha1.kb.io
rules:
- apiGroups:
Expand All @@ -131,7 +131,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-gateway-networking-k8s-io-v1-grpcroute
failurePolicy: Fail
failurePolicy: Ignore
name: vgrpcroute-v1.kb.io
rules:
- apiGroups:
Expand All @@ -151,7 +151,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-gateway-networking-k8s-io-v1-httproute
failurePolicy: Fail
failurePolicy: Ignore
name: vhttproute-v1.kb.io
rules:
- apiGroups:
Expand All @@ -171,7 +171,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-networking-k8s-io-v1-ingress
failurePolicy: Fail
failurePolicy: Ignore
name: vingress-v1.kb.io
rules:
- apiGroups:
Expand All @@ -191,7 +191,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-networking-k8s-io-v1-ingressclass
failurePolicy: Fail
failurePolicy: Ignore
name: vingressclass-v1.kb.io
rules:
- apiGroups:
Expand All @@ -211,7 +211,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-gateway-networking-k8s-io-v1alpha2-tcproute
failurePolicy: Fail
failurePolicy: Ignore
name: vtcproute-v1alpha2.kb.io
rules:
- apiGroups:
Expand All @@ -231,7 +231,7 @@ webhooks:
name: webhook-service
namespace: system
path: /validate-gateway-networking-k8s-io-v1alpha2-udproute
failurePolicy: Fail
failurePolicy: Ignore
name: vudproute-v1alpha2.kb.io
rules:
- apiGroups:
Expand Down
5 changes: 3 additions & 2 deletions docs/en/latest/reference/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ ControlPlaneProvider defines configuration for control plane provider.

| Field | Description |
| --- | --- |
| `mode` _string_ | Mode specifies the mode of control plane provider. Can be `apisix` or `apisix-standalone`. |
| `endpoints` _string array_ | Endpoints specifies the list of control plane endpoints. |
| `service` _[ProviderService](#providerservice)_ | |
| `tlsVerify` _boolean_ | TlsVerify specifies whether to verify the TLS certificate of the control plane. |
Expand Down Expand Up @@ -560,7 +561,7 @@ ApisixPluginConfig defines a reusable set of plugin configuration that can be re
### ApisixRoute


ApisixRoute is defines configuration for HTTP and stream routes.
ApisixRoute defines configuration for HTTP and stream routes.

<!-- ApisixRoute resource -->

Expand Down Expand Up @@ -1187,7 +1188,7 @@ _Appears in:_
#### ApisixRouteStream


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



Expand Down
Loading
Loading