[Spike] Investigate a structured GitLab resource specification
Overview
The specification of the current version (i.e. v1beta1
) of GitLab custom resource (CR), accepts GitLab Chart version
and a free-format set of Helm values
. This is because GitLab Operator heavily depends on GitLab Chart hence adopting its configuration style.
In order to offer a better user experience with GitLab Operator, we want to explore the possibility of using a structured resource specification for GitLab CR. This structure provides semantic and adds meaning to the configuration and offers better configuration validation and verification.
Method
Maturity of GitLab Chart is an opportunity that we can leverage to extract a configuration model of cloud-native deployment.
One possible approach to accomplish this is:
- Survey the existing Helm values of GitLab Chart and their usage.
- Map the values into the new structure.
- Refactor the values where applicable. For example we are no longer bound by context of values (global vs. subchart values). The rule of thumb is that we can reconstitute the Helm values from GitLab CR specification.
- Use available and well-know Kubernetes API types. For example, PodTemplate or suitable Secret type instead of key referencing.
- Track of the mapping and consider the possibility of automating the migration of Helm values to the new GitLab CR specification. This will be useful for automated migration from Chart to Operator.
Challenges
- Structural changes to GitLab configuration necessitates a new CRD and resource versioning.
- Multiple resource versions require a storage version and conversion.
Deliverables
This is a research spike and should lead to further follow-up issues. The following issues should be addressed:
- Appraising risks of using a structured resource specification and how to mitigate them. Some of the challenges are listed above.
- The efficacy of the method and how we can improve and validate it.
- A few examples to show the usage of structured specification for different deployment scenarios.
Action items
-
Create a PoC for GitLab resource specification and mapping to GitLab Chart values.