Skip to content

Helm does not remove object when resource Kind is used with multiple API Versions #10748

@Evesy

Description

@Evesy

Output of helm version: 3.8.1

Output of kubectl version: 1.21.5

Cloud Provider/Platform (AKS, GKE, Minikube etc.): GKE

When removing a particular custom resource from a helm release, Helm will not delete the resource if another custom resource of the same Kind, but completely different apiVersion also exists in the release.

Take a helm chart with just the below two resources being deployed:

apiVersion: burp.io/v1
kind: Site
metadata:
  name: meves-test
spec:
  host: ...
  name: ...
  owner: ...
---
apiVersion: cloudflare.com/v1
kind: Site
metadata:
  name: meves-test
spec:
  hosts:
  - ...
  origin: ...
  wafZone: ...

Installing the chart, both resources are created. If I then remove e.g. the bottom resource (cloudflare.com/v1) from the chart and run an upgrade, while the resource no longer appears in the Helm release (helm get manifest), the underlying Kubernetes resource is not deleted.

  • This is the case when removing either of the resources.
  • This doesn't happen if metadata.name does not match between the two resources
  • If I add a third random resource (e.g. ConfigMap) and remove both the custom resources at the same time, they are both successfully removed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions