Skip to content

Commit 2599ffc

Browse files
committed
Support custom IAM management in AWS registration
Signed-off-by: Ben Perry <[email protected]>
1 parent b380252 commit 2599ffc

25 files changed

+125
-28
lines changed

deploy/cluster-manager/chart/cluster-manager/crds/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,12 @@ spec:
380380
items:
381381
type: string
382382
type: array
383+
disableManagedIam:
384+
description: |-
385+
DisableManagedIam disables creation and management of IAM roles and policies on the hub.
386+
If true, all AWS permissions for awsirsa registration must be managed manually by the administrator.
387+
Used in cases where IAM permissions cannot be granted to OCM, or to run an EKS hub with non-aws spoke clusters.
388+
type: boolean
383389
hubClusterArn:
384390
description: |-
385391
This represents the hub cluster ARN

deploy/cluster-manager/config/crds/0000_01_operator.open-cluster-management.io_clustermanagers.crd.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,12 @@ spec:
380380
items:
381381
type: string
382382
type: array
383+
disableManagedIam:
384+
description: |-
385+
DisableManagedIam disables creation and management of IAM roles and policies on the hub.
386+
If true, all AWS permissions for awsirsa registration must be managed manually by the administrator.
387+
Used in cases where IAM permissions cannot be granted to OCM, or to run an EKS hub with non-aws spoke clusters.
388+
type: boolean
383389
hubClusterArn:
384390
description: |-
385391
This represents the hub cluster ARN

deploy/cluster-manager/olm-catalog/latest/manifests/operator.open-cluster-management.io_clustermanagers.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,11 @@ spec:
344344
items:
345345
type: string
346346
type: array
347+
disableManagedIam:
348+
description: |-
349+
DisableManagedIAM disables IAM role management in the hub. All required IAM roles
350+
must be created by the administrator.
351+
type: boolean
347352
hubClusterArn:
348353
description: |-
349354
This represents the hub cluster ARN

deploy/klusterlet/chart/klusterlet/crds/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,17 +341,20 @@ spec:
341341
minLength: 1
342342
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
343343
type: string
344+
iamConfigSecret:
345+
description: |-
346+
IamConfigSecret is the name of a secret containing "config" and/or "credentials" files mounted to ~/.aws/config and ~/.aws/credentials respectively.
347+
More Info: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
348+
type: string
344349
managedClusterArn:
345350
description: |-
346-
The arn of the managed cluster (ie: an EKS cluster). This will be required to generate the md5hash which will be used as a suffix to create IAM role on hub
351+
The arn of the managed cluster (ie: an EKS cluster). This will be used when managed IAM is enabled to generate the md5hash as a suffix to create IAM role on hub
347352
as well as used by kluslerlet-agent, to assume role suffixed with the md5hash, on startup.
348353
Example - arn:eks:us-west-2:12345678910:cluster/managed-cluster1.
349-
minLength: 1
350354
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
351355
type: string
352356
required:
353357
- hubClusterArn
354-
- managedClusterArn
355358
type: object
356359
required:
357360
- authType

deploy/klusterlet/config/crds/0000_00_operator.open-cluster-management.io_klusterlets.crd.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,17 +341,20 @@ spec:
341341
minLength: 1
342342
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
343343
type: string
344+
iamConfigSecret:
345+
description: |-
346+
IamConfigSecret is the name of a secret containing "config" and/or "credentials" files mounted to ~/.aws/config and ~/.aws/credentials respectively.
347+
More Info: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
348+
type: string
344349
managedClusterArn:
345350
description: |-
346-
The arn of the managed cluster (ie: an EKS cluster). This will be required to generate the md5hash which will be used as a suffix to create IAM role on hub
351+
The arn of the managed cluster (ie: an EKS cluster). This will be used when managed IAM is enabled to generate the md5hash as a suffix to create IAM role on hub
347352
as well as used by kluslerlet-agent, to assume role suffixed with the md5hash, on startup.
348353
Example - arn:eks:us-west-2:12345678910:cluster/managed-cluster1.
349-
minLength: 1
350354
pattern: ^arn:aws:eks:([a-zA-Z0-9-]+):(\d{12}):cluster/([a-zA-Z0-9-]+)$
351355
type: string
352356
required:
353357
- hubClusterArn
354-
- managedClusterArn
355358
type: object
356359
required:
357360
- authType

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ module open-cluster-management.io/ocm
22

33
go 1.23.6
44

5-
// TEMPORARY while waiting for upstream tag – must be removed before merge
6-
replace open-cluster-management.io/api => github.com/bhperry/ocm-api v0.0.0-20250709152251-dc6f14dcb9c0
5+
// TODO: Remove before merge
6+
replace open-cluster-management.io/api => github.com/bhperry/ocm-api v0.0.0-20250709173341-f336f4574c03
77

88
require (
99
github.com/aws/aws-sdk-go-v2 v1.36.3

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ github.com/aws/smithy-go v1.22.2 h1:6D9hW43xKFrRx/tXXfAlIZc4JI+yQe6snnWcQyxSyLQ=
5858
github.com/aws/smithy-go v1.22.2/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg=
5959
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
6060
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
61-
github.com/bhperry/ocm-api v0.0.0-20250709152251-dc6f14dcb9c0 h1:BGB/xHmOWNgwbuz6vqFBk+hf+dXhcSI5IBbRwim3CjA=
62-
github.com/bhperry/ocm-api v0.0.0-20250709152251-dc6f14dcb9c0/go.mod h1:/OeqXycNBZQoe3WG6ghuWsMgsKGuMZrK8ZpsU6gWL0Y=
61+
github.com/bhperry/ocm-api v0.0.0-20250709173341-f336f4574c03 h1:6fRvZreOtZAmxUAQopCsdhWlLk4lorhZEhB1E+839Zo=
62+
github.com/bhperry/ocm-api v0.0.0-20250709173341-f336f4574c03/go.mod h1:/OeqXycNBZQoe3WG6ghuWsMgsKGuMZrK8ZpsU6gWL0Y=
6363
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
6464
github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ=
6565
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=

manifests/cluster-manager/management/cluster-manager-registration-deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ spec:
9292
{{if .AwsResourceTags}}
9393
- "--aws-resource-tags={{ .AwsResourceTags }}"
9494
{{end}}
95+
{{ if .DisableManagedIam }}
96+
- "--disable-managed-iam"
97+
{{ end }}
9598
env:
9699
- name: POD_NAME
97100
valueFrom:

manifests/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ type HubConfig struct {
3939
ResourceRequirements []byte
4040
ManagedClusterIdentityCreatorRole string
4141
HubClusterArn string
42+
DisableManagedIam bool
4243
EnabledRegistrationDrivers string
4344
AutoApprovedCSRUsers string
4445
AutoApprovedARNPatterns string

manifests/klusterlet/management/klusterlet-agent-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,14 @@ spec:
230230
- name: tmpdir
231231
emptyDir: { }
232232
{{if eq .RegistrationDriver.AuthType "awsirsa"}}
233+
{{if and .RegistrationDriver.AwsIrsa .RegistrationDriver.AwsIrsa.IamConfigSecret }}
234+
- name: dot-aws
235+
secret:
236+
secretName: {{ .RegistrationDriver.AwsIrsa.IamConfigSecret }}
237+
{{else}}
233238
- name: dot-aws
234239
emptyDir: { }
240+
{{end}}
235241
- name: awscli
236242
emptyDir: { }
237243
{{end}}

0 commit comments

Comments
 (0)