Is there something in `@pulumi/kubernetes` that be...
# general
o
Is there something in
@pulumi/kubernetes
that behaves more like
kubectl apply -f
? I found
ConfigFile/ConfigGroup
, but it doesn’t play well with existing objects in the cluster. While it may be doing things the right pulumi-way, I can’t quite marry it with our existing infra (e.g.
import
doesn’t work). We’re currently using
kubectl apply
to rollout app updates and rely on its forgiving behavior with regard to existing objects. I was wondering if it’s possible to achieve something similar with Pulumi. In Terraform we used a third-party provider which gave us the
kubectl_manifest
resource. It would simply store the last applied configuration as the state and re-trigger kubectl apply whenever manifest (supplied yaml) changes.
b
you could render the yaml to a directory: https://www.pulumi.com/docs/reference/pkg/kubernetes/provider/#renderyamltodirectory_nodejs and apply it with kubectl apply
o
Thanks, @billowy-army-68599 So, I actually have all the yaml rendered already and I was looking for ways to mass-apply it to all the k8s clusters managed by Pulumi… In our setup we spin up dozens of k8s clusters and then deploy similar (but not the same) stacks there. There’s a separate server that knows what should be deployed where and can give me yaml by the cluster name. I can obviously write a simple shell script to
kubectl apply
this yaml to each cluster, but I thought it would be better to do it via Pulumi. We already use Pulumi to provision those clusters, and it already knows all the credentials, runs on the CI, etc.
m
Unfortunately that's not possible in Pulumi.