<p>I have a local k3s Kubernetes cluster (Traefik disabled) created by Rancher Desktop.</p>
<p>I am trying to set up Kafka using Ingress way based on <a href="https://strimzi.io/blog/2019/05/23/accessing-kafka-part-5/" rel="nofollow noreferrer">this tutorial</a> to make it accessible for clients running outside of Kubernetes.</p>
<p>In able to make it work, Ingress need enable SSL passthrough. I installed <strong>ingress-nginx</strong> by</p>
<pre><code>helm upgrade \
  ingress-nginx \
  ingress-nginx \
  --install \
  --repo=https://kubernetes.github.io/ingress-nginx \
  --namespace=ingress-nginx \
  --create-namespace \
  --values=my-values.yaml
</code></pre>
<p><strong>my-values.yaml</strong></p>
<pre class="lang-yaml prettyprint-override"><code>controller:
  extraArgs:
    enable-ssl-passthrough: true
</code></pre>
<p>I got my cluster IP <code>192.168.1.149</code> by:</p>
<pre><code>➜ kubectl get node lima-rancher-desktop -o wide
NAME                   STATUS   ROLES                  AGE    VERSION        INTERNAL-IP    EXTERNAL-IP     OS-IMAGE             KERNEL-VERSION   CONTAINER-RUNTIME
lima-rancher-desktop   Ready    control-plane,master   108m   v1.26.3+k3s1   192.168.5.15   192.168.1.149   Alpine Linux v3.16   5.15.96-0-virt   containerd://1.6.8
</code></pre>
<p>Then I deploy my Kafka by:</p>
<pre class="lang-bash prettyprint-override"><code>kubectl create namespace hm-kafka
kubectl apply --filename=&quot;https://strimzi.io/install/latest?namespace=hm-kafka&quot; --namespace=hm-kafka
kubectl apply --filename=my-kafka-persistent.yaml --namespace=hm-kafka
</code></pre>
<p><strong>my-kafka-persistent.yaml</strong> (based on <a href="https://strimzi.io/examples/latest/kafka/kafka-persistent.yaml" rel="nofollow noreferrer">kafka-persistent.yaml</a>):</p>
<pre class="lang-yaml prettyprint-override"><code>---
apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
  name: hm-kafka
spec:
  kafka:
    version: 3.4.0
    replicas: 3
    listeners:
      - name: plain
        port: 9092
        type: internal
        tls: false
      - name: tls
        port: 9093
        type: internal
        tls: true
      - name: external
        port: 9094
        type: ingress
        tls: true
        configuration:
          bootstrap:
            host: kafka-bootstrap.192.168.1.149.nip.io
          brokers:
          - broker: 0
            host: kafka-broker-0.192.168.1.149.nip.io
          - broker: 1
            host: kafka-broker-1.192.168.1.149.nip.io
          - broker: 2
            host: kafka-broker-2.192.168.1.149.nip.io
    config:
      offsets.topic.replication.factor: 3
      transaction.state.log.replication.factor: 3
      transaction.state.log.min.isr: 2
      default.replication.factor: 3
      min.insync.replicas: 2
      inter.broker.protocol.version: &quot;3.4&quot;
    storage:
      type: jbod
      volumes:
        - id: 0
          type: persistent-claim
          size: 100Gi
          deleteClaim: false
  zookeeper:
    replicas: 3
    storage:
      type: persistent-claim
      size: 100Gi
      deleteClaim: false
  entityOperator:
    topicOperator: {}
    userOperator: {}
</code></pre>
<p>However, this time Kafka broker are not created.</p>
<p>When I check ingress-nginx log, it shows:</p>
<pre class="lang-bash prettyprint-override"><code>➜ kubectl logs ingress-nginx-controller-6598bff54d-sffqt -n ingress-nginx

-------------------------------------------------------------------------------
NGINX Ingress controller
  Release:       v1.7.0
  Build:         72ff21ed9e26cb969052c753633049ba8a87ecf9
  Repository:    https://github.com/kubernetes/ingress-nginx
  nginx version: nginx/1.21.6

-------------------------------------------------------------------------------

