@@ -178,7 +178,7 @@ type KafkaClusterSpec struct {
178178 RollingUpgradeConfig RollingUpgradeConfig `json:"rollingUpgradeConfig"`
179179 // Selector for broker pods that need to be recycled/reconciled
180180 TaintedBrokersSelector * metav1.LabelSelector `json:"taintedBrokersSelector,omitempty"`
181- // +kubebuilder:validation:Enum=envoy;istioingress
181+ // +kubebuilder:validation:Enum=envoy;contour; istioingress
182182 // 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.
183183 IngressController string `json:"ingressController,omitempty"`
184184 // IstioControlPlane is a reference to the IstioControlPlane resource for envoy configuration. It must be specified if istio ingress is used.
@@ -190,13 +190,14 @@ type KafkaClusterSpec struct {
190190 // when false, they will be kept so the Kafka cluster remains available for those Kafka clients which are still using the previous ingress setting.
191191 // +kubebuilder:default=false
192192 // +optional
193- RemoveUnusedIngressResources bool `json:"removeUnusedIngressResources,omitempty"`
194- PropagateLabels bool `json:"propagateLabels,omitempty"`
195- CruiseControlConfig CruiseControlConfig `json:"cruiseControlConfig"`
196- EnvoyConfig EnvoyConfig `json:"envoyConfig,omitempty"`
197- MonitoringConfig MonitoringConfig `json:"monitoringConfig,omitempty"`
198- AlertManagerConfig * AlertManagerConfig `json:"alertManagerConfig,omitempty"`
199- IstioIngressConfig IstioIngressConfig `json:"istioIngressConfig,omitempty"`
193+ RemoveUnusedIngressResources bool `json:"removeUnusedIngressResources,omitempty"`
194+ PropagateLabels bool `json:"propagateLabels,omitempty"`
195+ CruiseControlConfig CruiseControlConfig `json:"cruiseControlConfig"`
196+ EnvoyConfig EnvoyConfig `json:"envoyConfig,omitempty"`
197+ ContourIngressConfig ContourIngressConfig `json:"contourIngressConfig,omitempty"`
198+ MonitoringConfig MonitoringConfig `json:"monitoringConfig,omitempty"`
199+ AlertManagerConfig * AlertManagerConfig `json:"alertManagerConfig,omitempty"`
200+ IstioIngressConfig IstioIngressConfig `json:"istioIngressConfig,omitempty"`
200201 // Envs defines environment variables for Kafka broker Pods.
201202 // Adding the "+" prefix to the name prepends the value to that environment variable instead of overwriting it.
202203 // Add the "+" suffix to append.
@@ -624,6 +625,10 @@ func (c IngressServiceSettings) GetServiceType() corev1.ServiceType {
624625 return c .ServiceType
625626}
626627
628+ func (c ContourIngressConfig ) GetBrokerFqdn (brokerId int32 ) string {
629+ return strings .Replace (c .BrokerFQDNTemplate , "%id" , strconv .Itoa (int (brokerId )), 1 )
630+ }
631+
627632// Replace %id in brokerHostnameTemplate with actual broker id
628633func (c EnvoyConfig ) GetBrokerHostname (brokerId int32 ) string {
629634 return strings .Replace (c .BrokerHostnameTemplate , "%id" , strconv .Itoa (int (brokerId )), 1 )
@@ -704,7 +709,7 @@ type ExternalListenerConfig struct {
704709 // IngressControllerTargetPort defines the container port that the ingress controller uses for handling external traffic.
705710 // If not defined, 29092 will be used as the default IngressControllerTargetPort value.
706711 IngressControllerTargetPort * int32 `json:"ingressControllerTargetPort,omitempty"`
707- // +kubebuilder:validation:Enum=LoadBalancer;NodePort
712+ // +kubebuilder:validation:Enum=LoadBalancer;NodePort;ClusterIP
708713 // accessMethod defines the method which the external listener is exposed through.
709714 // Two types are supported LoadBalancer and NodePort.
710715 // The recommended and default is the LoadBalancer.
@@ -727,8 +732,16 @@ type Config struct {
727732
728733type IngressConfig struct {
729734 IngressServiceSettings `json:",inline"`
730- IstioIngressConfig * IstioIngressConfig `json:"istioIngressConfig,omitempty"`
731- EnvoyConfig * EnvoyConfig `json:"envoyConfig,omitempty"`
735+ IstioIngressConfig * IstioIngressConfig `json:"istioIngressConfig,omitempty"`
736+ EnvoyConfig * EnvoyConfig `json:"envoyConfig,omitempty"`
737+ ContourIngressConfig * ContourIngressConfig `json:"contourIngressConfig,omitempty"`
738+ }
739+
740+ type ContourIngressConfig struct {
741+ // TLS secret used for Contour IngressRoute resource
742+ TLSSecretName string `json:"tlsSecretName"`
743+ // Broker hostname template for Contour IngressRoute resource to generate broker hostnames.
744+ BrokerFQDNTemplate string `json:"brokerFQDNTemplate"`
732745}
733746
734747// InternalListenerConfig defines the internal listener config for Kafka
@@ -766,6 +779,9 @@ type CommonListenerSpec struct {
766779 // At least one of the listeners should have this flag enabled
767780 // +optional
768781 UsedForInnerBrokerCommunication bool `json:"usedForInnerBrokerCommunication"`
782+ // UsedForKafkaAdminCommunication allows for a different port to be returned when the koperator is checking for the port to use to check if kafka is operating.
783+ // +optional
784+ UsedForKafkaAdminCommunication bool `json:"usedForKafkaAdminCommunication,omitempty"`
769785}
770786
771787func (c * CommonListenerSpec ) GetServerSSLCertSecretName () string {
0 commit comments