Skip to content

Commit a4f6b67

Browse files
authored
Merge pull request #27 from osodevops/schema_crd
Schema crd
2 parents 2a04034 + e091984 commit a4f6b67

File tree

8 files changed

+108
-1
lines changed

8 files changed

+108
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ All Examples will require the steps mentioned in [GETTING_STARTED.md](https://gi
6767
* [Monitoring Kakfa CFK with JMX Prometheus and Grafana](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/grafana-prometheus)
6868
* [User provided mTLS for Kafka in CFK](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/external-mtls)
6969
* [Vault enabled secrets store for Kafka](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/vault-key-value)
70+
* [Confluent Schema CRD to declaratively create, read, and delete schemas](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/schema)
7071

7172
### Broken / WIP Deployments
7273
* [Vault PKI integration with dynamic SSL](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/broken/pki-vault--waiting-for-kafka-2.7)

README.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ examples: |-
4242
* [Monitoring Kakfa CFK with JMX Prometheus and Grafana](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/grafana-prometheus)
4343
* [User provided mTLS for Kafka in CFK](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/external-mtls)
4444
* [Vault enabled secrets store for Kafka](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/vault-key-value)
45+
* [Confluent Schema CRD to declaratively create, read, and delete schemas](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/schema)
4546
4647
### Broken / WIP Deployments
4748
* [Vault PKI integration with dynamic SSL](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/broken/pki-vault--waiting-for-kafka-2.7)

base/cfk-components/confluent-no-auth-tls/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ resources:
44
- secrets
55
- zookeeper.yaml
66
- kafka.yaml
7-
- control-centre.yaml
7+
# - control-centre.yaml
88
# - rest-class.yaml

stable/schema/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Schema CRD Deployment
2+
A working example of the new Schema CRD, you can declaratively create, read, and delete schemas as Schema custom resources (CRs) in Kubernetes.
3+
4+
The example uses an Avro schema which is loaded into a ConfigMap and referenced in the Schema CRD.
5+
6+
## Features
7+
8+
| Feature | Enabled | Note |
9+
|:----------------|:-------:|-------:|
10+
| Kafka/Zookeeper || |
11+
| Control Center || |
12+
| Connect || |
13+
| Schema Registry || |
14+
| KSQL || |
15+
| TLS Encryption || |
16+
| Authentication || |
17+
18+
19+
### Output
20+
CRD sample:
21+
```shell
22+
apiVersion: platform.confluent.io/v1beta1
23+
kind: Schema
24+
metadata:
25+
annotations:
26+
kubectl.kubernetes.io/last-applied-configuration: |
27+
{"apiVersion":"platform.confluent.io/v1beta1","kind":"Schema","metadata":{"annotations":{},"name":"customer-schema","namespace":"sandbox"},"spec":{"data":{"configRef":"oso-schema-config","format":"avro"}}}
28+
platform.confluent.io/config-revision-hash: 9kg4kgmch4
29+
creationTimestamp: "2022-05-03T16:48:42Z"
30+
finalizers:
31+
- schema.finalizers.platform.confluent.io
32+
generation: 1
33+
name: customer-schema
34+
namespace: sandbox
35+
ownerReferences:
36+
- apiVersion: platform.confluent.io/v1beta1
37+
blockOwnerDeletion: true
38+
controller: true
39+
kind: SchemaRegistry
40+
name: schemaregistry
41+
uid: a7714a0e-6e5d-4950-b3b0-8b5f427a78f7
42+
resourceVersion: "6627"
43+
uid: 2ccb3eb6-1581-4710-9ab4-834f6ffc1419
44+
spec:
45+
data:
46+
configRef: oso-schema-config
47+
format: avro
48+
status:
49+
conditions:
50+
- lastProbeTime: "2022-05-03T16:48:42Z"
51+
lastTransitionTime: "2022-05-03T16:48:42Z"
52+
message: Schema version create successful
53+
reason: successfully created schema version 1
54+
status: "False"
55+
type: platform.confluent.io/failed-create-version
56+
format: avro
57+
id: 3
58+
schemaRegistryEndpoint: https://schemaregistry.sandbox.svc.cluster.local:8081
59+
schemaRegistryTLS: true
60+
state: SUCCEEDED
61+
subject: customer-schema
62+
version: 1
63+
```

stable/schema/kustomization.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
namespace: sandbox
4+
resources:
5+
- namespace.yaml
6+
- ../../base/cfk-components/confluent-no-auth-tls
7+
- ../../base/cfk-components/confluent-no-auth-tls/schmea-registry
8+
- ./schema-config.yaml
9+
- ./schema.yaml
10+
11+
configMapGenerator:
12+
- name: oso-schema-config
13+
files:
14+
- schema=new_customer.avsc
15+
options:
16+
disableNameSuffixHash: true

stable/schema/namespace.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: sandbox

stable/schema/new_customer.avsc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"type": "record",
3+
"namespace": "sh.oso.examples.customer",
4+
"name": "Customer",
5+
"doc": "OSO customer event format 1_0",
6+
"version": "1",
7+
"fields": [
8+
{"name": "name", "type": "string"},
9+
{"name": "email", "type": "string", "default": "NONE"},
10+
{"name": "eventID", "type": "string", "default": "NONE"},
11+
{"name": "eventDateTime", "type":"long", "logicalType": "timestamp-millis"},
12+
{"name": "publishedDateTime", "type":"long", "logicalType": "timestamp-millis"}
13+
]
14+
}

stable/schema/schema.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: platform.confluent.io/v1beta1
2+
kind: Schema
3+
metadata:
4+
name: customer-schema
5+
spec:
6+
data:
7+
configRef: oso-schema-config
8+
format: avro

0 commit comments

Comments
 (0)