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

important-leather-28796

03/11/2019, 3:18 PM
With a certmanager installation, we need to install the custom CRDs before running the helm chart. Is there a pulumi-way of doing things here?
Copy code
## IMPORTANT: you MUST install the cert-manager CRDs **before** installing the
## cert-manager Helm chart
$ kubectl apply \
    -f <https://raw.githubusercontent.com/jetstack/cert-manager/release-0.6/deploy/manifests/00-crds.yaml>
https://github.com/helm/charts/tree/master/stable/cert-manager#installing-the-chart
b

better-rainbow-14549

03/11/2019, 3:31 PM
There's a CustomResource type in pulumi
i

important-leather-28796

03/11/2019, 3:31 PM
https://pulumi.io/reference/pkg/nodejs/@pulumi/kubernetes/yaml/ indicates there is a yaml module available but it is not exposed in the index
@better-rainbow-14549 I am using the custom resource for the Issuer/ClusterIssuer, but was looking for something to run the raw yaml file
b

better-rainbow-14549

03/11/2019, 3:34 PM
I just ported it to json tbh
i

important-leather-28796

03/11/2019, 3:35 PM
to json then wrapped in CustomResource? Each one?
i

important-leather-28796

03/11/2019, 3:36 PM
great, thank you I’ll look through that
b

better-rainbow-14549

03/11/2019, 3:36 PM
i literally pasted the yaml sections into a yaml to json converter
then tidied it up a bit
👍 1
c

cool-egg-852

03/11/2019, 3:46 PM
If you want to run custom yaml:
Copy code
import * as k8s as "@pulumi/kubernetes";
new k8s.yaml.ConfigFile("app.yaml");
👍 1
b

better-rainbow-14549

03/11/2019, 3:51 PM
oh i didnt know about that, nice
i

important-leather-28796

03/11/2019, 3:52 PM
looks like you could use that then pull out resources by name to use in
dependsOn
for the chart
b

better-rainbow-14549

03/11/2019, 3:54 PM
it returns a resource so you should be able to pass the return of the ConfigFile call straight into dependson
i

important-leather-28796

03/11/2019, 3:54 PM
configFile.resources
?
b

better-rainbow-14549

03/11/2019, 3:55 PM
just the whole thing i believe? i havent tried it just looked at the types
i

important-leather-28796

03/11/2019, 3:55 PM
looking at the code now
b

better-rainbow-14549

03/11/2019, 3:56 PM
yea works here
Copy code
const  crds = new kubernetes.yaml.ConfigFile("test.yaml");
{ provider: clusterProvider, dependsOn: [crds] }
i

important-leather-28796

03/11/2019, 3:56 PM
yes
ConfigFile extends CollectionComponentResource
fetch is also in the code, so looks like the raw url may work, will try
Just to close the loop, this worked fine and I used it as a `dependsOn`:
Copy code
// install the crds first
    // @see <https://github.com/helm/charts/tree/master/stable/cert-manager#installing-the-chart>
    const crds = new k8s.yaml.ConfigFile(
      '<https://raw.githubusercontent.com/jetstack/cert-manager/release-0.6/deploy/manifests/00-crds.yaml>',
      undefined,
      opts,
    )
c

creamy-potato-29402

03/11/2019, 7:12 PM
this might actually be the best way to do this.