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

Support turning on alpha features using feature gates #896

Closed
yujuhong opened this Issue Dec 7, 2016 · 14 comments

Comments

Projects
None yet
6 participants
@yujuhong

yujuhong commented Dec 7, 2016

minikube already supports all alpha api resources to encourage people to try them out. It should also support turning on alpha features in the feature gate.
https://github.com/kubernetes/kubernetes/blob/v1.5.0-beta.2/pkg/genericapiserver/options/server_run_options.go#L531
https://github.com/kubernetes/kubernetes/blob/v1.5.0-beta.2/pkg/util/config/feature_gate.go

@r2d4 r2d4 added the kind/feature label Dec 7, 2016

@yujuhong

This comment has been minimized.

Show comment
Hide comment
@yujuhong

yujuhong Dec 7, 2016

/cc @kubernetes/sig-node @timstclair , we can't turn on CRI in minikube without it supporting the feature gates.

yujuhong commented Dec 7, 2016

/cc @kubernetes/sig-node @timstclair , we can't turn on CRI in minikube without it supporting the feature gates.

@feiskyer

This comment has been minimized.

Show comment
Hide comment
@feiskyer

feiskyer Dec 8, 2016

Member

+1

Member

feiskyer commented Dec 8, 2016

+1

@timstclair

This comment has been minimized.

Show comment
Hide comment
@timstclair

timstclair commented Dec 8, 2016

@r2d4

This comment has been minimized.

Show comment
Hide comment
@r2d4

r2d4 Dec 8, 2016

Member

We can already enable this with the --extra-config flag but I'm open to making it easier to enable though a different way

Member

r2d4 commented Dec 8, 2016

We can already enable this with the --extra-config flag but I'm open to making it easier to enable though a different way

@yujuhong

This comment has been minimized.

Show comment
Hide comment
@yujuhong

yujuhong Dec 8, 2016

@r2d4 I was not able to enable feature gate using --extra-config at all. I skimmed the code and it seems to me that feature gates were directly set through flags, and not included in ServerRunOptions. Could you provide an example of how this could be done?

yujuhong commented Dec 8, 2016

@r2d4 I was not able to enable feature gate using --extra-config at all. I skimmed the code and it seems to me that feature gates were directly set through flags, and not included in ServerRunOptions. Could you provide an example of how this could be done?

@dlorenc

This comment has been minimized.

Show comment
Hide comment
@dlorenc

dlorenc Dec 8, 2016

Contributor

Yeah, we might need to add some code to make featuregate's work. I'll look through the code now.

Contributor

dlorenc commented Dec 8, 2016

Yeah, we might need to add some code to make featuregate's work. I'll look through the code now.

@r2d4

This comment has been minimized.

Show comment
Hide comment
@r2d4

r2d4 Dec 9, 2016

Member

Sorry, it looks like you can't enable them through the config. How can I validate that these are actually enabled? Would something like this work?

diff --git a/pkg/localkube/servers.go b/pkg/localkube/servers.go
index 251c8ff..b812bb7 100644
--- a/pkg/localkube/servers.go
+++ b/pkg/localkube/servers.go
@@ -18,6 +18,7 @@ package localkube
 
 import (
        "fmt"
+       "k8s.io/kubernetes/pkg/util/config"
 )
 
 // Servers allows operations to be performed on many servers at once.
