Skip to content

Commit

Permalink
chore: update features gates for v3, remove Gateway feature gate (#4968)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek authored Oct 26, 2023
1 parent c184988 commit 1351004
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 31 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ Adding a new version? You'll need three changes:
update Secrets is available at https://github.com/Kong/kubernetes-ingress-controller/issues/2502#issuecomment-1758213596
[#4825](https://github.com/Kong/kubernetes-ingress-controller/pull/4825)


### Fixed

- No more "log.SetLogger(...) was never called..." log entry during shutdown of KIC
Expand Down Expand Up @@ -163,6 +162,15 @@ Adding a new version? You'll need three changes:
the controller resides in a separate Deployment. This allows the controller
to manage its own mTLS negotiation.
[#4942](https://github.com/Kong/kubernetes-ingress-controller/pull/4942)
- Remove `Gateway` feature flag for Gateway API.
[#4968](https://github.com/Kong/kubernetes-ingress-controller/pull/4968)

It was enabled by default since 2.6.0 so the default behavior doesn't change.
If users want to disable related functionality, they still can by disabling
related Gateway API controllers via setting the following flags to `false`:
- `--enable-controller-gwapi-gateway`
- `--enable-controller-gwapi-httproute`
- `--enable-controller-gwapi-reference-grant`

### Added

Expand Down
32 changes: 16 additions & 16 deletions FEATURE_GATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,16 @@ Once a feature graduates from `Alpha` to `Beta` maturity these preview docs will

### Feature gates for graduated or deprecated features

| Feature | Default | Stage | Since | Until |
|----------------------------|---------|------------|-------|-------|
| Feature | Default | Stage | Since | Until |
|------------------|---------|-------|--------|-------|
| Gateway | `false` | Alpha | 2.2.0 | 2.6.0 |
| Gateway | `true` | Beta | 2.6.0 | 3.0.0 |
| CombinedRoutes | `false` | Alpha | 2.4.0 | 3.0.0 |
| CombinedRoutes | `true` | Beta | 2.8.0 | 3.0.0 |
| CombinedServices | `false` | Alpha | 2.10.0 | 3.0.0 |
| CombinedServices | `true` | Beta | 2.11.0 | 3.0.0 |
| ExpressionRoutes | `false` | Alpha | 2.10.0 | 3.0.0 |
| Knative | `false` | Alpha | 0.8.0 | 3.0.0 |

Features that reach GA and over time become stable will be removed from this table, they can be found in the main [KIC CRD Documentation][specs] and [Guides][guides].

Expand All @@ -54,20 +62,12 @@ Features that reach GA and over time become stable will be removed from this tab

### Feature gates for Alpha or Beta features

| Feature | Default | Stage | Since | Until |
|------------------|---------|-------|---------|-------|
| Knative | `false` | Alpha | 0.8.0 | 3.0.0 |
| Gateway | `false` | Alpha | 2.2.0 | TBD |
| Gateway | `true` | Beta | 2.6.0 | TBD |
| CombinedRoutes | `false` | Alpha | 2.4.0 | 3.0.0 |
| CombinedRoutes | `true` | Beta | 2.8.0 | 3.0.0 |
| GatewayAlpha | `false` | Alpha | 2.6.0 | TBD |
| ExpressionRoutes | `false` | Alpha | 2.10.0 | 3.0.0 |
| CombinedServices | `false` | Alpha | 2.10.0 | 3.0.0 |
| CombinedServices | `true` | Beta | 2.11.0 | 3.0.0 |
| FillIDs | `false` | Alpha | 2.10.0 | 3.0.0 |
| FillIDs | `true` | Beta | 3.0.0 | TBD |
| RewriteURIs | `false` | Alpha | 2.12.0 | TBD |
| Feature | Default | Stage | Since | Until |
|--------------|---------|-------|--------|-------|
| GatewayAlpha | `false` | Alpha | 2.6.0 | TBD |
| FillIDs | `false` | Alpha | 2.10.0 | 3.0.0 |
| FillIDs | `true` | Beta | 3.0.0 | TBD |
| RewriteURIs | `false` | Alpha | 2.12.0 | TBD |

**NOTE**: The `Gateway` feature gate refers to [Gateway
API](https://github.com/kubernetes-sigs/gateway-api) APIs which are in
Expand Down
6 changes: 3 additions & 3 deletions internal/manager/controllerdef.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func setupControllers(
// Gateway API Controllers
// ---------------------------------------------------------------------------
{
Enabled: c.GatewayAPIGatewayController && featureGates[featuregates.GatewayFeature],
Enabled: c.GatewayAPIGatewayController,
Controller: &crds.DynamicCRDController{
Manager: mgr,
Log: ctrl.LoggerFrom(ctx).WithName("controllers").WithName("Dynamic/Gateway"),
Expand All @@ -285,7 +285,7 @@ func setupControllers(
},
},
{
Enabled: c.GatewayAPIHTTPRouteController && featureGates[featuregates.GatewayFeature],
Enabled: c.GatewayAPIHTTPRouteController,
Controller: &crds.DynamicCRDController{
Manager: mgr,
Log: ctrl.LoggerFrom(ctx).WithName("controllers").WithName("Dynamic/HTTPRoute"),
Expand All @@ -306,7 +306,7 @@ func setupControllers(
},
},
{
Enabled: c.GatewayAPIReferenceGrantController && featureGates[featuregates.GatewayFeature],
Enabled: c.GatewayAPIReferenceGrantController,
Controller: &crds.DynamicCRDController{
Manager: mgr,
Log: ctrl.LoggerFrom(ctx).WithName("controllers").WithName("Dynamic/ReferenceGrant"),
Expand Down
4 changes: 0 additions & 4 deletions internal/manager/featuregates/feature_gates.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ import (
// -----------------------------------------------------------------------------

const (
// GatewayFeature is the name of the feature-gate for enabling/disabling GatewayFeature APIs.
GatewayFeature = "Gateway"

// GatewayAlphaFeature is the name of the feature-gate for enabling or
// disabling the Alpha maturity APIs and relevant features for Gateway API.
GatewayAlphaFeature = "GatewayAlpha"
Expand Down Expand Up @@ -60,7 +57,6 @@ func (fg FeatureGates) Enabled(feature string) bool {
// NOTE: if you're adding a new feature gate, it needs to be added here.
func GetFeatureGatesDefaults() map[string]bool {
return map[string]bool{
GatewayFeature: true,
GatewayAlphaFeature: false,
FillIDsFeature: true,
RewriteURIsFeature: false,
Expand Down
4 changes: 2 additions & 2 deletions internal/manager/featuregates/feature_gates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ func TestFeatureGates(t *testing.T) {
assert.Len(t, fgs, len(GetFeatureGatesDefaults()))

t.Log("verifying feature gates setup results when valid feature gates options are present")
featureGates := map[string]bool{GatewayFeature: true}
featureGates := map[string]bool{GatewayAlphaFeature: true}
fgs, err = New(setupLog, featureGates)
assert.NoError(t, err)
assert.True(t, fgs[GatewayFeature])
assert.True(t, fgs[GatewayAlphaFeature])

t.Log("configuring several invalid feature gates options")
featureGates = map[string]bool{"invalidGateway": true}
Expand Down
4 changes: 2 additions & 2 deletions internal/manager/telemetry/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestCreateManager(t *testing.T) {
"kv": "3.1.1",
}
featureGates = map[string]bool{
"gateway": true,
"gatewayalpha": true,
}
publishService = k8stypes.NamespacedName{
Namespace: "kong",
Expand Down Expand Up @@ -119,7 +119,7 @@ func TestCreateManager(t *testing.T) {
"signal=test-signal;"+
"db=off;"+
"feature-gateway-service-discovery=true;"+
"feature-gateway=true;"+
"feature-gatewayalpha=true;"+
"feature-konnect-sync=true;"+
"hn=%s;"+
"kv=3.1.1;"+
Expand Down
2 changes: 0 additions & 2 deletions test/envtest/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func ConfigForEnvConfig(t *testing.T, envcfg *rest.Config, opts ...mocks.AdminAP
cfg.Konnect.LicenseSynchronizationEnabled = false
cfg.AnonymousReports = false
cfg.FeatureGates = featuregates.GetFeatureGatesDefaults()
cfg.FeatureGates[featuregates.GatewayFeature] = false

// Extend the graceful shutdown timeout to prevent flakiness on CI.
cfg.GracefulShutdownTimeout = lo.ToPtr(time.Minute)
Expand All @@ -82,7 +81,6 @@ func ConfigForEnvConfig(t *testing.T, envcfg *rest.Config, opts ...mocks.AdminAP
type ModifyManagerConfigFn func(cfg *manager.Config)

func WithGatewayFeatureEnabled(cfg *manager.Config) {
cfg.FeatureGates[featuregates.GatewayFeature] = true
cfg.FeatureGates[featuregates.GatewayAlphaFeature] = true
}

Expand Down
1 change: 0 additions & 1 deletion test/envtest/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ func verifyTelemetryReport(t *testing.T, k8sVersion *version.Info, report string
"db=off;"+
"feature-fillids=true;"+
"feature-gateway-service-discovery=false;"+
"feature-gateway=false;"+
"feature-gatewayalpha=false;"+
"feature-konnect-sync=false;"+
"feature-rewriteuris=false;"+
Expand Down

0 comments on commit 1351004

Please sign in to comment.