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:
- name: external
port: 9092
tls:true
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
-
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.
-
Add the properties to the
strimziOverrides.kafka.listeners.external.overrides.(bootstrap|brokers)
schemas in theeventstreams.eventstreams.ibm.com
CustomResourceDefinition
as follows:oc edit crd eventstreams.eventstreams.ibm.com
If the
apiVersion
isapiextensions.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
isapiextensions.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 ...
-
Add the properties to the
kafka.listeners.external.overrides.(bootstrap|brokers)
schemas in thekafkas.eventstreams.ibm.com
CustomResourceDefinition
as follows:oc edit crd kafkas.eventstreams.ibm.com
If the
apiVersion
isapiextensions.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
isapiextensions.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.