Skip to content

Commit

Permalink
Revert "Adding Contour Ingress support (#82)"
Browse files Browse the repository at this point in the history
This reverts commit b1e9544.
  • Loading branch information
dobrerazvan authored Jun 27, 2024
1 parent b1e9544 commit 5360b17
Show file tree
Hide file tree
Showing 20 changed files with 58 additions and 9,579 deletions.
35 changes: 11 additions & 24 deletions api/v1beta1/kafkacluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ type KafkaClusterSpec struct {
RollingUpgradeConfig RollingUpgradeConfig `json:"rollingUpgradeConfig"`
// Selector for broker pods that need to be recycled/reconciled
TaintedBrokersSelector *metav1.LabelSelector `json:"taintedBrokersSelector,omitempty"`
// +kubebuilder:validation:Enum=envoy;contour;istioingress
// +kubebuilder:validation:Enum=envoy;istioingress
// 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.
IngressController string `json:"ingressController,omitempty"`
// IstioControlPlane is a reference to the IstioControlPlane resource for envoy configuration. It must be specified if istio ingress is used.
Expand All @@ -167,14 +167,13 @@ type KafkaClusterSpec struct {
// when false, they will be kept so the Kafka cluster remains available for those Kafka clients which are still using the previous ingress setting.
// +kubebuilder:default=false
// +optional
RemoveUnusedIngressResources bool `json:"removeUnusedIngressResources,omitempty"`
PropagateLabels bool `json:"propagateLabels,omitempty"`
CruiseControlConfig CruiseControlConfig `json:"cruiseControlConfig"`
EnvoyConfig EnvoyConfig `json:"envoyConfig,omitempty"`
ContourIngressConfig ContourIngressConfig `json:"contourIngressConfig,omitempty"`
MonitoringConfig MonitoringConfig `json:"monitoringConfig,omitempty"`
AlertManagerConfig *AlertManagerConfig `json:"alertManagerConfig,omitempty"`
IstioIngressConfig IstioIngressConfig `json:"istioIngressConfig,omitempty"`
RemoveUnusedIngressResources bool `json:"removeUnusedIngressResources,omitempty"`
PropagateLabels bool `json:"propagateLabels,omitempty"`
CruiseControlConfig CruiseControlConfig `json:"cruiseControlConfig"`
EnvoyConfig EnvoyConfig `json:"envoyConfig,omitempty"`
MonitoringConfig MonitoringConfig `json:"monitoringConfig,omitempty"`
AlertManagerConfig *AlertManagerConfig `json:"alertManagerConfig,omitempty"`
IstioIngressConfig IstioIngressConfig `json:"istioIngressConfig,omitempty"`
// Envs defines environment variables for Kafka broker Pods.
// Adding the "+" prefix to the name prepends the value to that environment variable instead of overwriting it.
// Add the "+" suffix to append.
Expand Down Expand Up @@ -594,10 +593,6 @@ func (c IngressServiceSettings) GetServiceType() corev1.ServiceType {
return c.ServiceType
}

func (c ContourIngressConfig) GetBrokerFqdn(brokerId int32) string {
return strings.Replace(c.BrokerFQDNTemplate, "%id", strconv.Itoa(int(brokerId)), 1)
}

// Replace %id in brokerHostnameTemplate with actual broker id
func (c EnvoyConfig) GetBrokerHostname(brokerId int32) string {
return strings.Replace(c.BrokerHostnameTemplate, "%id", strconv.Itoa(int(brokerId)), 1)
Expand Down Expand Up @@ -678,7 +673,7 @@ type ExternalListenerConfig struct {
// IngressControllerTargetPort defines the container port that the ingress controller uses for handling external traffic.
// If not defined, 29092 will be used as the default IngressControllerTargetPort value.
IngressControllerTargetPort *int32 `json:"ingressControllerTargetPort,omitempty"`
// +kubebuilder:validation:Enum=LoadBalancer;NodePort;ClusterIP
// +kubebuilder:validation:Enum=LoadBalancer;NodePort
// accessMethod defines the method which the external listener is exposed through.
// Two types are supported LoadBalancer and NodePort.
// The recommended and default is the LoadBalancer.
Expand All @@ -701,16 +696,8 @@ type Config struct {

type IngressConfig struct {
IngressServiceSettings `json:",inline"`
IstioIngressConfig *IstioIngressConfig `json:"istioIngressConfig,omitempty"`
EnvoyConfig *EnvoyConfig `json:"envoyConfig,omitempty"`
ContourIngressConfig *ContourIngressConfig `json:"contourIngressConfig,omitempty"`
}

type ContourIngressConfig struct {
// TLS secret used for Contour IngressRoute resource
TLSSecretName string `json:"tlsSecretName"`
// Broker hostname template for Contour IngressRoute resource to generate broker hostnames.
BrokerFQDNTemplate string `json:"brokerFQDNTemplate"`
IstioIngressConfig *IstioIngressConfig `json:"istioIngressConfig,omitempty"`
EnvoyConfig *EnvoyConfig `json:"envoyConfig,omitempty"`
}

// InternalListenerConfig defines the internal listener config for Kafka
Expand Down
21 changes: 0 additions & 21 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 0 additions & 30 deletions charts/kafka-operator/crds/kafkaclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12899,19 +12899,6 @@ spec:
type: string
clusterWideConfig:
type: string
contourIngressConfig:
properties:
brokerFQDNTemplate:
description: Broker hostname template for Contour IngressRoute
resource to generate broker hostnames.
type: string
tlsSecretName:
description: TLS secret used for Contour IngressRoute resource
type: string
required:
- brokerFQDNTemplate
- tlsSecretName
type: object
cruiseControlConfig:
description: CruiseControlConfig defines the config for Cruise Control
properties:
Expand Down Expand Up @@ -18830,7 +18817,6 @@ spec:
as well.
enum:
- envoy
- contour
- istioingress
type: string
istioControlPlane:
Expand Down Expand Up @@ -19185,7 +19171,6 @@ spec:
enum:
- LoadBalancer
- NodePort
- ClusterIP
type: string
anyCastPort:
description: configuring AnyCastPort allows kafka cluster
Expand All @@ -19205,21 +19190,6 @@ spec:
ingressConfig:
additionalProperties:
properties:
contourIngressConfig:
properties:
brokerFQDNTemplate:
description: Broker hostname template for
Contour IngressRoute resource to generate
broker hostnames.
type: string
tlsSecretName:
description: TLS secret used for Contour IngressRoute
resource
type: string
required:
- brokerFQDNTemplate
- tlsSecretName
type: object
envoyConfig:
description: EnvoyConfig defines the config for
Envoy
Expand Down
30 changes: 0 additions & 30 deletions config/base/crds/kafka.banzaicloud.io_kafkaclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12899,19 +12899,6 @@ spec:
type: string
clusterWideConfig:
type: string
contourIngressConfig:
properties:
brokerFQDNTemplate:
description: Broker hostname template for Contour IngressRoute
resource to generate broker hostnames.
type: string
tlsSecretName:
description: TLS secret used for Contour IngressRoute resource
type: string
required:
- brokerFQDNTemplate
- tlsSecretName
type: object
cruiseControlConfig:
description: CruiseControlConfig defines the config for Cruise Control
properties:
Expand Down Expand Up @@ -18830,7 +18817,6 @@ spec:
as well.
enum:
- envoy
- contour
- istioingress
type: string
istioControlPlane:
Expand Down Expand Up @@ -19185,7 +19171,6 @@ spec:
enum:
- LoadBalancer
- NodePort
- ClusterIP
type: string
anyCastPort:
description: configuring AnyCastPort allows kafka cluster
Expand All @@ -19205,21 +19190,6 @@ spec:
ingressConfig:
additionalProperties:
properties:
contourIngressConfig:
properties:
brokerFQDNTemplate:
description: Broker hostname template for
Contour IngressRoute resource to generate
broker hostnames.
type: string
tlsSecretName:
description: TLS secret used for Contour IngressRoute
resource
type: string
required:
- brokerFQDNTemplate
- tlsSecretName
type: object
envoyConfig:
description: EnvoyConfig defines the config for
Envoy
Expand Down
Loading

0 comments on commit 5360b17

Please sign in to comment.