Skip to content

Commit

Permalink
Promote AdminKubeconfigRequest feature gate to GA (#5511)
Browse files Browse the repository at this point in the history
  • Loading branch information
acumino committed Mar 8, 2022
1 parent 708d86e commit 14b8b4f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 14 deletions.
5 changes: 3 additions & 2 deletions docs/deployment/feature_gates.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ The following tables are a summary of the feature gates that you can set on diff
| SeedKubeScheduler | `false` | `Alpha` | `1.15` | |
| ReversedVPN | `false` | `Alpha` | `1.22` | `1.41` |
| ReversedVPN | `true` | `Beta` | `1.42` | |
| AdminKubeconfigRequest | `false` | `Alpha` | `1.24` | `1.38` |
| AdminKubeconfigRequest | `true` | `Beta` | `1.39` | |
| UseDNSRecords | `false` | `Alpha` | `1.27` | `1.38` |
| UseDNSRecords | `true` | `Beta` | `1.39` | |
| RotateSSHKeypairOnMaintenance | `false` | `Alpha` | `1.28` | |
Expand Down Expand Up @@ -64,6 +62,9 @@ The following tables are a summary of the feature gates that you can set on diff
| DisallowKubeconfigRotationForShootInDeletion | | `Removed` | `1.38` | |
| Logging | `false` | `Alpha` | `0.13` | `1.40` |
| Logging | `false` | `Removed` | `1.41` | |
| AdminKubeconfigRequest | `false` | `Alpha` | `1.24` | `1.38` |
| AdminKubeconfigRequest | `true` | `Beta` | `1.39` | `1.41` |
| AdminKubeconfigRequest | `true` | `GA` | `1.42` | |

## Using a feature

Expand Down
2 changes: 1 addition & 1 deletion docs/proposals/16-adminkubeconfig-subresource.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ status:
client-key-data: LS0tLS1CRUd...
```

The `AdminKubeconfigRequest` feature gate (enabled by default starting from `v1.39`) enables the above mentioned API in the `gardener-apiserver`. The old `{shoot-name}.kubeconfig` is kept, but deprecated and will be removed in the future.
New feature gate called `AdminKubeconfigRequest` enables the above mentioned API in the `gardener-apiserver`. The old `{shoot-name}.kubeconfig` is kept, but deprecated and will be removed in the future.

In order to get the server's address used in the `kubeconfig`, the Shoot's `status` should be updated with new entries:

Expand Down
1 change: 0 additions & 1 deletion example/gardener-local/controlplane/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ global:
featureGates:
UseDNSRecords: true
SeedChange: true
AdminKubeconfigRequest: true
WorkerPoolKubernetesVersion: true
ShootCARotation: true
resources: {}
Expand Down
2 changes: 1 addition & 1 deletion pkg/apiserver/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (

var featureGates = map[featuregate.Feature]featuregate.FeatureSpec{
features.SeedChange: {Default: false, PreRelease: featuregate.Alpha},
features.AdminKubeconfigRequest: {Default: true, PreRelease: featuregate.Beta},
features.AdminKubeconfigRequest: {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
features.UseDNSRecords: {Default: true, PreRelease: featuregate.Beta},
features.WorkerPoolKubernetesVersion: {Default: false, PreRelease: featuregate.Alpha},
features.SecretBindingProviderValidation: {Default: false, PreRelease: featuregate.Alpha},
Expand Down
1 change: 1 addition & 0 deletions pkg/features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const (
// owner: @petersutter
// alpha: v1.24.0
// beta: v1.39.0
// GA: v1.42.0
AdminKubeconfigRequest featuregate.Feature = "AdminKubeconfigRequest"

// UseDNSRecords enables using DNSRecords resources for Gardener DNS records instead of DNSProvider and DNSEntry resources.
Expand Down
14 changes: 5 additions & 9 deletions pkg/registry/core/shoot/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"time"

"github.com/gardener/gardener/pkg/apis/core"
"github.com/gardener/gardener/pkg/features"
"github.com/gardener/gardener/pkg/registry/core/shoot"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand All @@ -29,7 +28,6 @@ import (
genericregistry "k8s.io/apiserver/pkg/registry/generic/registry"
"k8s.io/apiserver/pkg/registry/rest"
"k8s.io/apiserver/pkg/storage"
utilfeature "k8s.io/apiserver/pkg/util/feature"
)

// REST implements a RESTStorage for shoots against etcd
Expand All @@ -53,13 +51,11 @@ func NewStorage(optsGetter generic.RESTOptionsGetter, shootStateStore *genericre
Status: shootStatusRest,
}

if utilfeature.DefaultFeatureGate.Enabled(features.AdminKubeconfigRequest) {
s.AdminKubeconfig = &AdminKubeconfigREST{
shootStateStorage: shootStateStore,
shootStorage: shootRest,
clock: clock.RealClock{},
maxExpirationSeconds: int64(max.Seconds()),
}
s.AdminKubeconfig = &AdminKubeconfigREST{
shootStateStorage: shootStateStore,
shootStorage: shootRest,
clock: clock.RealClock{},
maxExpirationSeconds: int64(max.Seconds()),
}

return s
Expand Down

0 comments on commit 14b8b4f

Please sign in to comment.