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

curved-morning-41391

02/03/2022, 11:13 PM
Hello, I'm curious if its possible to both render K8s yaml as seen in https://www.pulumi.com/docs/guides/adopting/from_kubernetes/#rendering-kubernetes-yaml and also deploy it with
pulumi up
?
l

little-cartoon-10569

02/03/2022, 11:28 PM
Not using the same provider. But if you're prepared to manage two stacks, you could create the k8s provider in a conditional guarded by the stack name.
Copy code
var k8sProv;
if (Pulumi.getStack() === "k8sYaml") {
  k8sProv = new k8s.Provider("k8s-yaml-renderer", {
    renderYamlToDirectory: "yaml",
  });
} else {
  k8sProv = new k8s.Provider("k8s-yaml-renderer", {});
}
🙌 1
q

quiet-wolf-18467

02/03/2022, 11:52 PM
Why render it and apply as a ConfigFile instead of applying directly? If you're trying to change the Pulumi apply behaviour, it's better to apply the noAwait annotation than what you're describing.
c

curved-morning-41391

02/04/2022, 4:14 AM
This is more just informational, sometimes its nice to look at the YAML before it gets applied. I'm teaching folks Kubernetes at my company and this provides them a better understanding
15 Views