Attention: This version of Event Streams has reached End of Support. For more information about supported versions, see the support matrix.

Unable to override external listener route host

Symptoms

When deploying an instance of Event Streams with an external listener and overriding the host by using overrides.bootstrap/broker, the host fields do not persist in the custom resource and the changes do not take effect.

spec:
  strimziOverrides:
    kafka:
      listeners:
        external:
          type: route
            overrides:
              bootstrap:
                host: bootstrap.myhost.com
              brokers:
                - broker: 0
                  host: broker-0.myhost.com

Causes

There are two CustomResourceDefinitions that are missing the host fields, and as such the Red Hat OpenShift Container Platform API server removes the fields when an instance of Event Streams is deployed containing those fields.

Resolving the problem

  1. Modify the two CustomResourceDefinitions that have been deployed when the Event Streams operator was installed:

    bootstrap host property:

    host:
      type: string
      description: Host for the bootstrap route. This
        field will be used in the `spec.host` field
        of the OpenShift Route.
    

    broker host property:

    host:
      type: string
      description: Host for the broker route. This
        field will be used in the `spec.host` field
        of the OpenShift Route.
    
  2. Add the properties to the strimziOverrides.kafka.listeners.external.overrides.(bootstrap|brokers) schemas in the eventstreams.eventstreams.ibm.com CustomResourceDefinition as follows:

    oc edit crd eventstreams.eventstreams.ibm.com

    If the apiVersion is apiextensions.k8s.io/v1, edit as follows:

    apiVersion: apiextensions.k8s.io/v1
    ...
    spec:
      versions:
      - name: v1beta1
        schema:
          openAPIV3Schema:
            properties:
              spec:
                properties:
                  strimziOverrides:
                    properties:
                      kafka:
                        properties:
                          listeners:
                            properties:
                              external:
                                properties:
                                  overrides:
                                    properties:
                                      bootstrap:
                                        # ADD BOOTSTRAP HOST PROPERTY HERE
                                      ...
                                      brokers:
                                        items:
                                          properties:
                                            # ADD BROKER HOST PROPERTY HERE
                                      ...
    

    If the apiVersion is apiextensions.k8s.io/v1beta1, edit as follows:

    spec:
      validation:
        openAPIV3Schema:
          properties:
            spec:
              properties:
                strimziOverrides:
                  properties:
                    kafka:
                      properties:
                        listeners:
                          properties:
                            external:
                              properties:
                                overrides:
                                  properties:
                                    bootstrap:
                                      # ADD BOOTSTRAP HOST PROPERTY HERE
                                    ...
                                    brokers:
                                      items:
                                        properties:
                                          # ADD BROKER HOST PROPERTY HERE
                                    ...
    
  3. Add the properties to the kafka.listeners.external.overrides.(bootstrap|brokers) schemas in the kafkas.eventstreams.ibm.com CustomResourceDefinition as follows:

    oc edit crd kafkas.eventstreams.ibm.com

    If the apiVersion is apiextensions.k8s.io/v1, edit as follows:

    apiVersion: apiextensions.k8s.io/v1
    ...
    spec:
      versions:
      - name: v1beta1
        schema:
          openAPIV3Schema:
            properties:
              spec:
                properties:
                  kafka:
                    properties:
                      listeners:
                        properties:
                          external:
                            properties:
                              overrides:
                                properties:
                                  bootstrap:
                                    # ADD BOOTSTRAP HOST PROPERTY HERE
                                  ...
                                  brokers:
                                    items:
                                      properties:
                                        # ADD BROKER HOST PROPERTY HERE
                                  ...
    

    If the apiVersion is apiextensions.k8s.io/v1beta1, edit as follows:

    spec:
      validation:
        openAPIV3Schema:
          properties:
            spec:
              properties:
                kafka:
                  properties:
                    listeners:
                      properties:
                        external:
                          properties:
                            overrides:
                              properties:
                                bootstrap:
                                  # ADD BOOTSTRAP HOST PROPERTY HERE
                                ...
                                brokers:
                                  items:
                                    properties:
                                      # ADD BROKER HOST PROPERTY HERE
                                ...
    

Note: If you uninstall or change the operator version, the CustomResourceDefinitions will be overridden. You will need to patch the values again.