@@ -29,10 +29,95 @@ type 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 string `json:"publishService,omitempty"`
33+ StatusAddress []string `json:"statusAddress,omitempty"`
34+ Provider * GatewayProxyProvider `json:"provider,omitempty"`
3235 Plugins []GatewayProxyPlugin `json:"plugins,omitempty"`
3336 PluginMetadata map [string ]apiextensionsv1.JSON `json:"pluginMetadata,omitempty"`
3437}
3538
39+ // ProviderType defines the type of provider
40+ // +kubebuilder:validation:Enum=ControlPlane
41+ type ProviderType string
42+
43+ const (
44+ // ProviderTypeControlPlane represents the control plane provider type
45+ ProviderTypeControlPlane ProviderType = "ControlPlane"
46+ )
47+
48+ // GatewayProxyProvider defines the provider configuration for GatewayProxy
49+ // +kubebuilder:validation:XValidation:rule="self.type == 'ControlPlane' ? has(self.controlPlane) : true",message="controlPlane must be specified when type is ControlPlane"
50+ type GatewayProxyProvider struct {
51+ // Type specifies the type of provider
52+ // +kubebuilder:validation:Required
53+ Type ProviderType `json:"type"`
54+
55+ // ControlPlane specifies the configuration for control plane provider
56+ // +optional
57+ ControlPlane * ControlPlaneProvider `json:"controlPlane,omitempty"`
58+ }
59+
60+ // AuthType defines the type of authentication
61+ // +kubebuilder:validation:Enum=AdminKey
62+ type AuthType string
63+
64+ const (
65+ // AuthTypeAdminKey represents the admin key authentication type
66+ AuthTypeAdminKey AuthType = "AdminKey"
67+ )
68+
69+ // SecretKeySelector defines a reference to a specific key within a Secret
70+ type SecretKeySelector struct {
71+ // Name is the name of the secret
72+ // +kubebuilder:validation:Required
73+ Name string `json:"name"`
74+
75+ // Key is the key in the secret
76+ // +kubebuilder:validation:Required
77+ Key string `json:"key"`
78+ }
79+
80+ // AdminKeyAuth defines the admin key authentication configuration
81+ type AdminKeyAuth struct {
82+ // Value specifies the admin key value directly (not recommended for production)
83+ // +optional
84+ Value string `json:"value,omitempty"`
85+
86+ // ValueFrom specifies the source of the admin key
87+ // +optional
88+ ValueFrom * AdminKeyValueFrom `json:"valueFrom,omitempty"`
89+ }
90+
91+ // AdminKeyValueFrom defines the source of the admin key
92+ type AdminKeyValueFrom struct {
93+ // SecretKeyRef references a key in a Secret
94+ // +optional
95+ SecretKeyRef * SecretKeySelector `json:"secretKeyRef,omitempty"`
96+ }
97+
98+ // ControlPlaneAuth defines the authentication configuration for control plane
99+ type ControlPlaneAuth struct {
100+ // Type specifies the type of authentication
101+ // +kubebuilder:validation:Required
102+ Type AuthType `json:"type"`
103+
104+ // AdminKey specifies the admin key authentication configuration
105+ // +optional
106+ AdminKey * AdminKeyAuth `json:"adminKey,omitempty"`
107+ }
108+
109+ // ControlPlaneProvider defines the configuration for control plane provider
110+ type ControlPlaneProvider struct {
111+ // Endpoints specifies the list of control plane endpoints
112+ // +kubebuilder:validation:Required
113+ // +kubebuilder:validation:MinItems=1
114+ Endpoints []string `json:"endpoints"`
115+
116+ // Auth specifies the authentication configuration
117+ // +kubebuilder:validation:Required
118+ Auth ControlPlaneAuth `json:"auth"`
119+ }
120+
36121// +kubebuilder:object:root=true
37122// GatewayProxy is the Schema for the gatewayproxies API
38123type GatewayProxy struct {
0 commit comments