Skip to content

Commit

Permalink
[Issue kubernetes#95707] Remove WindowsGMSA and WindowsRunAsUserName …
Browse files Browse the repository at this point in the history
…features from code.
  • Loading branch information
mrmassis committed Oct 20, 2020
1 parent 4b59044 commit 37fabe6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 68 deletions.
24 changes: 3 additions & 21 deletions pkg/features/kube_features.go
Expand Up @@ -206,7 +206,6 @@ const (
// alpha: v1.10
//
// Enable Hyper-V containers on Windows
// Deprecated in 1.20 and removed in 1.21
HyperVContainer featuregate.Feature = "HyperVContainer"

// owner: @mikedanese
Expand Down Expand Up @@ -297,7 +296,7 @@ const (
CSIStorageCapacity featuregate.Feature = "CSIStorageCapacity"

// owner: @alculquicondor
// beta: v1.20
// alpha: v1.19
//
// Enables the use of PodTopologySpread scheduling plugin to do default
// spreading and disables legacy SelectorSpread plugin.
Expand Down Expand Up @@ -453,21 +452,6 @@ const (
// Implement support for limiting pids in nodes
SupportNodePidsLimit featuregate.Feature = "SupportNodePidsLimit"

// owner: @wk8
// alpha: v1.14
// beta: v1.16
//
// Enables GMSA support for Windows workloads.
WindowsGMSA featuregate.Feature = "WindowsGMSA"

// owner: @bclau
// alpha: v1.16
// beta: v1.17
// GA: v1.18
//
// Enables support for running container entrypoints as different usernames than their default ones.
WindowsRunAsUserName featuregate.Feature = "WindowsRunAsUserName"

// owner: @adisky
// alpha: v1.14
// beta: v1.18
Expand Down Expand Up @@ -678,7 +662,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
StorageObjectInUseProtection: {Default: true, PreRelease: featuregate.GA},
SupportPodPidsLimit: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21
SupportNodePidsLimit: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.21
HyperVContainer: {Default: false, PreRelease: featuregate.Deprecated},
HyperVContainer: {Default: false, PreRelease: featuregate.Alpha},
TokenRequest: {Default: true, PreRelease: featuregate.Beta},
TokenRequestProjection: {Default: true, PreRelease: featuregate.Beta},
BoundServiceAccountTokenVolume: {Default: false, PreRelease: featuregate.Alpha},
Expand Down Expand Up @@ -713,8 +697,6 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
ProcMountType: {Default: false, PreRelease: featuregate.Alpha},
TTLAfterFinished: {Default: false, PreRelease: featuregate.Alpha},
KubeletPodResources: {Default: true, PreRelease: featuregate.Beta},
WindowsGMSA: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
WindowsRunAsUserName: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
ServiceLoadBalancerFinalizer: {Default: true, PreRelease: featuregate.GA, LockToDefault: true},
LocalStorageCapacityIsolationFSQuotaMonitoring: {Default: false, PreRelease: featuregate.Alpha},
NonPreemptingPriority: {Default: true, PreRelease: featuregate.Beta},
Expand All @@ -734,7 +716,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
HugePageStorageMediumSize: {Default: true, PreRelease: featuregate.Beta},
ExternalPolicyForExternalIP: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.22
AnyVolumeDataSource: {Default: false, PreRelease: featuregate.Alpha},
DefaultPodTopologySpread: {Default: true, PreRelease: featuregate.Beta},
DefaultPodTopologySpread: {Default: false, PreRelease: featuregate.Alpha},
SetHostnameAsFQDN: {Default: true, PreRelease: featuregate.Beta},
WinOverlay: {Default: true, PreRelease: featuregate.Beta},
WinDSR: {Default: false, PreRelease: featuregate.Alpha},
Expand Down
5 changes: 0 additions & 5 deletions pkg/kubelet/kuberuntime/kuberuntime_container_windows.go
Expand Up @@ -128,11 +128,6 @@ func (m *kubeGenericRuntimeManager) generateWindowsContainerConfig(container *v1
if username != "" {
wc.SecurityContext.RunAsUsername = username
}
if utilfeature.DefaultFeatureGate.Enabled(kubefeatures.WindowsGMSA) &&
effectiveSc.WindowsOptions != nil &&
effectiveSc.WindowsOptions.GMSACredentialSpec != nil {
wc.SecurityContext.CredentialSpec = *effectiveSc.WindowsOptions.GMSACredentialSpec
}

// override with Windows options if present
if effectiveSc.WindowsOptions != nil && effectiveSc.WindowsOptions.RunAsUserName != nil {
Expand Down
Expand Up @@ -3678,20 +3678,7 @@
},
"io.k8s.api.core.v1.WindowsSecurityContextOptions": {
"description": "WindowsSecurityContextOptions contain Windows-specific options and credentials.",
"properties": {
"gmsaCredentialSpec": {
"description": "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.",
"type": "string"
},
"gmsaCredentialSpecName": {
"description": "GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.",
"type": "string"
},
"runAsUserName": {
"description": "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. This field is beta-level and may be disabled with the WindowsRunAsUserName feature flag.",
"type": "string"
}
},
"properties": {},
"type": "object"
},
"io.k8s.api.extensions.v1beta1.Deployment": {
Expand Down
15 changes: 1 addition & 14 deletions staging/src/k8s.io/cli-runtime/artifacts/openapi/swagger.json
Expand Up @@ -11953,20 +11953,7 @@
},
"io.k8s.api.core.v1.WindowsSecurityContextOptions": {
"description": "WindowsSecurityContextOptions contain Windows-specific options and credentials.",
"properties": {
"gmsaCredentialSpec": {
"description": "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.",
"type": "string"
},
"gmsaCredentialSpecName": {
"description": "GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.",
"type": "string"
},
"runAsUserName": {
"description": "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. This field is alpha-level and it is only honored by servers that enable the WindowsRunAsUserName feature flag.",
"type": "string"
}
},
"properties": {},
"type": "object"
},
"io.k8s.api.events.v1beta1.Event": {
Expand Down
15 changes: 1 addition & 14 deletions staging/src/k8s.io/kubectl/testdata/openapi/swagger.json
Expand Up @@ -11953,20 +11953,7 @@
},
"io.k8s.api.core.v1.WindowsSecurityContextOptions": {
"description": "WindowsSecurityContextOptions contain Windows-specific options and credentials.",
"properties": {
"gmsaCredentialSpec": {
"description": "GMSACredentialSpec is where the GMSA admission webhook (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the GMSA credential spec named by the GMSACredentialSpecName field. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.",
"type": "string"
},
"gmsaCredentialSpecName": {
"description": "GMSACredentialSpecName is the name of the GMSA credential spec to use. This field is alpha-level and is only honored by servers that enable the WindowsGMSA feature flag.",
"type": "string"
},
"runAsUserName": {
"description": "The UserName in Windows to run the entrypoint of the container process. Defaults to the user specified in image metadata if unspecified. May also be set in PodSecurityContext. If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. This field is alpha-level and it is only honored by servers that enable the WindowsRunAsUserName feature flag.",
"type": "string"
}
},
"properties": {},
"type": "object"
},
"io.k8s.api.events.v1beta1.Event": {
Expand Down

0 comments on commit 37fabe6

Please sign in to comment.