banzaicloud / koperator

Oh no! Yet another Apache Kafka operator for Kubernetes
Apache License 2.0
783 stars 195 forks source link

KafkaUsers support over Istio MTLS #334

Closed 2phost closed 4 years ago

2phost commented 4 years ago

Problem I have a kafka cluster running over MTLS using Istio. Everything is working as expected, except the KafkaUsers.

Requested feature I would like to see the possibility of using ACLs when using Istio MTLS.

baluchicken commented 4 years ago

This is available in Supertubes, our commercial Kafka product. It’s a fairly complex feature, which includes a KafkaPrincipalBuilder, the Kafka Envoy filter and some other tweaks to make it seamlessy work out of the box with existing ACLs. You can read about in more details in this post or check out the Supertubes docs.

stoader commented 4 years ago

@2phost closing this issue as there is support for KafkaUsers over Istio mTLS in Supertubes. You can read more on it here: Kafka ACLs on Kubernetes over Istio mTLS

satishmane commented 4 years ago

Hi @2phost

my 3 pod kafka cluster fails when istio mtls is enabled by making namespace STRICT. Can you please refer my below ticket.

Can you please share what steps did you take to make kafka work with istio mtls. thanks

https://github.com/istio/istio/issues/26791

baluchicken commented 4 years ago

Hi @satishmane your error can be caused by many things. We need more information about your settings. Can you please share your KafkaCluster CR?

satishmane commented 4 years ago

thanks @baluchicken

kafka is installed using charts / statefulsets

=== stateful set

apiVersion: apps/v1 kind: StatefulSet metadata: generation: 1 labels: app: kafka chart: kafka-2.1.0 heritage: Tiller release: infra-kafka name: infra-kafka namespace: infra spec: podManagementPolicy: Parallel replicas: 3 revisionHistoryLimit: 10 selector: matchLabels: app: kafka chart: kafka-2.1.0 heritage: Tiller release: infra-kafka serviceName: infra-kafka-headless template: metadata: annotations: cluster-autoscaler.kubernetes.io/safe-to-evict: "true" sidecar.istio.io/inject: "true" sidecar.istio.io/rewriteAppHTTPProbers: "true" labels: app: kafka chart: kafka-2.1.0 heritage: Tiller release: infra-kafka name: infra-kafka spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution:

====== headless service

apiVersion: v1 kind: Service metadata: labels: app: kafka chart: kafka-2.1.0 heritage: Tiller release: infra-kafka name: infra-kafka-headless namespace: infra spec: clusterIP: None ports:

==== cluster ip service

apiVersion: v1 kind: Service metadata: labels: app: kafka chart: kafka-2.1.0 heritage: Tiller release: infra-kafka name: infra-kafka namespace: infra spec: clusterIP: 10.100.125.188 ports:

2phost commented 4 years ago

Hi @2phost

my 3 pod kafka cluster fails when istio mtls is enabled by making namespace STRICT. Can you please refer my below ticket.

Can you please share what steps did you take to make kafka work with istio mtls. thanks

istio/istio#26791

Hi @satishmane,

I assume that you are using the Operator from Banzai. I have made several modifications in order to get it working as I want (specific listeners for multi clusters and many others), but it should work fine out of the box.

May I ask you to share your Kafka Custom Resource? The error can be caused by many things, and the root cause can be in your cluster configuration.

Both, stateful set and services are created by the Operator, so we really need to check your CR specification.