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 user supplied values bug #4441

Closed
AWKIF opened this issue Aug 7, 2018 · 7 comments
Closed

Helm user supplied values bug #4441

AWKIF opened this issue Aug 7, 2018 · 7 comments

Comments

@AWKIF
Copy link

AWKIF commented Aug 7, 2018

I'm using helm for months now and just upgraded from 2.8 to 2.91

Client: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.9.1", GitCommit:"20adb27c7c5868466912eebdf6664e7390ebe710", GitTreeState:"clean"}

Running this command:
helm upgrade --debug --install islanding XXX/islanding --kube-context admin@cluster-prod --version 0.0.51
worked fine until then but now debug show me this:

USER-SUPPLIED VALUES:
adm_image:
  repository: YYYY
  tag: v0.0.50
api_image:
  repository: XXXX
  tag: v0.0.50

where i didn't supply any values with --set

Some backgrounds:
I used to do this before, meaning supplying image version with --set image.tag=XXX , but not anymore and i'm now working with chart version(updating chart every build)
So my history looks like this:

REVISION	UPDATED                 	STATUS    	CHART           	DESCRIPTION     
51      	Mon Jul 16 08:05:18 2018	SUPERSEDED	islanding-0.1.0 	Upgrade complete
52      	Mon Jul 16 15:16:31 2018	SUPERSEDED	islanding-0.1.0 	Upgrade complete
53      	Wed Jul 18 15:26:53 2018	SUPERSEDED	islanding-0.1.0 	Upgrade complete
54      	Fri Jul 20 14:59:44 2018	SUPERSEDED	islanding-0.1.0 	Upgrade complete
55      	Mon Jul 23 09:16:22 2018	SUPERSEDED	islanding-0.1.0 	Upgrade complete
56      	Tue Jul 24 10:26:14 2018	SUPERSEDED	islanding-0.1.0 	Upgrade complete
57      	Fri Jul 27 09:55:58 2018	SUPERSEDED	islanding-0.1.0 	Upgrade complete
58      	Tue Aug  7 12:47:00 2018	SUPERSEDED	islanding-0.0.51	Upgrade complete
59      	Tue Aug  7 13:02:30 2018	SUPERSEDED	islanding-0.0.51	Upgrade complete
60      	Tue Aug  7 13:06:53 2018	DEPLOYED  	islanding-0.0.51	Upgrade complete

One more thing is that i upgrade tiller env variable:
TILLER_HISTORY_MAX
from 0 to 10 and restarted the tiller pod.

The only solution i've found is:
helm delete --purge and rerun the command.

TL;DR: helm upgrade command does not correctly apply my chart with the correct values

Let me know if you need more info

@AWKIF
Copy link
Author

AWKIF commented Aug 7, 2018

I guess this is more related to modifying the tiller history but not sure

@technosophos
Copy link
Member

What version did this work with?

Normally, the behavior you describe only happens if you do --reuse-values on upgrade. Otherwise, the values should be recalculated from your values and the values in the chart.

If you do a helm get values on one of the upgrades you do, does it show that same list of calculated values?

/cc @adamreese

@technosophos technosophos added bug Categorizes issue or PR as related to a bug. unconfirmed labels Aug 7, 2018
@AWKIF
Copy link
Author

AWKIF commented Aug 7, 2018

I'm not sure what version you mean but for helm i was on 2.8.2 and upgraded to 2.9.1 client and server
I was in a hurry to get the deployment up to date so i deleted/purged, but i will try to reproduce it and give you the output of the get values command.

I've also checked the downloaded tgz charts in the .helm folder and it was the good one, so i really don't know why it reused the old values

@technosophos
Copy link
Member

It looks like I was wrong in my previous post: If no values are sent to the server during an upgrade, it assumes that you are re-using the old values.

// If req.Values is empty, but current.Config is not, copy current into the
// request.
if (req.Values == nil || req.Values.Raw == "" || req.Values.Raw == "{}\n") &&
current.Config != nil &&
current.Config.Raw != "" &&
current.Config.Raw != "{}\n" {
s.Log("copying values from %s (v%d) to new release.", current.Name, current.Version)
req.Values = current.Config
}

@technosophos technosophos added question/support and removed bug Categorizes issue or PR as related to a bug. unconfirmed labels Aug 7, 2018
@AWKIF
Copy link
Author

AWKIF commented Aug 8, 2018

Thanks @technosophos , so it's supposed to work like that -
i guess the best workaround in my case is to change variables names to something else to not get override by the ones from the previous release.
Fine for me even if i find this weird :)
Thanks a lot !

@technosophos
Copy link
Member

Someone told me yesterday that they add a --set foo=bar on each Upgrade, but I believe that the flag --reset-values is probably a better option.

@AWKIF
Copy link
Author

AWKIF commented Aug 9, 2018

i didn't know this flags, thanks a lot for the tips
Cheers !

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

No branches or pull requests

3 participants