Skip to content

Commit bbfc6de

Browse files
committed
Add AccessEntry to AWSManagedControlPlane API
1 parent a1c815a commit bbfc6de

File tree

3 files changed

+205
-1
lines changed

3 files changed

+205
-1
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
@@ -2212,6 +2212,84 @@ spec:
22122212
description: AccessConfig specifies the access configuration information
22132213
for the cluster
22142214
properties:
2215+
accessEntries:
2216+
description: |-
2217+
AccessEntries specifies the access entries for the cluster
2218+
Access entries require AuthenticationMode to be either API or API_AND_CONFIG_MAP
2219+
items:
2220+
description: AccessEntry represents an AWS EKS access entry
2221+
for IAM principals
2222+
properties:
2223+
accessPolicies:
2224+
description: |-
2225+
AccessPolicies specifies the policies to associate with this access entry
2226+
Cannot be specified if Type is EC2_LINUX or EC2_WINDOWS
2227+
items:
2228+
description: AccessPolicyReference represents a reference
2229+
to an AWS EKS access policy
2230+
properties:
2231+
accessScope:
2232+
description: AccessScope specifies the scope for the
2233+
policy
2234+
properties:
2235+
namespaces:
2236+
description: |-
2237+
Namespaces are the namespaces for the access scope
2238+
Only valid when Type is namespace
2239+
items:
2240+
type: string
2241+
type: array
2242+
type:
2243+
default: cluster
2244+
description: Type is the type of access scope.
2245+
Defaults to "cluster".
2246+
enum:
2247+
- cluster
2248+
- namespace
2249+
type: string
2250+
required:
2251+
- type
2252+
type: object
2253+
policyARN:
2254+
description: PolicyARN is the Amazon Resource Name
2255+
(ARN) of the access policy
2256+
type: string
2257+
required:
2258+
- accessScope
2259+
- policyARN
2260+
type: object
2261+
type: array
2262+
kubernetesGroups:
2263+
description: |-
2264+
KubernetesGroups represents the Kubernetes groups for the access entry
2265+
Cannot be specified if Type is EC2_LINUX or EC2_WINDOWS
2266+
items:
2267+
type: string
2268+
type: array
2269+
principalARN:
2270+
description: PrincipalARN is the Amazon Resource Name (ARN)
2271+
of the IAM principal
2272+
type: string
2273+
type:
2274+
default: STANDARD
2275+
description: Type is the type of access entry. Defaults
2276+
to STANDARD if not specified.
2277+
enum:
2278+
- STANDARD
2279+
- EC2_LINUX
2280+
- EC2_WINDOWS
2281+
- FARGATE_LINUX
2282+
- EC2
2283+
- HYBRID_LINUX
2284+
- HYPERPOD_LINUX
2285+
type: string
2286+
username:
2287+
description: Username is the username for the access entry
2288+
type: string
2289+
required:
2290+
- principalARN
2291+
type: object
2292+
type: array
22152293
authenticationMode:
22162294
default: CONFIG_MAP
22172295
description: |-

controlplane/eks/api/v1beta2/awsmanagedcontrolplane_types.go

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

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

265321
// EncryptionConfig specifies the encryption configuration for the EKS clsuter.

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

Lines changed: 71 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)