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
Feat req: Yaml2Pulumi - Convert YAML manifests to Pulumi code #1158
Comments
I had this need today for that type of YAML to Pulumi conversion. As there are a lot of Helm charts floating around, converting from Helm, with all the variable subsitution & "logic", to Pulumi code (in my case Typescript) would be marvelous. From there, I could continue refactor the deployment. |
I'm not sure if it will be possible for us to automatically convert the configuration logic baked into a Helm chart, but a static YAML config is certainly doable. It would be possible to convert a specified Helm config with something along the lines of |
BTW, I said this in the slack conversation too, but this is fairly straightforwardly doable, and has already been done in the community: https://github.com/itowlson/vscode-pulumi-kubernetes
Alex
Theory is the first term in the Taylor series of practice. -- Thomas M Cover (1992)
…On Thu, Jun 11, 2020 at 9:56 AM, Levi Blackstone < ***@***.*** > wrote:
I'm not sure if it will be possible for us to automatically convert the
configuration logic baked into a Helm chart, but a static YAML config is
certainly doable. It would be possible to convert a specified Helm config
with something along the lines of helm template + yaml2pulumi , but that
wouldn't capture the conditional logic.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub (
#1158 (comment)
) , or unsubscribe (
https://github.com/notifications/unsubscribe-auth/AAKYBBCXKBTTEL6DYT74XH3RWEEDRANCNFSM4N3R5QVA
).
|
FWIW - the work we are doing in pulumi/pulumi#4765 to address pulumi/pulumi#1635 is also very related here. That work emits Pulumi code in any supported language based on reading the state of a resource from a cloud provider/cluster. When applied to Kubernetes, it solves some very similar scenarios, though there is likely an ultimately different desired workflow for this specific task of going directly from YAML to Pulumi. |
This feature exists now as kube2pulumi, so I'm closing out this tracking issue. https://www.pulumi.com/kube2pulumi/ |
Problem description
k8s.yaml.ConfigFile
provides the ability to deploy k8s YAML manifests to a cluster and get up and running with k8s & Pulumi. However, often times this approach will encounter limitations if the manifests are complex, lengthy, require modifications, or if the user needs to extract some property like a resource status or IP address e.g. Istio YAML manifests are over 17K+ LoC.Converting the manifests from YAML to Pulumi code is often the first step users take who wish to truly control the resources being managed. The benefits are primarily associated with the use of the language itself: symbolic referencing, imperative programming, configuration management, and orchestration of lifecycles. Additionally, handling errors / failures / misconfigurations is a much better experience in code than in YAML.
Suggestions for a fix
The solution should leverage schema-based code generations to create an interface that can be used to create working Pulumi code in the target language (TS, Python, Go, .NET).
Targeting TS as the first language to implement Pulumi code from YAML manifests would be a worthy goal.
The text was updated successfully, but these errors were encountered: