Comments (7)
@Martin-Weiss this is a workaround we applied:
- get the NAME of the HelmChart resource:
kubectl -n kube-system get helmchart
- Patch the HelmChart resource you need:
kubectl -n kube-system patch helmchart <NAME> -p '{"metadata":{"annotations":{"helmcharts.cattle.io/managed-by": "helm-controllerDUMMY"}}}' --type=merge
kubectl -n kube-system patch helmchart <NAME> -p '{"metadata":{"finalizers":null}}' --type=merge
- Ensure no more helm controller jobs are running/pending:
kubectl -n kube-system delete job helm-install-<NAME>
- Ensure no more finalizers and "helmcharts.cattle.io/managed-by" annotation is renamed:
$ kubectl -n kube-system get helmchart <NAME> -o yaml
- Remove HelmChart resource:
kubectl -n kube-system delete helmchart <NAME>
In our scenario this prevent helm-controller to invoke the helm-delete job (uninstall)
from helm-controller.
FYI, a while ago #137 added the helmcharts.helm.cattle.io/unmanaged
annotation to the helm controller:
- Adds support for
helmcharts.helm.cattle.io/unmanaged
annotation. HelmChart resources with this annotation will no longer be managed by the Helm controller, and can safely be updated or deleted without the Helm controller triggering any Jobs to install/update/delete the chart.
This is intended for use when an administrator wants to begin managing a Helm releases via another tool, such as Fleet, ArgoCD, or manual invocation of the Helm CLI tools, and wants to ensure that the embedded Helm controller no longer mucks about with the current release.
Also, you don't need to use kubectl patch
to edit annotations, kubectl annotate
is specifically meant for adding or removing annotations from resources.
from helm-controller.
There is not currently a good way to release a Helm chart from management by the Helm controller. Simply removing all the chart manifests from the servers so that they do not ever get updated again is probably the easiest thing to do at the moment; if the HelmChart and HelmChartConfig CRs don't get updated, the chart will never be updated either.
Since just removing the finalizer doesn't appear to prevent the controller from processing the deletion, we could probably add support for an annotation on the HelmChart resource that would tell the controller to skip processing it when it is changed. The process would be to set that annotation, then delete the HelmChart CR.
from helm-controller.
Thanks for the response - so leaving the orphaned helmchart CRD objects in kube-system will never cause the helm operator to do any action on them, anymore even in case there are upgrades?
FYI - we had the issue that during RKE2 upgrade 1.20.8 to 1.20.12 the applications installed via helmchart CRD were uninstalled and re-installed even though we did NOT change anything in manifests/* nor on the CRDs..
from helm-controller.
RKE2 rewrites HelmCharts in the manifests directory at startup to inject a number of cluster configuration variables for use as chart variables. Even if you don't personally change anything in those manifests, if they are in that directory they will get touched to sync the variables: https://github.com/rancher/rke2/blob/3edb2f77b9e46c9e04427a467ee3403be576c5ec/pkg/bootstrap/bootstrap.go#L248-L264
If you simply delete the manifests from all the servers, absent direct user action there will not be any changes to the deployed HelmChart CRs that would cause an update to the chart.
from helm-controller.
RKE2 rewrites HelmCharts in the manifests directory at startup to inject a number of cluster configuration variables for use as chart variables. Even if you don't personally change anything in those manifests, if they are in that directory they will get touched to sync the variables: https://github.com/rancher/rke2/blob/3edb2f77b9e46c9e04427a467ee3403be576c5ec/pkg/bootstrap/bootstrap.go#L248-L264
I am not a developer so I do not understand what the code does, here but I thought that the files in that directory will only get re-applied in case the timestamp changed. Is that not true anymore?
In case the helm charts are re-applied during every re-start that would even mean that every restart would cause a helm-upgrade..
It still does not explain why the helm-operator did a uninstall/re-install without having any modification... - but that might be an other issue.. not sure why we have seen uninstall/install instead of upgrade (btw. we also have seen this for ingress-nginx delivered by RKE2 1.20.12..)
If you simply delete the manifests from all the servers, absent direct user action there will not be any changes to the deployed HelmChart CRs that would cause an update to the chart.
Probably in RKE2 the manifests should be deleted locally automatically after it got applied... deleting the right ones is also not easy as it seems some are delivered via RKE2 so we can not delete all of them.. but at least for the move of Longhorn from manifest/* to fleet this might help..
from helm-controller.
I'm going to close this out as addressed by the aforementioned PR.
from helm-controller.
Related Issues (20)
- Support multiple HelmChartConfig HOT 2
- Klipper is unable to upgrade chart with PDB HOT 12
- v13.3 not released for amd64 HOT 2
- Helm Controller is constantly requeuing deployments HOT 8
- repoCA as a secret reference HOT 4
- modified helm install-job using the k8s dynamic admission controller by injecting some custom labels and annotations into it, causing the Helm Controller is error syncing constantly requeuing HOT 2
- RBAC needed for namespaced deployment HOT 3
- Support set from HelmChartConfig HOT 1
- Fix missing escape for IPv6 support. HOT 4
- How to install the klipper helm chart HOT 2
- Missing documentation for HelmChart and other API objects HOT 3
- Feature: Allow set default job image via env var HOT 4
- No status in HelmChart can reflect the deploying status of a chart HOT 3
- FR: Add `spec.values` to the HelmChart CRD for structured YAML support HOT 10
- IPv6 cluster bootstrap failure HOT 7
- Add option to generate CRD HOT 1
- HelmChart is not passing the --caFile arg with repoCAConfigMap is set HOT 1
- Job image pull secrets
- Bootstrap failing with IPv6 only Cluster HOT 1
- Invalid chart name on install HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helm-controller.