Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm 2.2.2 doesn't recover K8s deployments that were deleted when the HelmRelease was suspended and later resumed #4511

Closed
1 task done
ubajze opened this issue Dec 22, 2023 · 2 comments

Comments

@ubajze
Copy link

ubajze commented Dec 22, 2023

Describe the bug

I use the following procedure, which worked fine in versions before 2.2.0.

  • I suspend the HelmRelease
  • I delete all K8s Deployment objects that HelmRelease created
  • I resume the HelmRelease

After resuming the HelmRelease, the K8s Deployment objects are never re-created.

I tried:

  • suspend/resume the HelmRelease
  • reconcile the HelmRelease

None of the above solutions help.

It seems the only way is to delete and recreate the HelmRelease object.

Steps to reproduce

$ flux suspend hr -n nautobot nautobot
► suspending helmrelease nautobot in nautobot namespace
✔ helmrelease suspended

$ kubectl delete deployment -n nautobot nautobot-default
deployment.apps "nautobot-default" deleted
$ kubectl delete deployment -n nautobot nautobot-celery-beat
deployment.apps "nautobot-celery-beat" deleted
$ kubectl delete deployment -n nautobot nautobot-celery-default
deployment.apps "nautobot-celery-default" deleted
$ kubectl delete deployment -n nautobot nautobot-celery-flower
deployment.apps "nautobot-celery-flower" deleted

$ flux resume hr -n nautobot nautobot
► resuming helmrelease nautobot in nautobot namespace
✔ helmrelease resumed
◎ waiting for HelmRelease reconciliation
✔ HelmRelease reconciliation completed
✔ applied revision 2.0.5

Expected behavior

I would expect that K8s Deployment objects are re-created as in previous versions.

Screenshots and recordings

No response

OS / Distro

Mac, Sonoma 14.1.1

Flux version

flux: v0.33.0

Flux check

► checking prerequisites
✗ flux 0.33.0 <2.2.2 (new version is available, please upgrade)
✔ Kubernetes 1.26.11-eks-8cb36c9 >=1.20.6-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.37.2
✔ image-automation-controller: deployment ready
► ghcr.io/fluxcd/image-automation-controller:v0.37.0
✔ image-reflector-controller: deployment ready
► ghcr.io/fluxcd/image-reflector-controller:v0.31.1
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v1.2.1
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v1.2.3
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v1.2.3
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta2
✔ buckets.source.toolkit.fluxcd.io/v1beta2
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1beta2
✔ helmreleases.helm.toolkit.fluxcd.io/v2beta1
✔ helmrepositories.source.toolkit.fluxcd.io/v1beta2
✔ imagepolicies.image.toolkit.fluxcd.io/v1beta2
✔ imagerepositories.image.toolkit.fluxcd.io/v1beta2
✔ imageupdateautomations.image.toolkit.fluxcd.io/v1beta1
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
✔ providers.notification.toolkit.fluxcd.io/v1beta2
✔ receivers.notification.toolkit.fluxcd.io/v1
✔ all checks passed

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@stefanprodan
Copy link
Member

You need to enable drift detection in the HelmRelease starring with v2beta2 fluxcd/helm-controller#643

@ubajze
Copy link
Author

ubajze commented Dec 22, 2023

Thank you for the quick response. I can confirm that deployments appear after enabling drift detection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants