https://pulumi.com logo
#kubernetes
Title
# kubernetes
l

limited-rain-96205

03/31/2021, 8:04 PM
How can I tell Pulumi to overwrite all resources that are already there?
--replace
requires that you specify each resource, but there are quite a lot, I just want it to clobber everything.
b

billowy-army-68599

03/31/2021, 8:06 PM
destroy and replace?
l

loud-helicopter-75345

03/31/2021, 9:37 PM
I suspect Joseph might be looking for refresh: https://www.pulumi.com/docs/reference/cli/pulumi_refresh/
l

limited-rain-96205

04/01/2021, 5:07 PM
No, a refresh won't fix this issue, nor will destroy. I just want Pulumi to overwrite any resources in the way.
👍 1
For example, this is the error I'm seeing when trying to deploy, even with
-r
(refresh):
Copy code
01-Apr-2021 10:05:42	Retry #0; creation failed: <http://clusterroles.rbac.authorization.k8s.io|clusterroles.rbac.authorization.k8s.io> "flannel" already exists
01-Apr-2021 10:05:42	error: resource flannel was not successfully created by the Kubernetes API server : <http://clusterroles.rbac.authorization.k8s.io|clusterroles.rbac.authorization.k8s.io> "flannel" already exists
l

loud-helicopter-75345

04/02/2021, 1:01 PM
I'm guessing the thinking is that when destroying unmanaged resources you would want to do this carefully and know exactly what Pulumi will destroy. However I can see your point if this is just a dev environment. Looking through the code I don't see any simple way to do this. Perhaps you could instead automate the step of removing these resources with whatever you used to create them?
3 Views