diff --git a/api/v1alpha1/envoygateway_types.go b/api/v1alpha1/envoygateway_types.go index 6cf8e334182..481b55d6470 100644 --- a/api/v1alpha1/envoygateway_types.go +++ b/api/v1alpha1/envoygateway_types.go @@ -254,10 +254,27 @@ type KubernetesWatchMode struct { NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"` } +const ( + // KubernetesDeployModeTypeControllerNamespace indicates that the controller namespace is used for the infra proxy deployments. + KubernetesDeployModeTypeControllerNamespace = "ControllerNamespace" + + // KubernetesDeployModeTypeGatewayNamespace indicates that the gateway namespace is used for the infra proxy deployments. + KubernetesDeployModeTypeGatewayNamespace = "GatewayNamespace" +) + +// KubernetesDeployModeType defines the type of KubernetesDeployMode +type KubernetesDeployModeType string + // KubernetesDeployMode holds configuration for how to deploy managed resources such as the Envoy Proxy // data plane fleet. type KubernetesDeployMode struct { - // TODO + // Type indicates what deployment mode to use. "ControllerNamespace" and + // "GatewayNamespace" are currently supported. + // By default, when this field is unset or empty, Envoy Gateway will deploy Envoy Proxy fleet in the Controller namespace. + // +optional + // +kubebuilder:default=ControllerNamespace + // +kubebuilder:validation:Enum=ControllerNamespace;GatewayNamespace + Type *KubernetesDeployModeType `json:"type,omitempty"` } // EnvoyGatewayCustomProvider defines configuration for the Custom provider. diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index dbc28e6aca2..619edda84c6 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1544,7 +1544,7 @@ func (in *EnvoyGatewayKubernetesProvider) DeepCopyInto(out *EnvoyGatewayKubernet if in.Deploy != nil { in, out := &in.Deploy, &out.Deploy *out = new(KubernetesDeployMode) - **out = **in + (*in).DeepCopyInto(*out) } if in.OverwriteControlPlaneCerts != nil { in, out := &in.OverwriteControlPlaneCerts, &out.OverwriteControlPlaneCerts @@ -3426,6 +3426,11 @@ func (in *KubernetesDaemonSetSpec) DeepCopy() *KubernetesDaemonSetSpec { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *KubernetesDeployMode) DeepCopyInto(out *KubernetesDeployMode) { *out = *in + if in.Type != nil { + in, out := &in.Type, &out.Type + *out = new(KubernetesDeployModeType) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubernetesDeployMode. diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 5119d756646..057167c3f93 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -2488,6 +2488,20 @@ data plane fleet. _Appears in:_ - [EnvoyGatewayKubernetesProvider](#envoygatewaykubernetesprovider) +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `type` | _[KubernetesDeployModeType](#kubernetesdeploymodetype)_ | false | Type indicates what deployment mode to use. "ControllerNamespace" and
"GatewayNamespace" are currently supported.
By default, when this field is unset or empty, Envoy Gateway will deploy Envoy Proxy fleet in the Controller namespace. | + + +#### KubernetesDeployModeType + +_Underlying type:_ _string_ + +KubernetesDeployModeType defines the type of KubernetesDeployMode + +_Appears in:_ +- [KubernetesDeployMode](#kubernetesdeploymode) + #### KubernetesDeploymentSpec diff --git a/site/content/zh/latest/api/extension_types.md b/site/content/zh/latest/api/extension_types.md index 5119d756646..057167c3f93 100644 --- a/site/content/zh/latest/api/extension_types.md +++ b/site/content/zh/latest/api/extension_types.md @@ -2488,6 +2488,20 @@ data plane fleet. _Appears in:_ - [EnvoyGatewayKubernetesProvider](#envoygatewaykubernetesprovider) +| Field | Type | Required | Description | +| --- | --- | --- | --- | +| `type` | _[KubernetesDeployModeType](#kubernetesdeploymodetype)_ | false | Type indicates what deployment mode to use. "ControllerNamespace" and
"GatewayNamespace" are currently supported.
By default, when this field is unset or empty, Envoy Gateway will deploy Envoy Proxy fleet in the Controller namespace. | + + +#### KubernetesDeployModeType + +_Underlying type:_ _string_ + +KubernetesDeployModeType defines the type of KubernetesDeployMode + +_Appears in:_ +- [KubernetesDeployMode](#kubernetesdeploymode) + #### KubernetesDeploymentSpec