https://pulumi.com logo
#general
Title
# general
c

calm-greece-42329

02/04/2020, 6:11 PM
is there an existing tool for transliterating k8s CRDs to pulumi types?
g

gorgeous-egg-16927

02/04/2020, 6:13 PM
Not yet, but It’s something we’ve talked about. How would you want to see such a tool work?
c

calm-greece-42329

02/04/2020, 6:14 PM
i havent looked how they are natively done in go now, so i dont have strong opinions, but if it was something that was easily run as part of a build process to generate them, perfect
we are mostly looking at supporting some of the CRDs related to the prometheus operator @big-potato-91793
unlikely to change much, but also hate to see a bunch of manual eyeball conversions
g

gorgeous-egg-16927

02/04/2020, 6:17 PM
Right; I think we’ll create a standalone code-generator tool for that at some point. In the meantime, easiest approach is probably loading the YAML with ConfigFile/ConfigGroup.
c

calm-greece-42329

02/04/2020, 6:20 PM
we do it like this but we lose the type checking
Copy code
const operatedServiceMonitor = new k8s.apiextensions.CustomResource("prometheus-operated", {
    apiVersion: "<http://monitoring.coreos.com/v1|monitoring.coreos.com/v1>",
    kind: "ServiceMonitor"
g

gorgeous-egg-16927

02/04/2020, 6:22 PM
s

stocky-island-3676

02/06/2020, 6:04 PM
@calm-greece-42329 We also had this question today. Also for
prometheus-operator
parts, esp.
PrometheusRule
for alerts.
b

big-potato-91793

02/08/2020, 1:35 AM
where @stocky-island-3676 ?
s

stocky-island-3676

02/10/2020, 4:43 PM
@big-potato-91793 At work. Wanted to support that we also stumbled upon this issue. I didn’t duplicate the question in an extra post, if that’s what you asked for.