diff --git a/README.md b/README.md index f3b552f..0cbf3e9 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ All Examples will require the steps mentioned in [GETTING_STARTED.md](https://gi * [Monitoring Kakfa CFK with JMX Prometheus and Grafana](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/grafana-prometheus) * [User provided mTLS for Kafka in CFK](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/external-mtls) * [Vault enabled secrets store for Kafka](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/vault-key-value) + * [Confluent Schema CRD to declaratively create, read, and delete schemas](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/schema) ### Broken / WIP Deployments * [Vault PKI integration with dynamic SSL](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/broken/pki-vault--waiting-for-kafka-2.7) diff --git a/README.yaml b/README.yaml index fd98bc5..5c52250 100755 --- a/README.yaml +++ b/README.yaml @@ -42,6 +42,7 @@ examples: |- * [Monitoring Kakfa CFK with JMX Prometheus and Grafana](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/grafana-prometheus) * [User provided mTLS for Kafka in CFK](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/external-mtls) * [Vault enabled secrets store for Kafka](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/vault-key-value) + * [Confluent Schema CRD to declaratively create, read, and delete schemas](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/stable/schema) ### Broken / WIP Deployments * [Vault PKI integration with dynamic SSL](https://github.com/osodevops/confluent-kubernetes-playground/tree/main/broken/pki-vault--waiting-for-kafka-2.7) diff --git a/base/cfk-components/confluent-no-auth-tls/kustomization.yaml b/base/cfk-components/confluent-no-auth-tls/kustomization.yaml index 0cb6e39..1fec94d 100644 --- a/base/cfk-components/confluent-no-auth-tls/kustomization.yaml +++ b/base/cfk-components/confluent-no-auth-tls/kustomization.yaml @@ -4,5 +4,5 @@ resources: - secrets - zookeeper.yaml - kafka.yaml - - control-centre.yaml +# - control-centre.yaml # - rest-class.yaml \ No newline at end of file diff --git a/stable/schema/README.md b/stable/schema/README.md new file mode 100644 index 0000000..d634333 --- /dev/null +++ b/stable/schema/README.md @@ -0,0 +1,63 @@ +# Schema CRD Deployment +A working example of the new Schema CRD, you can declaratively create, read, and delete schemas as Schema custom resources (CRs) in Kubernetes. + +The example uses an Avro schema which is loaded into a ConfigMap and referenced in the Schema CRD. + +## Features + +| Feature | Enabled | Note | +|:----------------|:-------:|-------:| +| Kafka/Zookeeper | ✅ | | +| Control Center | ✅ | | +| Connect | ❌ | | +| Schema Registry | ✅ | | +| KSQL | ❌ | | +| TLS Encryption | ❌ | | +| Authentication | ❌ | | + + +### Output +CRD sample: +```shell +apiVersion: platform.confluent.io/v1beta1 +kind: Schema +metadata: + annotations: + kubectl.kubernetes.io/last-applied-configuration: | + {"apiVersion":"platform.confluent.io/v1beta1","kind":"Schema","metadata":{"annotations":{},"name":"customer-schema","namespace":"sandbox"},"spec":{"data":{"configRef":"oso-schema-config","format":"avro"}}} + platform.confluent.io/config-revision-hash: 9kg4kgmch4 + creationTimestamp: "2022-05-03T16:48:42Z" + finalizers: + - schema.finalizers.platform.confluent.io + generation: 1 + name: customer-schema + namespace: sandbox + ownerReferences: + - apiVersion: platform.confluent.io/v1beta1 + blockOwnerDeletion: true + controller: true + kind: SchemaRegistry + name: schemaregistry + uid: a7714a0e-6e5d-4950-b3b0-8b5f427a78f7 + resourceVersion: "6627" + uid: 2ccb3eb6-1581-4710-9ab4-834f6ffc1419 +spec: + data: + configRef: oso-schema-config + format: avro +status: + conditions: + - lastProbeTime: "2022-05-03T16:48:42Z" + lastTransitionTime: "2022-05-03T16:48:42Z" + message: Schema version create successful + reason: successfully created schema version 1 + status: "False" + type: platform.confluent.io/failed-create-version + format: avro + id: 3 + schemaRegistryEndpoint: https://schemaregistry.sandbox.svc.cluster.local:8081 + schemaRegistryTLS: true + state: SUCCEEDED + subject: customer-schema + version: 1 +``` \ No newline at end of file diff --git a/stable/schema/kustomization.yaml b/stable/schema/kustomization.yaml new file mode 100644 index 0000000..d2e8d82 --- /dev/null +++ b/stable/schema/kustomization.yaml @@ -0,0 +1,16 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: sandbox +resources: +- namespace.yaml +- ../../base/cfk-components/confluent-no-auth-tls +- ../../base/cfk-components/confluent-no-auth-tls/schmea-registry +- ./schema-config.yaml +- ./schema.yaml + +configMapGenerator: + - name: oso-schema-config + files: + - schema=new_customer.avsc + options: + disableNameSuffixHash: true \ No newline at end of file diff --git a/stable/schema/namespace.yaml b/stable/schema/namespace.yaml new file mode 100644 index 0000000..6b30586 --- /dev/null +++ b/stable/schema/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: sandbox diff --git a/stable/schema/new_customer.avsc b/stable/schema/new_customer.avsc new file mode 100644 index 0000000..a2f02f8 --- /dev/null +++ b/stable/schema/new_customer.avsc @@ -0,0 +1,14 @@ +{ + "type": "record", + "namespace": "sh.oso.examples.customer", + "name": "Customer", + "doc": "OSO customer event format 1_0", + "version": "1", + "fields": [ + {"name": "name", "type": "string"}, + {"name": "email", "type": "string", "default": "NONE"}, + {"name": "eventID", "type": "string", "default": "NONE"}, + {"name": "eventDateTime", "type":"long", "logicalType": "timestamp-millis"}, + {"name": "publishedDateTime", "type":"long", "logicalType": "timestamp-millis"} + ] +} \ No newline at end of file diff --git a/stable/schema/schema.yaml b/stable/schema/schema.yaml new file mode 100644 index 0000000..079a2ce --- /dev/null +++ b/stable/schema/schema.yaml @@ -0,0 +1,8 @@ +apiVersion: platform.confluent.io/v1beta1 +kind: Schema +metadata: + name: customer-schema +spec: + data: + configRef: oso-schema-config + format: avro \ No newline at end of file