kinvolk/kube-spawn

Allow to set k8s version with `--dev`

Closed this issue · 6 comments

schu commented

Default to latest.

Trying to implement this I seem to get to the limits of viper.

We set a default value to the config element kubernetes-version using viper.SetDefault(...).
Now I can allow setting the option even if --dev is used by simply removing this line but this will still fall back to v1.7.5 .

To set latest as a new default I need information that I only get after viper already considered the defaults and changing it won't have an effect.

schu commented

I understand that having --dev as both a flag w/ and w/o parameter doesn't work. But it should be easy to then have e.g. --dev-image as an optional parameter to specify the hyperkube image to use.

I don't like the name --dev and --dev-image much, but don't have a good idea atm.

schu commented

Instead of --dev, what about a parameter --hyperkube-image with a default of gcr.io/google-containers/hyperkube-amd64:latest.

I think we misunderstood each other.

I was trying to implement e.g. kube-spawn create --dev --kubernetes-version=v.1.7.9 and that works fine by just removing a single line.
But the default version used (if the k8s version flag is not present) is always the same (v1.7.5) whether I set --dev or not.
As far as I can see there is no way to dynamically set defaults in viper.

About a hyperkube flag... This should be considered but I think it belongs here #145

schu commented

Obsolete, closing.