Add toggle for AWS OIDC provider. Free it from any feature flag

This commit is contained in:
Ole Markus With 2021-04-30 15:32:07 +02:00
parent 25b5f0cfb2
commit 460586833b
7 changed files with 14 additions and 2 deletions

View File

@ -4041,6 +4041,10 @@ spec:
description: DiscoveryStore is the VFS path to where OIDC Issuer
Discovery metadata is stored.
type: string
enableAWSOIDCProvider:
description: EnableAWSOIDCProvider will provision an AWS OIDC
provider that trusts the ServiceAccount Issuer
type: boolean
type: object
serviceClusterIPRange:
description: ServiceClusterIPRange is the CIDR, from the internal

View File

@ -214,6 +214,8 @@ type ClusterSpec struct {
type OIDCIssuerConfig struct {
// DiscoveryStore is the VFS path to where OIDC Issuer Discovery metadata is stored.
DiscoveryStore string `json:"discoveryStore,omitempty"`
// EnableAWSOIDCProvider will provision an AWS OIDC provider that trusts the ServiceAccount Issuer
EnableAWSOIDCProvider bool `json:"enableAWSOIDCProvider,omitempty"`
}
// NodeAuthorizationSpec is used to node authorization

View File

@ -213,6 +213,8 @@ type ClusterSpec struct {
type OIDCIssuerConfig struct {
// DiscoveryStore is the VFS path to where OIDC Issuer Discovery metadata is stored.
DiscoveryStore string `json:"discoveryStore,omitempty"`
// EnableAWSOIDCProvider will provision an AWS OIDC provider that trusts the ServiceAccount Issuer
EnableAWSOIDCProvider bool `json:"enableAWSOIDCProvider,omitempty"`
}
// NodeAuthorizationSpec is used to node authorization

View File

@ -5844,6 +5844,7 @@ func Convert_kops_NodeTerminationHandlerConfig_To_v1alpha2_NodeTerminationHandle
func autoConvert_v1alpha2_OIDCIssuerConfig_To_kops_OIDCIssuerConfig(in *OIDCIssuerConfig, out *kops.OIDCIssuerConfig, s conversion.Scope) error {
out.DiscoveryStore = in.DiscoveryStore
out.EnableAWSOIDCProvider = in.EnableAWSOIDCProvider
return nil
}
@ -5854,6 +5855,7 @@ func Convert_v1alpha2_OIDCIssuerConfig_To_kops_OIDCIssuerConfig(in *OIDCIssuerCo
func autoConvert_kops_OIDCIssuerConfig_To_v1alpha2_OIDCIssuerConfig(in *kops.OIDCIssuerConfig, out *OIDCIssuerConfig, s conversion.Scope) error {
out.DiscoveryStore = in.DiscoveryStore
out.EnableAWSOIDCProvider = in.EnableAWSOIDCProvider
return nil
}

View File

@ -17,7 +17,6 @@ limitations under the License.
package awsmodel
import (
"k8s.io/kops/pkg/featureflag"
"k8s.io/kops/pkg/model/iam"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/cloudup/awstasks"
@ -38,7 +37,8 @@ const (
func (b *OIDCProviderBuilder) Build(c *fi.ModelBuilderContext) error {
if !featureflag.PublicJWKS.Enabled() {
if b.Cluster.Spec.ServiceAccountIssuerDiscovery == nil ||
!b.Cluster.Spec.ServiceAccountIssuerDiscovery.EnableAWSOIDCProvider {
return nil
}

View File

@ -34,6 +34,7 @@ spec:
nonMasqueradeCIDR: 100.64.0.0/10
serviceAccountIssuerDiscovery:
discoveryStore: memfs://discovery.example.com/minimal.example.com
enableAWSOIDCProvider: true
sshAccess:
- 0.0.0.0/0
topology:

View File

@ -30,6 +30,7 @@ spec:
nonMasqueradeCIDR: 100.64.0.0/10
serviceAccountIssuerDiscovery:
discoveryStore: memfs://discovery.example.com/minimal.example.com
enableAWSOIDCProvider: true
sshAccess:
- 0.0.0.0/0
topology: