Working with Configs
n this guide, we will walk you through creating a Config object and referencing it from a Stream. The principles explained can be applied to other resources, like Deployments, as well.
First, we need to create a Config. A Config can look different depending on what kind of Config is being defined. For information about which fields are relevant for which kind, see the Deployments and Streams payload documentations. When creating a Config, a label must also be defined in the "Add Label" section. This is the label that will be used to reference the Config from a Stream or Deployment. In the following example, we have created a Config for a Stream and attached the label
When navigating to
Spec, we can define the actual configuration properties that will be merged into the resources referencing this Config object:
Once the Config is created, the Config object will be displayed in a YAML format so you can see that the fields have been set correctly. In this example we have defined the connection information for Streams hosted on confluent-cloud.
Once the Config has been created we can define a Stream and attach the Config to it. In the following example, we reference our Config by its label
io.datacater/label-key: test-stream-config. Since we define the connection information inside the Config object, we do not need to define fields such as
bootstrap.serversinside the Stream resource.