@@ -24,124 +24,137 @@ import (
2424// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
2525// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
2626
27- // GatewayProxySpec defines the desired state of GatewayProxy
27+ // GatewayProxySpec defines the desired state of GatewayProxy.
2828type GatewayProxySpec struct {
2929 // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster
3030 // Important: Run "make" to regenerate code after modifying this file
3131
32+ // PublishService specifies the LoadBalancer-type Service whose external address the controller uses to
33+ // update the status of Ingress resources.
3234 PublishService string `json:"publishService,omitempty"`
35+ // StatusAddress specifies the external IP addresses that the controller uses to populate the status field
36+ // of GatewayProxy or Ingress resources for developers to access.
3337 StatusAddress []string `json:"statusAddress,omitempty"`
38+ // Provider configures the provider details.
3439 Provider * GatewayProxyProvider `json:"provider,omitempty"`
40+ // Plugins configure global plugins.
3541 Plugins []GatewayProxyPlugin `json:"plugins,omitempty"`
42+ // PluginMetadata configures common configurations shared by all plugin instances of the same name.
3643 PluginMetadata map [string ]apiextensionsv1.JSON `json:"pluginMetadata,omitempty"`
3744}
3845
39- // ProviderType defines the type of provider
46+ // ProviderType defines the type of provider.
4047// +kubebuilder:validation:Enum=ControlPlane
4148type ProviderType string
4249
4350const (
44- // ProviderTypeControlPlane represents the control plane provider type
51+ // ProviderTypeControlPlane represents the control plane provider type.
4552 ProviderTypeControlPlane ProviderType = "ControlPlane"
4653)
4754
48- // GatewayProxyProvider defines the provider configuration for GatewayProxy
55+ // GatewayProxyProvider defines the provider configuration for GatewayProxy.
4956// +kubebuilder:validation:XValidation:rule="self.type == 'ControlPlane' ? has(self.controlPlane) : true",message="controlPlane must be specified when type is ControlPlane"
5057type GatewayProxyProvider struct {
51- // Type specifies the type of provider
58+ // Type specifies the type of provider.
5259 // +kubebuilder:validation:Required
5360 Type ProviderType `json:"type"`
5461
55- // ControlPlane specifies the configuration for control plane provider
62+ // ControlPlane specifies the configuration for control plane provider.
5663 // +optional
5764 ControlPlane * ControlPlaneProvider `json:"controlPlane,omitempty"`
5865}
5966
60- // AuthType defines the type of authentication
67+ // AuthType defines the type of authentication.
6168// +kubebuilder:validation:Enum=AdminKey
6269type AuthType string
6370
6471const (
65- // AuthTypeAdminKey represents the admin key authentication type
72+ // AuthTypeAdminKey represents the admin key authentication type.
6673 AuthTypeAdminKey AuthType = "AdminKey"
6774)
6875
69- // SecretKeySelector defines a reference to a specific key within a Secret
76+ // SecretKeySelector defines a reference to a specific key within a Secret.
7077type SecretKeySelector struct {
71- // Name is the name of the secret
78+ // Name is the name of the secret.
7279 // +kubebuilder:validation:Required
7380 Name string `json:"name"`
7481
75- // Key is the key in the secret
82+ // Key is the key in the secret to retrieve the secret from.
7683 // +kubebuilder:validation:Required
7784 Key string `json:"key"`
7885}
7986
80- // AdminKeyAuth defines the admin key authentication configuration
87+ // AdminKeyAuth defines the admin key authentication configuration.
8188type AdminKeyAuth struct {
82- // Value specifies the admin key value directly (not recommended for production)
89+ // Value sets the admin key value explicitly (not recommended for production).
8390 // +optional
8491 Value string `json:"value,omitempty"`
8592
86- // ValueFrom specifies the source of the admin key
93+ // ValueFrom specifies the source of the admin key.
8794 // +optional
8895 ValueFrom * AdminKeyValueFrom `json:"valueFrom,omitempty"`
8996}
9097
91- // AdminKeyValueFrom defines the source of the admin key
98+ // AdminKeyValueFrom defines the source of the admin key.
9299type AdminKeyValueFrom struct {
93- // SecretKeyRef references a key in a Secret
100+ // SecretKeyRef references a key in a Secret.
94101 // +optional
95102 SecretKeyRef * SecretKeySelector `json:"secretKeyRef,omitempty"`
96103}
97104
98- // ControlPlaneAuth defines the authentication configuration for control plane
105+ // ControlPlaneAuth defines the authentication configuration for control plane.
99106type ControlPlaneAuth struct {
100- // Type specifies the type of authentication
107+ // Type specifies the type of authentication.
101108 // +kubebuilder:validation:Required
102109 Type AuthType `json:"type"`
103110
104- // AdminKey specifies the admin key authentication configuration
111+ // AdminKey specifies the admin key authentication configuration.
105112 // +optional
106113 AdminKey * AdminKeyAuth `json:"adminKey,omitempty"`
107114}
108115
109- // ControlPlaneProvider defines the configuration for control plane provider
116+ // ControlPlaneProvider defines the configuration for control plane provider.
110117type ControlPlaneProvider struct {
111- // Endpoints specifies the list of control plane endpoints
118+ // Endpoints specifies the list of control plane endpoints.
112119 // +kubebuilder:validation:Required
113120 // +kubebuilder:validation:MinItems=1
114121 Endpoints []string `json:"endpoints"`
115122
116- // TlsVerify specifies whether to verify the TLS certificate of the control plane
123+ // TlsVerify specifies whether to verify the TLS certificate of the control plane.
117124 // +optional
118125 TlsVerify * bool `json:"tlsVerify,omitempty"`
119126
120- // Auth specifies the authentication configuration
127+ // Auth specifies the authentication configurations.
121128 // +kubebuilder:validation:Required
122129 Auth ControlPlaneAuth `json:"auth"`
123130}
124131
125132// +kubebuilder:object:root=true
126- // GatewayProxy is the Schema for the gatewayproxies API
133+ // GatewayProxy is the Schema for the gatewayproxies API.
127134type GatewayProxy struct {
128135 metav1.TypeMeta `json:",inline"`
129136 metav1.ObjectMeta `json:"metadata,omitempty"`
130137
138+ // GatewayProxySpec defines the desired state and configuration of a GatewayProxy,
139+ // including networking settings, global plugins, and plugin metadata.
131140 Spec GatewayProxySpec `json:"spec,omitempty"`
132141}
133142
134143// +kubebuilder:object:root=true
135- // GatewayProxyList contains a list of GatewayProxy
144+ // GatewayProxyList contains a list of GatewayProxy.
136145type GatewayProxyList struct {
137146 metav1.TypeMeta `json:",inline"`
138147 metav1.ListMeta `json:"metadata,omitempty"`
139148 Items []GatewayProxy `json:"items"`
140149}
141150
151+ // GatewayProxyPlugin contains plugin configurations.
142152type GatewayProxyPlugin struct {
153+ // Name is the name of the plugin.
143154 Name string `json:"name,omitempty"`
155+ // Enabled defines whether the plugin is enabled.
144156 Enabled bool `json:"enabled,omitempty"`
157+ // Config defines the plugin's configuration details.
145158 Config apiextensionsv1.JSON `json:"config,omitempty"`
146159}
147160
0 commit comments