W0415 05:07:19.264102       7 controller.go:279] ignoring ingress hm-kafka-kafka-bootstrap in hm-kafka based on annotation : ingress does not contain a valid IngressClass
I0415 05:07:19.264118       7 main.go:100] &quot;successfully validated configuration, accepting&quot; ingress=&quot;hm-kafka/hm-kafka-kafka-bootstrap&quot;
W0415 05:07:19.264254       7 controller.go:279] ignoring ingress hm-kafka-kafka-0 in hm-kafka based on annotation : ingress does not contain a valid IngressClass
I0415 05:07:19.264262       7 main.go:100] &quot;successfully validated configuration, accepting&quot; ingress=&quot;hm-kafka/hm-kafka-kafka-0&quot;
W0415 05:07:19.264344       7 controller.go:279] ignoring ingress hm-kafka-kafka-1 in hm-kafka based on annotation : ingress does not contain a valid IngressClass
W0415 05:07:19.264254       7 controller.go:279] ignoring ingress hm-kafka-kafka-2 in hm-kafka based on annotation : ingress does not contain a valid IngressClass
I0415 05:07:19.264351       7 main.go:100] &quot;successfully validated configuration, accepting&quot; ingress=&quot;hm-kafka/hm-kafka-kafka-1&quot;
I0415 05:07:19.264354       7 main.go:100] &quot;successfully validated configuration, accepting&quot; ingress=&quot;hm-kafka/hm-kafka-kafka-2&quot;
I0415 05:07:19.273788       7 store.go:429] &quot;Ignoring ingress because of error while validating ingress class&quot; ingress=&quot;hm-kafka/hm-kafka-kafka-1&quot; error=&quot;ingress does not contain a valid IngressClass&quot;
I0415 05:07:19.274943       7 store.go:429] &quot;Ignoring ingress because of error while validating ingress class&quot; ingress=&quot;hm-kafka/hm-kafka-kafka-2&quot; error=&quot;ingress does not contain a valid IngressClass&quot;
I0415 05:07:19.275020       7 store.go:429] &quot;Ignoring ingress because of error while validating ingress class&quot; ingress=&quot;hm-kafka/hm-kafka-kafka-0&quot; error=&quot;ingress does not contain a valid IngressClass&quot;
I0415 05:07:19.275129       7 store.go:429] &quot;Ignoring ingress because of error while validating ingress class&quot; ingress=&quot;hm-kafka/hm-kafka-kafka-bootstrap&quot; error=&quot;ingress does not contain a valid IngressClass&quot;
</code></pre>
<p>Based on <a href="https://github.com/orgs/strimzi/discussions/4292#discussioncomment-297118" rel="nofollow noreferrer">this</a>, the operator created the Ingress resources and then waits for the Ingress controller to confirm their address in the Status section. Right now the Ingress failed to validate the ingress class which is why Kafka brokers were not created.</p>
<p>Any guide to help fix would be appreciate, thanks!</p>

Hongbo Miao
<p>I resolved by adding <code>kubernetes.io/ingress.class: nginx</code> annotation for Kafka bootstrap and brokers in the file <strong>my-kafka-persistent.yaml</strong>:</p>
<pre class="lang-yaml prettyprint-override"><code># ...
      - name: external
        port: 9094
        type: ingress
        tls: true
        configuration:
          bootstrap:
            host: kafka-bootstrap.192.168.1.149.nip.io
            annotations:
              kubernetes.io/ingress.class: nginx
          brokers:
          - broker: 0
            host: kafka-broker-0.192.168.1.149.nip.io
            annotations:
              kubernetes.io/ingress.class: nginx
          - broker: 1
            host: kafka-broker-1.192.168.1.149.nip.io
            annotations:
              kubernetes.io/ingress.class: nginx
          - broker: 2
            host: kafka-broker-2.192.168.1.149.nip.io
            annotations:
              kubernetes.io/ingress.class: nginx
</code></pre>
<p>After updating the file and redeploying the Kafka cluster, the brokers (<code>hm-kafka-kafka-0</code>, <code>hm-kafka-kafka-1</code>, <code>hm-kafka-kafka-2</code>) showed up:</p>
<p><a href="https://i.stack.imgur.com/Gbpdw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gbpdw.png" alt="enter image description here" /></a></p>
