Skip to content

Follow alternativeNames and advertisedHost #108

@albundy83

Description

@albundy83

Hello,

Reference comes from here.
when I create my load balancers, it will be nice if the created KafkaAccess follow the alternativeNames and advertisedHost, instead of the received hostnames from cloud provider (I also use external-dns).

Here my example:

apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
  name: my-kafka
  annotations:
    argocd.argoproj.io/sync-wave: '1'
spec:
  kafka:
    version: 4.1.0
    metadataVersion: 4.1-IV1
    listeners:
      - name: tls
        port: 9093
        type: internal
        tls: true
        authentication:
          type: tls
      - name: external
        port: 9094
        type: loadbalancer
        tls: true
        authentication:
          type: tls
        configuration:
          loadBalancerSourceRanges:
            - 10.0.1.0/24
            - x.x.x.x
          bootstrap:
            annotations:
              external-dns.alpha.kubernetes.io/hostname: kafka-bootstrap.youpi.fr.
              service.beta.kubernetes.io/osc-load-balancer-name: kafka-bootstrap-my-kafka
              service.beta.kubernetes.io/osc-load-balancer-target-node-labels: node-role.kubernetes.io/worker=true
            alternativeNames:
              - kafka-bootstrap.youpi.fr
          brokers:
            - broker: 0
              annotations:
                external-dns.alpha.kubernetes.io/hostname: kafka-broker-0.youpi.fr.
                service.beta.kubernetes.io/osc-load-balancer-name: kafka-broker-0-my-kafka
                service.beta.kubernetes.io/osc-load-balancer-target-node-labels: node-role.kubernetes.io/worker=true
              advertisedHost: kafka-broker-0.youpi.fr
    authorization:
      type: simple
    config:
      auto.create.topics.enable: false
      offsets.topic.replication.factor: 1
      transaction.state.log.replication.factor: 1
      transaction.state.log.min.isr: 1
      default.replication.factor: 1
      min.insync.replicas: 1
    metricsConfig:
      type: jmxPrometheusExporter
      valueFrom:
        configMapKeyRef:
          name: kafka-metrics
          key: kafka-metrics.yaml
    template:
      pod:
        securityContext:
          runAsUser: 1001
          runAsGroup: 0
          fsGroup: 0
          runAsNonRoot: true
          seccompProfile:
            type: RuntimeDefault
      kafkaContainer:
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
              - ALL
          privileged: false
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          seccompProfile:
            type: RuntimeDefault
  entityOperator:
    template:
      pod:
        securityContext:
          runAsUser: 1001
          runAsGroup: 0
          fsGroup: 0
          runAsNonRoot: true
          seccompProfile:
            type: RuntimeDefault
      topicOperatorContainer:
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
              - ALL
          privileged: false
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          seccompProfile:
            type: RuntimeDefault
      userOperatorContainer:
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop:
              - ALL
          privileged: false
          readOnlyRootFilesystem: true
          runAsNonRoot: true
          seccompProfile:
            type: RuntimeDefault
    topicOperator: {}
    userOperator: {}

My cloud provider provides me the following hostnames:

  • kafka-bootstrap-my-kafka.yyyy.xxxx.outscale.com
  • kafka-broker-0-my-kafka.yyyy.xxxx.outscale.com

external-dns allow me to have some nice hostnames:

  • kafka-bootstrap.youpi.fr
  • kafka-broker-0.youpi.fr

Unfortunatelly, the Secret created with KafkaAccess object contains in bootstrap-servers, bootstrap.servers and bootstrapServers keys the ugly cloud provider hostname kafka-bootstrap-my-kafka.yyyy.xxxx.outscale.com.

Will it be possible to have the nice alternativeNames here my kafka-bootstrap.youpi.fr ?

Thanks a lot

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions