Skip to content
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

Closed
metral opened this issue Jun 11, 2020 · 5 comments
Closed

Feat req: Yaml2Pulumi - Convert YAML manifests to Pulumi code #1158

metral opened this issue Jun 11, 2020 · 5 comments
Assignees
Milestone

Comments

@metral
Copy link
Contributor

metral commented Jun 11, 2020

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.

@ringods
Copy link
Member

ringods commented Jun 11, 2020

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.

@lblackstone
Copy link
Member

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.

@hausdorff
Copy link
Contributor

hausdorff commented Jun 11, 2020 via email

@lukehoban
Copy link
Member

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.

@leezen leezen added this to the current milestone Jun 23, 2020
@metral metral removed their assignment Jul 16, 2020
@lblackstone
Copy link
Member

lblackstone commented Aug 13, 2020

This feature exists now as kube2pulumi, so I'm closing out this tracking issue.

https://www.pulumi.com/kube2pulumi/
https://www.pulumi.com/blog/introducing-kube2pulumi/

@leezen leezen modified the milestones: current, 0.42 Aug 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants