Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

svcop: Support for IAM Roles for EKS Service Accounts #931

Merged
merged 6 commits into from
Feb 3, 2020

Conversation

Krenair
Copy link
Contributor

@Krenair Krenair commented Jan 23, 2020

Creates Principal objects for ServiceAccounts labelled with the access group label, and updates the ServiceAccount with the appropriate annotation.

@Krenair Krenair changed the title [WIP][DNM][POC] svcop: Support for IAM Roles for EKS Service Accounts [WIP] svcop: Support for IAM Roles for EKS Service Accounts Jan 23, 2020
@Krenair

This comment has been minimized.

@Krenair Krenair changed the title [WIP] svcop: Support for IAM Roles for EKS Service Accounts svcop: Support for IAM Roles for EKS Service Accounts Jan 27, 2020
@Krenair Krenair marked this pull request as ready for review January 27, 2020 18:31
@chrisfarms
Copy link
Contributor

can we get some squashing + nicer commit messages please if this is ready for review 🙏 😄

@Krenair Krenair force-pushed the svcop-iam-roles branch 2 times, most recently from 3f566b8 to 204d546 Compare January 28, 2020 16:40
@@ -6,6 +6,16 @@ metadata:
creationTimestamp: null
name: {{ .Release.Name }}-service-operator-role
rules:
- resources:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible I was supposed to update config/rbac/role-not-patch.yaml instead of add that kubebuilder:rbac comment earlier?

@Krenair

This comment has been minimized.

@chrisfarms
Copy link
Contributor

chrisfarms commented Feb 3, 2020

I am unable to run the full integration tests (hack/test_integration) since it looks like the RDS security group is invalid.

I suspect this is because we have assumed it more static than it really is... I'm testing with fetching it by name now. we may want to tweak it as per following diff to make it more stable...

diff --git a/components/service-operator/hack/test_integration.sh b/components/service-operator/hack/test_integration.sh
index 33072475..545d637d 100755
--- a/components/service-operator/hack/test_integration.sh
+++ b/components/service-operator/hack/test_integration.sh
@@ -1,6 +1,7 @@
 #!/usr/bin/env bash
 
 AWS_ACCOUNT_ID="$(aws sts get-caller-identity | jq -r .Account)"
+AWS_RDS_SECURITY_GROUP_ID=$(aws ec2 describe-security-groups | jq -r '.SecurityGroups[] | select(.GroupName == "sandbox_rds_from_worker") | .GroupId')
 
 docker build \
 	--network host \
@@ -8,7 +9,7 @@ docker build \
 	--build-arg AWS_ACCESS_KEY_ID \
 	--build-arg AWS_SECRET_ACCESS_KEY \
 	--build-arg AWS_SESSION_TOKEN \
-	--build-arg AWS_RDS_SECURITY_GROUP_ID=sg-04521d05ba3d9edb5 \
+	--build-arg AWS_RDS_SECURITY_GROUP_ID=$AWS_RDS_SECURITY_GROUP_ID \
 	--build-arg AWS_RDS_SUBNET_GROUP_NAME=sandbox-private \
 	--build-arg AWS_PRINCIPAL_PERMISSIONS_BOUNDARY_ARN=arn:aws:iam::${AWS_ACCOUNT_ID}:policy/sandbox-service-operator-managed-role-permissions-boundary \
 	--build-arg AWS_PRINCIPAL_SERVER_ROLE_ARN=arn:aws:iam::${AWS_ACCOUNT_ID}:role/sandbox_kiam_server \

@Krenair
Copy link
Contributor Author

Krenair commented Feb 3, 2020

Sounds like we should make a PR to fix hack/test_integration @chrisfarms ?

@chrisfarms
Copy link
Contributor

Sounds like we should make a PR to fix hack/test_integration @chrisfarms ?

yes, I'll make it after this is merged (since I already have the fix stashed)

@Krenair Krenair merged commit 2cc6bfe into master Feb 3, 2020
@Krenair Krenair deleted the svcop-iam-roles branch February 3, 2020 16:50
Krenair added a commit that referenced this pull request Feb 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants