KusionStack / vscode-kusion

Kusion VS Code Extension provides an intuitive way to view, manage, deliver your applications.
https://marketplace.visualstudio.com/items?itemName=KusionStack.kusion
Apache License 2.0
7 stars 5 forks source link

support live diff preview at the level of model abstraction #24

Open amyXia1994 opened 1 year ago

amyXia1994 commented 1 year ago

Feature

provide live diff preview, so that users will see what changes will be made before actually applying. And the preview should be displayed at the level of model abstraction to avoid the cognitive burden to be aware of infra-oriented details.

Design

The live diff preview can be triggered by 2 entries:

users can:

image

Peefy commented 1 year ago

Due to configuration drift, only displaying the stack configuration diff through the kusion state file or the git state cannot reflect the real situation. Therefore, additional means are needed to configure the mapping of the stack configuration and the cluster's real k8s resources. This configuration can usually be obtained in YAML format or directly written in KCL code through the KCL API. The following describes the approximate format written in KCL configuration.

schema Resource:
     @info(mapping_to = "spec.template.spec.containers[0].resources.requests.cpu")
     cpu: int

schema Server:
     @info(mapping_to = "spec.template.spec.containers[0].resources.requests")
     resource: Resource

Reference:

amyXia1994 commented 1 year ago

support live diff preview at raw k8s level: #50 #52