Skip to content

Commit

Permalink
Add PR #1751
Browse files Browse the repository at this point in the history
  • Loading branch information
jsafrane committed Oct 10, 2022
1 parent 4e3b7c7 commit 0a5226e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
27 changes: 26 additions & 1 deletion cmd/infra/aws/iam.go
Expand Up @@ -68,7 +68,32 @@ const (
"ec2:ModifyVolume"
],
"Resource": "*"
}
},
{
"Effect": "Allow",
"Action": [
"kms:Decrypt",
"kms:Encrypt",
"kms:GenerateDataKey",
"kms:GenerateDataKeyWithoutPlainText",
"kms:DescribeKey"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"kms:RevokeGrant",
"kms:CreateGrant",
"kms:ListGrants"
],
"Resource": "*",
"Condition": {
"Bool": {
"kms:GrantIsForAWSResource": true
}
}
}
]
}`

Expand Down
Expand Up @@ -903,7 +903,6 @@ func (r *reconciler) reconcileCloudCredentialSecrets(ctx context.Context, hcp *h
}
for arn, secret := range map[string]*corev1.Secret{
hcp.Spec.Platform.AWS.RolesRef.IngressARN: manifests.AWSIngressCloudCredsSecret(),
hcp.Spec.Platform.AWS.RolesRef.StorageARN: manifests.AWSStorageCloudCredsSecret(),
hcp.Spec.Platform.AWS.RolesRef.ImageRegistryARN: manifests.AWSImageRegistryCloudCredsSecret(),
} {
err := syncSecret(secret, arn)
Expand Down
Expand Up @@ -259,6 +259,7 @@ web_identity_token_file = /var/run/secrets/openshift/serviceaccount/token
hcluster.Spec.Platform.AWS.RolesRef.NodePoolManagementARN: NodePoolManagementCredsSecret(controlPlaneNamespace),
hcluster.Spec.Platform.AWS.RolesRef.ControlPlaneOperatorARN: ControlPlaneOperatorCredsSecret(controlPlaneNamespace),
hcluster.Spec.Platform.AWS.RolesRef.NetworkARN: CloudNetworkConfigControllerCredsSecret(controlPlaneNamespace),
hcluster.Spec.Platform.AWS.RolesRef.StorageARN: AWSEBSCSIDriverCredsSecret(controlPlaneNamespace),
} {
err := syncSecret(secret, arn)
if err != nil {
Expand Down Expand Up @@ -376,3 +377,12 @@ func CloudNetworkConfigControllerCredsSecret(controlPlaneNamespace string) *core
},
}
}

func AWSEBSCSIDriverCredsSecret(controlPlaneNamespace string) *corev1.Secret {
return &corev1.Secret{
ObjectMeta: metav1.ObjectMeta{
Namespace: controlPlaneNamespace,
Name: "ebs-cloud-credentials",
},
}
}

0 comments on commit 0a5226e

Please sign in to comment.