confluentinc / confluent-kubernetes-examples

Example scenario workflows for Confluent for Kubernetes
Apache License 2.0
43 stars 175 forks source link

kafkarestclass kafka cluster [kafka] in not in running state #308

Closed knut-bw closed 4 months ago

knut-bw commented 4 months ago

I'm encountering an issue where I'm getting the error "kafka cluster [kafka] in not in running state" when trying to create a KafkaRestClass. Here are my YAML files for Kafka and KafkaRestClass:

apiVersion: platform.confluent.io/v1beta1
kind: KafkaRestClass
metadata:
  name: kafka-rest-class
  namespace: fcts
spec:
  kafkaClusterRef:
    name: kafka
    namespace: fcts
  kafkaRest:
    endpoint: http://kafka.fcts.svc.cluster.local:8090
apiVersion: platform.confluent.io/v1beta1
kind: Kafka
metadata:
  name: kafka
  namespace: fcts
spec:
  metricReporter:
    enabled: true
  configOverrides:
    server:
      - "default.replication.factor=3"
      - "offsets.topic.replication.factor=3"
      - "confluent.license.topic.replication.factor=3"
      - "confluent.metrics.reporter.topic.replicas=3"
      - "confluent.tier.metadata.replication.factor=3"
      - "confluent.metadata.topic.replication.factor=3"
      - "confluent.balancer.topic.replication.factor=3"
      - "event.logger.exporter.kafka.topic.replicas=1"
      - "confluent.cluster.link.enable=true"
  replicas: 3
  rackAssignment:
    nodeLabels:
    - kubernetes.io/hostname
  image:
    application: confluentinc/cp-server:7.6.0
    init: confluentinc/confluent-init-container:2.8.0
  dataVolumeCapacity: 100Gi
  oneReplicaPerNode: true
  storageClass:
    name: my-storage-class
  podTemplate:
    affinity:
      podAntiAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app
                operator: In
                values:
                - kafka
            topologyKey: topology.kubernetes.io/zone
    resources:
      requests:
        cpu: 200m
        memory: 512Mi
    podSecurityContext:
      fsGroup: 1000
      runAsUser: 1000
      runAsNonRoot: true
  dependencies:
    zookeeper:
      endpoint: zookeeper.fcts.svc.cluster.local:2181

I have the specified port configured for my Kafka service and I've verified that the Kafka pods are running and healthy. However, I'm still getting the "kafka cluster [kafka] in not in running state" error when trying to create a KafkaRestClass.