Skip to content

Commit

Permalink
fixed role creation
Browse files Browse the repository at this point in the history
Signed-off-by: vivekr-splunk <94569031+vivekr-splunk@users.noreply.github.com>
  • Loading branch information
vivekr-splunk committed Aug 15, 2023
1 parent 9156e71 commit bf024b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/deploy-eks-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function createCluster() {
oidc_provider=$(aws eks describe-cluster --name ${TEST_CLUSTER_NAME} --region "us-west-2" --query "cluster.identity.oidc.issuer" --output text | sed -e "s/^https:\/\///")
namespace=kube-system
service_account=ebs-csi-controller-sa
kubectl create serviceaccount ${service_account} --namespace ${namespace}
echo "{
\"Version\": \"2012-10-17\",
\"Statement\": [
Expand All @@ -78,7 +79,7 @@ function createCluster() {
}
]
}" >aws-ebs-csi-driver-trust-policy.json
aws iam create-role --role-name EBS_${TEST_CLUSTER_NAME} --assume-role-policy-document file://aws-ebs-csi-driver-trust-policy.json --description "irsa role for ${TEST_CLUSTER_NAME}"
aws iam create-role --role-name EBS_${TEST_CLUSTER_NAME##*-} --assume-role-policy-document file://aws-ebs-csi-driver-trust-policy.json --description "irsa role for ${TEST_CLUSTER_NAME}"
aws iam attach-role-policy --policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy --role-name EBS_${TEST_CLUSTER_NAME}
kubectl annotate serviceaccount -n $namespace $service_account eks.amazonaws.com/role-arn=arn:aws:iam::$account_id:role/EBS_${TEST_CLUSTER_NAME}
eksctl create addon --name aws-ebs-csi-driver --cluster ${TEST_CLUSTER_NAME} --service-account-role-arn arn:aws:iam::$account_id:role/EBS_${TEST_CLUSTER_NAME} --force
Expand Down

0 comments on commit bf024b5

Please sign in to comment.