Skip to content

Commit 161ec2d

Browse files
committed
Add AccessEntry to AWSManagedControlPlane API
1 parent 4a40cac commit 161ec2d

File tree

3 files changed

+204
-0
lines changed

3 files changed

+204
-0
lines changed

config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,84 @@ spec:
22442244
description: AccessConfig specifies the access configuration information
22452245
for the cluster
22462246
properties:
2247+
accessEntries:
2248+
description: |-
2249+
AccessEntries specifies the access entries for the cluster
2250+
Access entries require AuthenticationMode to be either API or API_AND_CONFIG_MAP
2251+
items:
2252+
description: AccessEntry represents an AWS EKS access entry
2253+
for IAM principals
2254+
properties:
2255+
accessPolicies:
2256+
description: |-
2257+
AccessPolicies specifies the policies to associate with this access entry
2258+
Cannot be specified if Type is EC2_LINUX or EC2_WINDOWS
2259+
items:
2260+
description: AccessPolicyReference represents a reference
2261+
to an AWS EKS access policy
2262+
properties:
2263+
accessScope:
2264+
description: AccessScope specifies the scope for the
2265+
policy
2266+
properties:
2267+
namespaces:
2268+
description: |-
2269+
Namespaces are the namespaces for the access scope
2270+
Only valid when Type is namespace
2271+
items:
2272+
type: string
2273+
type: array
2274+
type:
2275+
default: cluster
2276+
description: Type is the type of access scope.
2277+
Defaults to "cluster".
2278+
enum:
2279+
- cluster
2280+
- namespace
2281+
type: string
2282+
required:
2283+
- type
2284+
type: object
2285+
policyARN:
2286+
description: PolicyARN is the Amazon Resource Name
2287+
(ARN) of the access policy
2288+
type: string
2289+
required:
2290+
- accessScope
2291+
- policyARN
2292+
type: object
2293+
type: array
2294+
kubernetesGroups:
2295+
description: |-
2296+
KubernetesGroups represents the Kubernetes groups for the access entry
2297+
Cannot be specified if Type is EC2_LINUX or EC2_WINDOWS
2298+
items:
2299+
type: string
2300+
type: array
2301+
principalARN:
2302+
description: PrincipalARN is the Amazon Resource Name (ARN)
2303+
of the IAM principal
2304+
type: string
2305+
type:
2306+
default: STANDARD
2307+
description: Type is the type of access entry. Defaults
2308+
to STANDARD if not specified.
2309+
enum:
2310+
- STANDARD
2311+
- EC2_LINUX
2312+
- EC2_WINDOWS
2313+
- FARGATE_LINUX
2314+
- EC2
2315+
- HYBRID_LINUX
2316+
- HYPERPOD_LINUX
2317+
type: string
2318+
username:
2319+
description: Username is the username for the access entry
2320+
type: string
2321+
required:
2322+
- principalARN
2323+
type: object
2324+
type: array
22472325
authenticationMode:
22482326
default: CONFIG_MAP
22492327
description: |-

controlplane/eks/api/v1beta2/awsmanagedcontrolplane_types.go

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,57 @@ type EndpointAccess struct {
252252
Private *bool `json:"private,omitempty"`
253253
}
254254

255+
// AccessEntry represents an AWS EKS access entry for IAM principals
256+
type AccessEntry struct {
257+
// PrincipalARN is the Amazon Resource Name (ARN) of the IAM principal
258+
// +kubebuilder:validation:Required
259+
PrincipalARN string `json:"principalARN"`
260+
261+
// Type is the type of access entry. Defaults to STANDARD if not specified.
262+
// +kubebuilder:default=STANDARD
263+
// +kubebuilder:validation:Enum=STANDARD;EC2_LINUX;EC2_WINDOWS;FARGATE_LINUX;EC2;HYBRID_LINUX;HYPERPOD_LINUX
264+
// +optional
265+
Type string `json:"type,omitempty"`
266+
267+
// KubernetesGroups represents the Kubernetes groups for the access entry
268+
// Cannot be specified if Type is EC2_LINUX or EC2_WINDOWS
269+
// +optional
270+
KubernetesGroups []string `json:"kubernetesGroups,omitempty"`
271+
272+
// Username is the username for the access entry
273+
// +optional
274+
Username string `json:"username,omitempty"`
275+
276+
// AccessPolicies specifies the policies to associate with this access entry
277+
// Cannot be specified if Type is EC2_LINUX or EC2_WINDOWS
278+
// +optional
279+
AccessPolicies []AccessPolicyReference `json:"accessPolicies,omitempty"`
280+
}
281+
282+
// AccessPolicyReference represents a reference to an AWS EKS access policy
283+
type AccessPolicyReference struct {
284+
// PolicyARN is the Amazon Resource Name (ARN) of the access policy
285+
// +kubebuilder:validation:Required
286+
PolicyARN string `json:"policyARN"`
287+
288+
// AccessScope specifies the scope for the policy
289+
// +kubebuilder:validation:Required
290+
AccessScope AccessScope `json:"accessScope"`
291+
}
292+
293+
// AccessScope represents the scope for an access policy
294+
type AccessScope struct {
295+
// Type is the type of access scope. Defaults to "cluster".
296+
// +kubebuilder:validation:Enum=cluster;namespace
297+
// +kubebuilder:default=cluster
298+
Type string `json:"type"`
299+
300+
// Namespaces are the namespaces for the access scope
301+
// Only valid when Type is namespace
302+
// +optional
303+
Namespaces []string `json:"namespaces,omitempty"`
304+
}
305+
255306
// AccessConfig represents the access configuration information for the cluster
256307
type AccessConfig struct {
257308
// AuthenticationMode specifies the desired authentication mode for the cluster
@@ -260,6 +311,11 @@ type AccessConfig struct {
260311
// +kubebuilder:validation:Enum=CONFIG_MAP;API;API_AND_CONFIG_MAP
261312
AuthenticationMode EKSAuthenticationMode `json:"authenticationMode,omitempty"`
262313

314+
// AccessEntries specifies the access entries for the cluster
315+
// Access entries require AuthenticationMode to be either API or API_AND_CONFIG_MAP
316+
// +optional
317+
AccessEntries []AccessEntry `json:"accessEntries,omitempty"`
318+
263319
// BootstrapClusterCreatorAdminPermissions grants cluster admin permissions
264320
// to the IAM identity creating the cluster. Only applied during creation,
265321
// ignored when updating existing clusters. Defaults to true.

controlplane/eks/api/v1beta2/zz_generated.deepcopy.go

Lines changed: 70 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)