@@ -155,7 +155,7 @@ type KafkaClusterSpec struct {
155155 RollingUpgradeConfig RollingUpgradeConfig `json:"rollingUpgradeConfig"`
156156 // Selector for broker pods that need to be recycled/reconciled
157157 TaintedBrokersSelector * metav1.LabelSelector `json:"taintedBrokersSelector,omitempty"`
158- // +kubebuilder:validation:Enum=envoy;istioingress
158+ // +kubebuilder:validation:Enum=envoy;contour; istioingress
159159 // IngressController specifies the type of the ingress controller to be used for external listeners. The `istioingress` ingress controller type requires the `spec.istioControlPlane` field to be populated as well.
160160 IngressController string `json:"ingressController,omitempty"`
161161 // IstioControlPlane is a reference to the IstioControlPlane resource for envoy configuration. It must be specified if istio ingress is used.
@@ -167,13 +167,14 @@ type KafkaClusterSpec struct {
167167 // when false, they will be kept so the Kafka cluster remains available for those Kafka clients which are still using the previous ingress setting.
168168 // +kubebuilder:default=false
169169 // +optional
170- RemoveUnusedIngressResources bool `json:"removeUnusedIngressResources,omitempty"`
171- PropagateLabels bool `json:"propagateLabels,omitempty"`
172- CruiseControlConfig CruiseControlConfig `json:"cruiseControlConfig"`
173- EnvoyConfig EnvoyConfig `json:"envoyConfig,omitempty"`
174- MonitoringConfig MonitoringConfig `json:"monitoringConfig,omitempty"`
175- AlertManagerConfig * AlertManagerConfig `json:"alertManagerConfig,omitempty"`
176- IstioIngressConfig IstioIngressConfig `json:"istioIngressConfig,omitempty"`
170+ RemoveUnusedIngressResources bool `json:"removeUnusedIngressResources,omitempty"`
171+ PropagateLabels bool `json:"propagateLabels,omitempty"`
172+ CruiseControlConfig CruiseControlConfig `json:"cruiseControlConfig"`
173+ EnvoyConfig EnvoyConfig `json:"envoyConfig,omitempty"`
174+ ContourIngressConfig ContourIngressConfig `json:"contourIngressConfig,omitempty"`
175+ MonitoringConfig MonitoringConfig `json:"monitoringConfig,omitempty"`
176+ AlertManagerConfig * AlertManagerConfig `json:"alertManagerConfig,omitempty"`
177+ IstioIngressConfig IstioIngressConfig `json:"istioIngressConfig,omitempty"`
177178 // Envs defines environment variables for Kafka broker Pods.
178179 // Adding the "+" prefix to the name prepends the value to that environment variable instead of overwriting it.
179180 // Add the "+" suffix to append.
@@ -593,6 +594,10 @@ func (c IngressServiceSettings) GetServiceType() corev1.ServiceType {
593594 return c .ServiceType
594595}
595596
597+ func (c ContourIngressConfig ) GetBrokerFqdn (brokerId int32 ) string {
598+ return strings .Replace (c .BrokerFQDNTemplate , "%id" , strconv .Itoa (int (brokerId )), 1 )
599+ }
600+
596601// Replace %id in brokerHostnameTemplate with actual broker id
597602func (c EnvoyConfig ) GetBrokerHostname (brokerId int32 ) string {
598603 return strings .Replace (c .BrokerHostnameTemplate , "%id" , strconv .Itoa (int (brokerId )), 1 )
@@ -673,7 +678,7 @@ type ExternalListenerConfig struct {
673678 // IngressControllerTargetPort defines the container port that the ingress controller uses for handling external traffic.
674679 // If not defined, 29092 will be used as the default IngressControllerTargetPort value.
675680 IngressControllerTargetPort * int32 `json:"ingressControllerTargetPort,omitempty"`
676- // +kubebuilder:validation:Enum=LoadBalancer;NodePort
681+ // +kubebuilder:validation:Enum=LoadBalancer;NodePort;ClusterIP
677682 // accessMethod defines the method which the external listener is exposed through.
678683 // Two types are supported LoadBalancer and NodePort.
679684 // The recommended and default is the LoadBalancer.
@@ -696,8 +701,16 @@ type Config struct {
696701
697702type IngressConfig struct {
698703 IngressServiceSettings `json:",inline"`
699- IstioIngressConfig * IstioIngressConfig `json:"istioIngressConfig,omitempty"`
700- EnvoyConfig * EnvoyConfig `json:"envoyConfig,omitempty"`
704+ IstioIngressConfig * IstioIngressConfig `json:"istioIngressConfig,omitempty"`
705+ EnvoyConfig * EnvoyConfig `json:"envoyConfig,omitempty"`
706+ ContourIngressConfig * ContourIngressConfig `json:"contourIngressConfig,omitempty"`
707+ }
708+
709+ type ContourIngressConfig struct {
710+ // TLS secret used for Contour IngressRoute resource
711+ TLSSecretName string `json:"tlsSecretName"`
712+ // Broker hostname template for Contour IngressRoute resource to generate broker hostnames.
713+ BrokerFQDNTemplate string `json:"brokerFQDNTemplate"`
701714}
702715
703716// InternalListenerConfig defines the internal listener config for Kafka
0 commit comments