@@ -36,6 +37,7 @@ func (servers Servers) Get(name string) (Server, error) {
 
 // StartAll starts all services, starting from 0th item and ascending.
 func (servers Servers) StartAll() {
+       config.DefaultFeatureGate.Set("AllAlpha=true")
        for _, server := range servers {
                fmt.Printf("Starting %s...\n", server.Name())
                server.Start()
$ minikube logs | grep feature
I1208 23:29:29.585829    3084 feature_gate.go:161] feature gates: map[AllAlpha:true DynamicKubeletConfig:true DynamicVolumeProvisioning:true AllowExtTrafficLocalEndpoints:true]
Member

r2d4 commented Dec 9, 2016

Sorry, it looks like you can't enable them through the config. How can I validate that these are actually enabled? Would something like this work?

diff --git a/pkg/localkube/servers.go b/pkg/localkube/servers.go
index 251c8ff..b812bb7 100644
--- a/pkg/localkube/servers.go
+++ b/pkg/localkube/servers.go
@@ -18,6 +18,7 @@ package localkube
 
 import (
        "fmt"
+       "k8s.io/kubernetes/pkg/util/config"
 )
 
 // Servers allows operations to be performed on many servers at once.
@@ -36,6 +37,7 @@ func (servers Servers) Get(name string) (Server, error) {
 
 // StartAll starts all services, starting from 0th item and ascending.
 func (servers Servers) StartAll() {
+       config.DefaultFeatureGate.Set("AllAlpha=true")
        for _, server := range servers {
                fmt.Printf("Starting %s...\n", server.Name())
                server.Start()
$ minikube logs | grep feature
I1208 23:29:29.585829    3084 feature_gate.go:161] feature gates: map[AllAlpha:true DynamicKubeletConfig:true DynamicVolumeProvisioning:true AllowExtTrafficLocalEndpoints:true]
@jlowdermilk

This comment has been minimized.

Show comment
Hide comment
@jlowdermilk

jlowdermilk Dec 9, 2016

Member

@r2d4 I'm not super familiar with minikube, but if you want to always enable alpha features the above snippet will work. You would need similar line in every kube system binary (kublet, apiserver, controller manager, scheduler etc). featuregates are set via a flag (with same value) on every system component if you are deploying k8s normally.

Member

jlowdermilk commented Dec 9, 2016

@r2d4 I'm not super familiar with minikube, but if you want to always enable alpha features the above snippet will work. You would need similar line in every kube system binary (kublet, apiserver, controller manager, scheduler etc). featuregates are set via a flag (with same value) on every system component if you are deploying k8s normally.

@yujuhong

This comment has been minimized.

Show comment
Hide comment
@yujuhong

yujuhong Dec 9, 2016

@r2d4 this should work since localkube is a single binary and all components are started in one process.

yujuhong commented Dec 9, 2016

@r2d4 this should work since localkube is a single binary and all components are started in one process.

@r2d4

This comment has been minimized.

Show comment
Hide comment
@r2d4

r2d4 Dec 9, 2016

Member

Any thoughts on the UI to configure this through minikube?
minikube start --feature-gates?

I don't think it makes much sense to do it as a special case of the extra config, but that wouldn't require an extra flag
minikube start --extra-config=global.feature-gates=

Member

r2d4 commented Dec 9, 2016

Any thoughts on the UI to configure this through minikube?
minikube start --feature-gates?

I don't think it makes much sense to do it as a special case of the extra config, but that wouldn't require an extra flag
minikube start --extra-config=global.feature-gates=

@r2d4 r2d4 self-assigned this Dec 9, 2016

@dlorenc

This comment has been minimized.

Show comment
Hide comment
@dlorenc

dlorenc Dec 9, 2016

Contributor

Is there any downside to enabling them all, all the time?

Contributor

dlorenc commented Dec 9, 2016

Is there any downside to enabling them all, all the time?

@yujuhong

This comment has been minimized.

Show comment
Hide comment
@yujuhong

yujuhong Dec 9, 2016

Is there any downside to enabling them all, all the time?

One downside could be that the alpha features don't work well together. There is one jenkins build that enabling all of them (https://k8s-testgrid.appspot.com/google-gce#gce-alpha-features), but it runs very few tests.

yujuhong commented Dec 9, 2016

Is there any downside to enabling them all, all the time?

One downside could be that the alpha features don't work well together. There is one jenkins build that enabling all of them (https://k8s-testgrid.appspot.com/google-gce#gce-alpha-features), but it runs very few tests.

@yujuhong

This comment has been minimized.

Show comment
Hide comment
@yujuhong

yujuhong Dec 9, 2016

minikube start --feature-gates?

This sounds good to me.

yujuhong commented Dec 9, 2016

minikube start --feature-gates?

This sounds good to me.

r2d4 added a commit to r2d4/minikube that referenced this issue Jan 9, 2017

Support enabling alpha features with feature gates
This sets the feature gates on every kube-system component (apiserver,
kubelet, etc.)

Fixes kubernetes#896

r2d4 added a commit to r2d4/minikube that referenced this issue Jan 9, 2017

Support enabling alpha features with feature gates
This sets the feature gates on every kube-system component (apiserver,
kubelet, etc.)

Fixes kubernetes#896

@r2d4 r2d4 closed this in #977 Jan 10, 2017

@yujuhong

This comment has been minimized.

Show comment
Hide comment
@yujuhong

yujuhong Jan 10, 2017

@r2d4 thanks for adding the feature!

yujuhong commented Jan 10, 2017

@r2d4 thanks for adding the feature!

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