KafkaSchema
Usage example¶
Example
apiVersion: aiven.io/v1alpha1
kind: KafkaSchema
metadata:
name: my-schema
spec:
authSecretRef:
name: aiven-token
key: token
project: my-aiven-project
serviceName: my-kafka
subjectName: mny-subject
compatibilityLevel: BACKWARD
schema: |
{
"doc": "example_doc",
"fields": [{
"default": 5,
"doc": "field_doc",
"name": "field_name",
"namespace": "field_namespace",
"type": "int"
}],
"name": "example_name",
"namespace": "example_namespace",
"type": "record"
}
Info
To create this resource, a Secret
containing Aiven token must be created first.
Apply the resource with:
Verify the newly created KafkaSchema
:
The output is similar to the following:
Name Service Name Project Subject Compatibility Level Version
my-schema my-kafka my-aiven-project mny-subject BACKWARD <version>
KafkaSchema¶
KafkaSchema is the Schema for the kafkaschemas API.
Required
apiVersion
(string). Valueaiven.io/v1alpha1
.kind
(string). ValueKafkaSchema
.metadata
(object). Data that identifies the object, including aname
string and optionalnamespace
.spec
(object). KafkaSchemaSpec defines the desired state of KafkaSchema. See below for nested schema.
spec¶
Appears on KafkaSchema
.
KafkaSchemaSpec defines the desired state of KafkaSchema.
Required
project
(string, Immutable, Pattern:^[a-zA-Z0-9_-]+$
, MaxLength: 63). Identifies the project this resource belongs to.schema
(string). Kafka Schema configuration should be a valid Avro Schema JSON format.serviceName
(string, Immutable, Pattern:^[a-z][-a-z0-9]+$
, MaxLength: 63). Specifies the name of the service that this resource belongs to.subjectName
(string, MaxLength: 63). Kafka Schema Subject name.
Optional
authSecretRef
(object). Authentication reference to Aiven token in a secret. See below for nested schema.compatibilityLevel
(string, Enum:BACKWARD
,BACKWARD_TRANSITIVE
,FORWARD
,FORWARD_TRANSITIVE
,FULL
,FULL_TRANSITIVE
,NONE
). Kafka Schemas compatibility level.schemaType
(string, Enum:AVRO
,JSON
,PROTOBUF
). Schema type.
authSecretRef¶
Appears on spec
.
Authentication reference to Aiven token in a secret.
Required