How to use a name including underscore or upper-case for KafkaTopic yaml

Solution Verified - Updated -

Issue

  • How to use a name including underscore or upper-case for KafkaTopic yaml?
  • For example, in case of using "sample_InvalidName_topic" as a topic name,
# kafkatopic.yaml           
apiVersion: kafka.strimzi.io/v1beta1
kind: KafkaTopic
metadata:
  name: sample_InvalidName_topic
  labels:
    strimzi.io/cluster: my-cluster
spec:
    ...

$ oc apply -f kafkatopic.yaml                                                                                      
The KafkaTopic "sample_InvalidName_topic" is invalid: metadata.name: Invalid value: "sample_underbar_topic": a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Environment

  • Red Hat AMQ Streams 1.5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content