-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Strongly-typed fields for CRD #45
Comments
@ItalyPaleAle do you know if the helm charts provides a schema for the values ? if that's exist it would be simple to include such schema in the CRD definition. |
An additional consideration: if we go this path, then the values expected by the helm chart must be backward compatible or we would end up having to create a number of CRDs, one each time a breaking change is introduced in the helm chart values. |
There’s the values.yaml but it’s not really a schema
They mostly are. Fields are added but generally not removed. Also we wouldn’t be removing values from the CRD here to be able to support older versions of dapr. Passing extra values to Helm is not a problem as they are ignored. |
I think that since helm support schema files for values.yaml, the best would be to have it added to the helm charts first, then we can leverage it later in the CRD and/or validation. In the meantime we can add a subset of commonly used/stable options to the CRD to make it more type safe, @ItalyPaleAle what do you think ? |
I think this could be a good idea regardless, although I don't know how quickly it could be implemented. Also want to point out that the schema above has some differences with the values in "values.yaml" in the OSS project. For example, setting a custom sidecar image also sets "ImagePullPolicy" to always for that pod (since custom sidecar images are generally used for development/testing). Or the grouping of some options is different. The idea is that this could be a bit more opinionated (but not by much).
How large would this subset be? |
Currently, the CRD used by this operator has a single property "value" which accepts anything (any JSON-serializable option).
We would like to propose a new version of the CRD (possibly v1alpha2 or v2alpha1?) which lists the allowed fields explicitly, including most (though not all) options that are allowed by the Dapr Helm chart today.
The proposed schema (which is based on Dapr 1.11 and is missing a few fields for 1.12):
The reconciler would then generate the Helm
--set
flags based on the values defined above in the CRD.A benefit of using a CRD with strictly-defined fields is that it allows catching errors when the resource is deployed on K8s, before the reconciler is invoked. It also allows auto-completion in code editors, among other things.
The text was updated successfully, but these errors were encountered: