It is my first time working with Kafka and I need to work with Schema Registry.
I already tested and could send messages from a producer to a consumer.
Now I am trying to install the Schema Registry, but I still can’t.
In minikube I have some pods related to my-schema-registry-cp-schema-registry and a service my-schema-registry-cp-schema-registry
I added helm confluent with:
helm repo add confluentinc https://packages.confluent.io/helm
and install confluent with:
helm upgrade --install confluent-operator confluentinc/confluent-for-kubernetes --namespace default
Configure the Schema registry:
helm upgrade --install confluent-operator confluentinc/confluent-for-kubernetes --namespace default --set kafka.bootstrapServers=my-cluster-kafka-bootstrap:9092 --set schemaRegistry.enabled=true
I created a small AVRO file:
{
"type": "record",
"name": "MyAvroRecord",
"fields": [
{"name": "value", "type": "string"}
]
}
Then I move to the cp-helm-charts/charts/cp-schema-registry folder and do:
helm install my-schema-registry . -f values.yaml --namespace default
And I understand that then I have to register the schema in the Schema Registry by doing:
curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" \
--data '{"schema": "{\"type\":\"record\",\"name\":\"MyAvroRecord\",\"fields\":[{\"name\":\"value\",\"type\":\"string\"}]}"}' \
http://my-schema-registry-cp-schema-registry:8081/subjects/test-topic-value/versions
And here is where I got an error and can’t move forward.
curl: (6) Could not resolve host: my-schema-registry-cp-schema-registry
I was working with chatGPT because I couldn’t find a tutorial or an explanation explaining which steps I should follow to work with Confluent for Kubernetes and Schema Registry.