Skip to content

Conversation

@Tomek-Adamczewski
Copy link
Collaborator

v1beta1 approach was based on the convention that the actual schema (payload/structure) was stored in configmap and only referenced by KafkaSchema resource. There are a few problems related to that approach:

  1. inconsistent behaviour - when you create a schema resource, configmap needs to be already applied in your namespace. but finalizer deletes that configmap during cleanup
  2. race condition between K8S resources - during reconciliation, it's assumed that configmap was updated prior to updating KafkaSchema. If it wasn't, changes will not be applied. On the other hand, configmap has to be deleted after the custom resource, otherwise finalizer will fail.
  3. difficulties in managing "independent" K8S resources in a single chart - it's not easy/recommended to use owner references from within a single chart, and playing with finalizers to "block deletion" of configmap is tricky

Instead, I would like to propose a simpler approach, where the entire KafkaSchema resource is self-contained. You can define your schema payload directly in the resource or use helm templating to populate it from an external file

BREAKING CHANGE: CR no longer supports reference to schema configmap through spec.data.configRef

@slomkarafa
Copy link
Collaborator

halo, greate work!

Copy link
Collaborator

@slomkarafa slomkarafa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dynamike2010
Copy link

I've been waiting for this - thank you!

@Tomek-Adamczewski Tomek-Adamczewski force-pushed the feature/inlined_schema_definitions branch from dde7c66 to 38f6ddd Compare March 15, 2024 16:12
Base automatically changed from fix/soft_deleting_schema_subjects to master March 15, 2024 17:12
Tomek and others added 2 commits March 15, 2024 18:13
v1beta1 approach was based on the convention that the actual schema
(payload/structure) was stored in configmap and only referenced by
KafkaSchema resource. There are a few problems related to that approach:

1. inconsistent behaviour - when you create a schema resource, configmap
needs to be already applied in your namespace. but finalizer deletes
that configmap during cleanup
2. race condition between K8S resources - during reconciliation, it's
assumed that configmap was updated prior to updating KafkaSchema. If it
wasn't, changes will not be applied. On the other hand, configmap has to
be deleted after the custom resource, otherwise finalizer will fail.
3. difficulties in managing "independent" K8S resources in a single
chart - it's not easy/recommended to use owner references from within a
single chart, and playing with finalizers to "block deletion" of
configmap is tricky

Instead, I would like to propose a simpler approach, where the entire
KafkaSchema resource is self-contained. You can define your schema
payload directly in the resource or use helm templating to populate it
from an external file

BREAKING CHANGE: CR no longer supports reference to schema configmap
through spec.data.configRef
…r resource

KafkaSchema resource now has a schemaRegistry that overrides defaults
(configured as env variables of the operator)

BREAKING CHANGE: I've decided to change apigroup from pannoi to incubly
due to incompatibility of CRD in previous PR
@Tomek-Adamczewski Tomek-Adamczewski force-pushed the feature/inlined_schema_definitions branch from 4ea9f49 to 4ec05f9 Compare March 15, 2024 17:14
@Tomek-Adamczewski Tomek-Adamczewski force-pushed the feature/inlined_schema_definitions branch from 4ec05f9 to 6f322c4 Compare March 15, 2024 17:32
@Tomek-Adamczewski Tomek-Adamczewski force-pushed the feature/inlined_schema_definitions branch from 60062aa to 9bba282 Compare March 18, 2024 06:58
@Tomek-Adamczewski Tomek-Adamczewski force-pushed the feature/inlined_schema_definitions branch from 790c587 to 52ddab1 Compare March 18, 2024 10:41
@Tomek-Adamczewski Tomek-Adamczewski force-pushed the feature/inlined_schema_definitions branch from 52ddab1 to dc8a9e2 Compare March 18, 2024 10:57
@Tomek-Adamczewski Tomek-Adamczewski force-pushed the feature/inlined_schema_definitions branch from dc8a9e2 to b333d0c Compare March 18, 2024 11:02
@Tomek-Adamczewski Tomek-Adamczewski force-pushed the feature/inlined_schema_definitions branch from b333d0c to 5c6276d Compare March 18, 2024 11:14
@Tomek-Adamczewski Tomek-Adamczewski force-pushed the feature/inlined_schema_definitions branch from 0741e8c to 3f00745 Compare March 18, 2024 13:31
@Tomek-Adamczewski Tomek-Adamczewski merged commit 538ddfd into master Mar 18, 2024
@Brightside56
Copy link

Brightside56 commented Mar 19, 2024

Inline definitions are ok, but plaintext credentials for schema registry in CR don't make me happy 😄 There could be registryCredentialsSecretRef at least

@Tomek-Adamczewski
Copy link
Collaborator Author

@Brightside56 agreed. I'll fix that in another PR. Please don't use it for the time being ;)

@slomkarafa
Copy link
Collaborator

@Brightside56 that is just a comment or you need to use credentials in your use case? because we wanted to drop authentication feature for now, as there is a plan to do it in more sophisticated way to allow different auth methods, not only Basic

@Brightside56
Copy link

@slomkarafa Yes, I need to use credentials and I need them to be processed securely

@Brightside56
Copy link

@Brightside56 agreed. I'll fix that in another PR. Please don't use it for the time being ;)

For now it's more than ok. I'm concerned more with issues like absence of schema validation and possibility to check resources health using CR status

@slomkarafa
Copy link
Collaborator

@Brightside56 and possibility to check resources health using CR status that's already planned, but we (or mainly @Tomek-Adamczewski :p) are doing that in the meantime, so we strongly encourage to contribution :p

@Tomek-Adamczewski
Copy link
Collaborator Author

@Brightside56 on schema validation - schema registry should do that for you. do you think we should duplicate that responsibility in operator?

Anyway, I've enabled issues in this repo for you to start throwing darts at me. When I think what this operator should actually do, I'm considering creating a completely new api group and start from scratch, as I won't be able to maintain any compatibility.

@Tomek-Adamczewski Tomek-Adamczewski deleted the feature/inlined_schema_definitions branch March 25, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants