-
Notifications
You must be signed in to change notification settings - Fork 118
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][Design] KRM KCL Spec & User Story #479
Comments
@ekkoful Hi, here. I hope we can participate in improving this content together. ❤️ Ultimately, we use a unified specification to support client and runtime KCL integration tools. |
|
I plan to implement the KCLRun kind resource for kubernetes resource. There is the basic design. cc: @Peefy Note: The KCLRun kind maybe update the kubernetes resource, like pod, deployment... |
OK, no problem! |
I plan to implement the KCLRun kind resource for kubernetes resource. There is the basic design. cc: @Peefy Note: The KCLRun kind maybe update the kubernetes resource, like pod, deployment... What needs to be added is:
|
Introduction
KCL is specifically used for configuration writing and policy validation in cloud-native and Kubernetes scenarios. However, it is obviously not enough to use only one language for Kubernetes configuration management. KCL needs to be integrated with more scenarios and specifications to make it easier and more standardized for users to use KCL in their specific scenarios.
KCL was initially used for modeling, and Kubernetes naturally provided the KRM model. We can reuse existing resources and standardize them in KCL's registry using tools such as KCL OpenAPI and KPM. For example, users can reuse existing resources and abstract their own models (building models such as containers, services, computing, storage, and networks) and reuse them.
Overview
This issue is mainly used to clarify user stories and unified specifications of various KCL scenario models mainly for KRM. (👀 TBD: Perhaps we can give it a better name instead of KRM KCL Spec...)
Pain Points
See Appendix for more
User Story
User Story I (Day1 Deployment)
As SRE/Ops (who), ... I want (what), because (why) ...
I hope to achieve fast and reliable application deployment and updates through deployment automation, improving deployment efficiency, and reducing error rates. Specifically, I hope to have a simple and easy-to-use automation deployment tool that can help me complete the following tasks:
I hope this automation deployment tool can support various application programming languages and frameworks, as well as multiple deployment targets such as virtual machines, containers, and cloud platforms. Additionally, I hope this tool can be integrated with other operations and maintenance tools to achieve a comprehensive automation operations and maintenance chain.
User Story II (Day2 Operation)
As SRE/Ops (who), ... I want (what), because (why) ...
Here are some examples of Day2 operations for SRE:
User Story III
As application developers (who), ... I want (what), because (why) ...
The most important concern for application developers might be to devote maximum their attention to the functional-related development, and to shorter the development-validation cycles, which bring about continuous progressive product enhancement.
User Story IV
As platform developers (who), ... I want (what), because (why) ...
Solution
Design
KRM KCL Spec
The above specifications are the same for any cloud-native tool and K8s controller that integrates KCL (e.g., Helm KCL Plugin, Kustomize KCL Plugin). The usage of the specifications can be mainly divided into three categories: mutation, validation, and abstraction. Through KRM-KCL, we can generate YAML using KCL, and perform mutation or validation based on the stock of YAML.
KRM KCL Function Spec
A KRM KCL function contains as follows
where:
The spec definition (WIP: v1alpha1)
Examples
The output is
Components
How to (WIP)
Use IDE products and CLI tools such as KPM as a unified interface for user interaction. At the basic feature level, CLI/IDE/Dashboard is equivalent
Take CLI as an example
Run
Code
Doc
Check
Lint
Test
Import
Convert various data/DSL configurations and schemas of inventory into KCL
KRM KCL Implementation
KRM KCL Examples
https://github.com/kcl-lang/krm-kcl/tree/main/examples/mutation
https://github.com/kcl-lang/krm-kcl/tree/main/examples/validation
https://github.com/kcl-lang/krm-kcl/tree/main/examples/abstraction
Further More
Automation & GitOps
Moreover, the things defined in the above specifications can still be used in Dev-CI-CD and other operation and maintenance automation processes in combination with IDE and other products, such as overall integration: Gitlab (Dev) - Jenkins (CI) - Harbor (Registry) - KRM-KCL Spec (Config) - ArgoCD (CD) - Kubernetes (Runtime).
Config
Regardless of the configuration method used, they are all friendly to the operation and maintenance automation process.
Data/Schema Migration
Appendix
Real feedback
values.yaml
Reference
The text was updated successfully, but these errors were encountered: