Skip to content

Commit

Permalink
add accessConfig to v1beta1 type as well
Browse files Browse the repository at this point in the history
  • Loading branch information
adammw authored and k0da committed Nov 19, 2024
1 parent b6b582d commit 98b66d3
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,21 @@ spec:
description: AWSManagedControlPlaneSpec defines the desired state of an
Amazon EKS Cluster.
properties:
accessConfig:
description: AccessConfig specifies the access configuration information
for the cluster
properties:
authenticationMode:
default: CONFIG_MAP
description: |-
AuthenticationMode specifies the desired authentication mode for the cluster
Defaults to CONFIG_MAP
enum:
- CONFIG_MAP
- API
- API_AND_CONFIG_MAP
type: string
type: object
additionalTags:
additionalProperties:
type: string
Expand Down
13 changes: 13 additions & 0 deletions controlplane/eks/api/v1beta1/awsmanagedcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ type AWSManagedControlPlaneSpec struct { //nolint: maligned
// +optional
OIDCIdentityProviderConfig *OIDCIdentityProviderConfig `json:"oidcIdentityProviderConfig,omitempty"`

// AccessConfig specifies the access configuration information for the cluster
// +optional
AccessConfig *AccessConfig `json:"accessConfig,omitempty"`

// DisableVPCCNI indicates that the Amazon VPC CNI should be disabled. With EKS clusters the
// Amazon VPC CNI is automatically installed into the cluster. For clusters where you want
// to use an alternate CNI this option provides a way to specify that the Amazon VPC CNI
Expand Down Expand Up @@ -212,6 +216,15 @@ type EndpointAccess struct {
Private *bool `json:"private,omitempty"`
}

// AccessConfig represents the access configuration information for the cluster
type AccessConfig struct {
// AuthenticationMode specifies the desired authentication mode for the cluster
// Defaults to CONFIG_MAP
// +kubebuilder:default=CONFIG_MAP
// +kubebuilder:validation:Enum=CONFIG_MAP;API;API_AND_CONFIG_MAP
AuthenticationMode EKSAuthenticationMode `json:"authenticationMode,omitempty"`
}

// EncryptionConfig specifies the encryption configuration for the EKS clsuter.
type EncryptionConfig struct {
// Provider specifies the ARN or alias of the CMK (in AWS KMS)
Expand Down
15 changes: 15 additions & 0 deletions controlplane/eks/api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,21 @@ var (
EKSTokenMethodAWSCli = EKSTokenMethod("aws-cli")
)

// EKSAuthenticationMode defines the authentication mode for the cluster
type EKSAuthenticationMode string

var (
// EKSAuthenticationModeConfigMap indicates that only `aws-auth` ConfigMap will be used for authentication
EKSAuthenticationModeConfigMap = EKSAuthenticationMode("CONFIG_MAP")

// EKSAuthenticationModeAPI indicates that only AWS Access Entries will be used for authentication
EKSAuthenticationModeAPI = EKSAuthenticationMode("API")

// EKSAuthenticationModeAPIAndConfigMap indicates that both `aws-auth` ConfigMap and AWS Access Entries will
// be used for authentication
EKSAuthenticationModeAPIAndConfigMap = EKSAuthenticationMode("API_AND_CONFIG_MAP")
)

var (
// DefaultEKSControlPlaneRole is the name of the default IAM role to use for the EKS control plane
// if no other role is supplied in the spec and if iam role creation is not enabled. The default
Expand Down
33 changes: 32 additions & 1 deletion controlplane/eks/api/v1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions controlplane/eks/api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 98b66d3

Please sign in to comment.