Skip to content

Commit

Permalink
Update command to fetch cluster security group (#2030)
Browse files Browse the repository at this point in the history
Signed-off-by: Karishma Chawla <[email protected]>
  • Loading branch information
kachawla authored Jan 24, 2025
1 parent f182cd9 commit f17425a
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -251,26 +251,20 @@ jobs:
- name: Configure EKS for Dapr
if: steps.gen-id.outputs.RUN_TEST == 'true' && matrix.credential == 'aws'
run: |
# Fetch the node group name dynamically
NODEGROUP_NAME=$(eksctl get nodegroup \
--cluster ${{ steps.gen-id.outputs.TEST_EKS_CLUSTER_NAME }} \
--region ${{ env.AWS_REGION }} \
-o json | jq -r '.[0].Name')
# Fetch the security group ID for the EKS worker nodes
NODE_SECURITY_GROUP_ID=$(eksctl get nodegroup \
--cluster ${{ steps.gen-id.outputs.TEST_EKS_CLUSTER_NAME }} \
--name $NODEGROUP_NAME \
# Fetch the security group ID for the EKS cluster
SECURITY_GROUP_ID=$(aws eks describe-cluster \
--name ${{ steps.gen-id.outputs.TEST_EKS_CLUSTER_NAME }} \
--query 'cluster.resourcesVpcConfig.clusterSecurityGroupId' \
--region ${{ env.AWS_REGION }} \
-o json | jq -r '.[0].Resources.SecurityGroup.ID')
--output text)
# Authorize port 4000 for Dapr sidecar communication within the same security group
# https://docs.dapr.io/operations/hosting/kubernetes/cluster/setup-eks/#add-dapr-requirements-for-sidecar-access-and-default-storage-class
aws ec2 authorize-security-group-ingress \
--group-id $NODE_SECURITY_GROUP_ID \
--group-id $SECURITY_GROUP_ID \
--protocol tcp \
--port 4000 \
--source-group $NODE_SECURITY_GROUP_ID
--source-group $SECURITY_GROUP_ID
# Add a default storage class
kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
Expand Down

0 comments on commit f17425a

Please sign in to comment.