Hi, new to pulumi here. For my use case, we don’t ...
# kubernetes
c
Hi, new to pulumi here. For my use case, we don’t want to use pulumi up, down to deploy k8 resources. want to express k8 configuration as code and generate json or yaml output and use kubectl to release. For example how i can convert below deployment object to json output in python.
Copy code
app_labels = {"app": "nginx"}

deployment = Deployment(
    "nginx",
    spec=DeploymentSpecArgs(
        selector=LabelSelectorArgs(match_labels=app_labels),
        replicas=1,
        template=PodTemplateSpecArgs(
            metadata=ObjectMetaArgs(labels=app_labels),
            spec=PodSpecArgs(containers=[ContainerArgs(name="nginx", image="nginx")])
        ),
    )
)
l
Have a look at the
renderYamlToDirectory
property of our Kubernetes provider. https://www.pulumi.com/registry/packages/kubernetes/api-docs/provider/#renderyamltodirectory_nodejs
g
Yeah we're using this feature to feed into ArgoCD. My goal is to have secrets generated using bitnami' SealedSecrets and just commit the rendered content to the repository. I had to do some weird hacks to have Pulumi "forget" the state so it's always fresh when generated and let ArgoCD deal with the diff. I actualy just asked a Q here to see if I'm doing something anti-pattern or if it's a viable solution....: https://pulumi-community.slack.com/archives/CRFURDVQB/p1680888325245139