-
Notifications
You must be signed in to change notification settings - Fork 566
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
Proposal: Provide a way to run "install --replace" the first time for certain releases #84
Comments
@cmeury Thanks as always for your feedback! I'm a bit hesitant to encourage helmfile users to do this because there may be chances that multiple helmfile.yaml tries to steal the ownership of the shared resource(the storage class in this specific case) from each other! I'd rather add something like a "prerequisites" section in helmfile.yml so that helmfile could validate for existence of specific shared resources(again the storage class in this specific case) before a sync, if that helps. |
And what about the second option of passing extra arguments for every release? releases:
- name: vault
arguments:
- "--replace"
namespace: vault
labels:
foo: bar
chart: roboll/vault-secret-manager
set:
- name: address
value: https://vault.example.com |
@cmeury I think I had somewhat relevant discussion with @sstarcher in #60 (comment). Basically, I'd rather wanted helmfile to be declarative about release itself, rather than specific operations to manage the release. In that regard, for example, However, I'm still nervous because then you may need to ensure all the |
I'm confused by the underlying question of why you would want to do this. Could you please elaborate on why you have a existing chart release and you want to Such as a admin would |
@mumoshu The use case is not replace other releases, but "taking over" resources not managed by Helm. So releases:
- name: vault
options:
replace: true
wait: true
...
namespace: vault
labels:
foo: bar
chart: roboll/vault-secret-manager @sstarcher You're right, my last comment does not match my original proposal. This is a one-off operation when installing a chart for the first time. The use case is basically objects already existing on a cluster such as the charts-%:
helmfile --file ./targets/${*}/helmfile.yaml --selector mode=force charts --args "--force"
helmfile --file ./targets/${*}/helmfile.yaml --selector mode!=force charts |
@cmeury Thx for the response. I believe that your primary purpose here is to take over existing resources. However, my concern was more about that there seems like no way to enforce which helmfile can take over what. It wouldn't be problem if you're the only helmfile operator but I can't help worrying about an another operator's helmfile mistakenly take over the existing resource you originally wanted. Without such enforcement, the existing resource you had taken over would be conceptually "shared" hence the name I suggested. But I guess I would start to feel ok if you really wanted to name it |
My issue with I have never actually used replace, but my understanding was it was for overwriting a release and not for getting ahold of existing manifests that were in the cluster? |
Documentation about
But I see your point about this being an operational concern and should not find a place in helmfile. So I'm fine with closing this as "won't fix". |
@cmeury does replace actually replace resources? I assumed from the documentation it would replace an existing release. |
Looking at the code in But you're making me questioning my whole approach or whether my assumption is not correct. I'll retest. |
ya, the exact way I read that documentation is. If you have a chart that contains My understanding from the documentation is Basically I have never used |
Commenting on an old issue - I think this can be handled in a way described in mumoshu/helm-x#7 |
Would be great to have this. |
@grebois @cmeury @sstarcher Are you still interested in seeing this in helmfile? I finished the helm-x feature. In #673 we already added the initial helm-x integration. So it should be a matter of enhancing our config syntax to accept Example: releases:
- name: kubedns
chart: charts/kube-dns
adopt:
- deploy/kube-dns
- configmap/kube-dns |
Hi @mumoshu I would love to be able to define 'adopt' in a release definition to patch existing resources. By the way, thanks for your work. Great tool ! |
No specific plan yet. But it's already implemented in helm-x and it should be a matter of just adding the new configuration key to |
I will try. I also tried to use helm-x with tillerless set to true. This does'nt work as helm-x don't know the tiller command. |
Thanks! That sounds like a good feature request to helm-x |
Usecase
I'm creating a small chart with out
StorageClass
configuration, but there's already one present with the same name, so I'd like helm to "take it under its wings". This can be done by runninghelm install --replace
. However, this goes against the idempotent way of runninghelm upgrade --install
that we do when we run thecharts
orsync
action.Proposal
Could we:
install
instead of anupgrade
?--replace
directly in the state file (now I have to do it on the command-line and it's valid for all releases, so I have to use the label selector).The text was updated successfully, but these errors were encountered: