Create a Kafka service
Apply the following object on your namespace, as specified by its YAML description.
Example to create a Kafka instance
apiVersion: exoscale.appcat.vshn.io/v1
kind: ExoscaleKafka
metadata:
name: my-kafka-example (1)
namespace: my-namespace (2)
spec:
parameters:
service:
kafkaSettings:
connections_max_idle_ms: 60000 (3)
zone: ch-dk-2 (4)
size:
plan: startup-2 (5)
writeConnectionSecretToRef:
name: kafka-creds (6)
| 1 | Instance name |
| 2 | The namespace where the object will be created. |
| 3 | Specify custom Kafka settings [optional] |
| 4 | The Exoscale zone to use, see list of regions |
| 5 | See reference for a list of plans |
| 6 | Secret where the connection details are provisioned. This secret shouldn’t exist before creation. |
| To get more information about all available configuration options, please see the API Reference |
Inspect your new Kafka service
$ oc get exoscalekafka
NAME PLAN ZONE VERSION READY CONNECTION-SECRET AGE
my-kafka-example startup-2 ch-dk-2 3.2 True kafka-creds 15m
When you see True in the READY column, it means the instance is provisioned and ready to use.
| The provisioning time of Kafka can be quite long, and it might take up to 15 minutes for the instance to be ready. |
Find the connection details
The connection details are stored in a secret. You can retrieve them with the following command:
$ oc get secrets kafka-creds -o yaml
The output of the command above is a secret specification with the following structure:
apiVersion: v1
kind: Secret
metadata:
name: kafka-creds
stringData:
KAFKA_HOST: my-kafka.my-cloud.com (1)
KAFKA_NODES: 127.0.0.1:21701 127.0.0.2:21701 127.0.0.3:21701 (2)
KAFKA_PORT: 21701 (3)
KAFKA_URI: my-kafka.my-cloud.com:21701 (4)
ca.crt: | (5)
-----BEGIN CERTIFICATE-----
HexValues
-----END CERTIFICATE-----
service.cert: | (6)
-----BEGIN CERTIFICATE-----
HexValues
-----END CERTIFICATE-----
service.key: | (7)
-----BEGIN CERTIFICATE-----
HexValues
-----END CERTIFICATE-----
| 1 | Hostname for the Kafka instance |
| 2 | List of Kafka Node IPs |
| 3 | Port the Kafka instance listens on |
| 4 | Full URI including port number |
| 5 | Certificate Authority to verify the Kafka instance certificate |
| 6 | Client certificate to authenticate to the instance |
| 7 | Client key to authenticate to the instance |
| Not all fields apply to all providers |