Hi, Is it possible to create k8s resources from te...
# getting-started
p
Hi, Is it possible to create k8s resources from templated yaml files, with outputs of other pulumi resources as input? The basic flow I’m after is • create an aws resource • use one of the outputs to render a k8s yaml • apply the k8s resource to the cluster It seems I can’t use the
YAML
field of
yaml.ConfigGroupArgs (pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes)
because it expects plain
[]string
, and I can’t use
Transformations
as the docs state that
any values set on the state must be prompt (not Output values)
. The docs also state that I shouldn’t use
Apply
and create the k8s resource in the callback because it could lead to 
pulumi preview
 being wrong. Is there a solution other than using native k8s sdk resources instead of
yaml.ConfigGroups
? Thanks
p
thanks @great-breakfast-56601, I’m familiar with kustomize, but as far as I understand kustomizations are still “static” in nature. What I need is editing a k8s resource based on output of another aws resource. for example, a deployment that accepts the vpc cidr as a flag.
g
You can use the transformations, no?
p
I would need to use
Apply
inside the transformation. The transformation docs state
any values set on the state must be prompt (not Output values)
g
Well, we just hung the thread till we had the values we wanted. But we're getting rid of the transform in favour of this in the near term: https://fluxcd.io/docs/components/kustomize/kustomization/#variable-substitution
So we'll just spit out a secret this can consume.
p
What do you mean by
we just hung the thread till we had the values we wanted.
? How do you technically do that? and how does it affect the previews using
pulumi up
?
The flux variables approach is interesting, thanks
One downside is that your gitops repo is getting another step further from the actual resources deployed in the cluster
g
Copy code
while (Deployment.Instance.IsDryRun != true && string.IsNullOrEmpty(resourceGroupNameOutputValue))
            {
                Thread.Sleep(200);
            }
Not heavily attentive to previews tbh
For me pulumi is about getting cloud resources up then handing over to flux.