Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding rad install changes for AWS IRSA support #7741

Merged

Conversation

vishwahiremat
Copy link
Contributor

Description

Added changes in deployment yaml to enable global.awsIRSA.enabled to true it is set using rad install kubernetes command

Type of change

  • This pull request fixes a bug in Radius and has an approved issue (issue link required).
  • This pull request adds or changes features of Radius and has an approved issue (issue link required).
  • This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional).

Fixes: #issue_number

@vishwahiremat vishwahiremat requested review from a team as code owners July 17, 2024 16:43
Copy link

codecov bot commented Jul 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.04%. Comparing base (9b77737) to head (7dfbbbf).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7741   +/-   ##
=======================================
  Coverage   61.04%   61.04%           
=======================================
  Files         521      521           
  Lines       27276    27276           
=======================================
  Hits        16651    16651           
  Misses       9159     9159           
  Partials     1466     1466           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vishwahiremat vishwahiremat marked this pull request as draft July 17, 2024 17:54
Signed-off-by: Vishwanath Hiremath <[email protected]>
Signed-off-by: Vishwanath Hiremath <[email protected]>
Copy link
Contributor

@nithyatsu nithyatsu left a comment

Choose a reason for hiding this comment

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

LGTM

@vishwahiremat vishwahiremat marked this pull request as ready for review July 18, 2024 17:58
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 18, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref 0781da1
Unique ID func33329449ca
Image tag pr-func33329449ca
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func33329449ca
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func33329449ca
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func33329449ca
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func33329449ca
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting msgrp functional tests...
⌛ Starting ucp functional tests...
⌛ Starting daprrp functional tests...
⌛ Starting cli functional tests...
⌛ Starting shared functional tests...
⌛ Starting samples functional tests...
⌛ Starting kubernetes functional tests...
⌛ Starting datastoresrp functional tests...
✅ msgrp functional tests succeeded
✅ ucp functional tests succeeded
✅ kubernetes functional tests succeeded
✅ samples functional tests succeeded
✅ daprrp functional tests succeeded
✅ cli functional tests succeeded
✅ datastoresrp functional tests succeeded
✅ shared functional tests succeeded

@@ -69,6 +69,10 @@ spec:
volumeMounts:
- name: config-volume
mountPath: /etc/config
{{- if eq .Values.global.awsIRSA.enabled true }}
- name: aws-iam-token
mountPath: /var/run/secrets/eks.amazonaws.com/serviceaccount
Copy link
Contributor

Choose a reason for hiding this comment

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

the parameter name should be global.aws.irsa.enabled , based on ryan's comment..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated it!

Signed-off-by: Vishwanath Hiremath <[email protected]>
@@ -26,6 +26,11 @@ global:
azureWorkloadIdentity:
enabled: false

# Configure global.aws.irsa.enabled=true to enable AWS IRSA.
# Disabled by default.
Copy link
Contributor

@nithyatsu nithyatsu Jul 19, 2024

Choose a reason for hiding this comment

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

this should be similar to

aws:
  irsa:
    enabled: false

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 22, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref d49e676
Unique ID funcb458205ede
Image tag pr-funcb458205ede
Click here to see the list of tools in the current test run
  • gotestsum 1.10.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcb458205ede
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funcb458205ede
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcb458205ede
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcb458205ede
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting daprrp functional tests...
⌛ Starting cli functional tests...
⌛ Starting kubernetes functional tests...
⌛ Starting msgrp functional tests...
⌛ Starting ucp functional tests...
⌛ Starting datastoresrp functional tests...
⌛ Starting samples functional tests...
⌛ Starting shared functional tests...
❌ Failed to install Radius for daprrp functional test. Please check the logs for more details
❌ Failed to install Radius for cli functional test. Please check the logs for more details
❌ daprrp functional test failed. Please check the logs for more details
❌ cli functional test failed. Please check the logs for more details
❌ Failed to install Radius for msgrp functional test. Please check the logs for more details
❌ Failed to install Radius for kubernetes functional test. Please check the logs for more details
❌ samples functional test cancelled. Please check the logs for more details
❌ ucp functional test cancelled. Please check the logs for more details

Signed-off-by: Vishwanath Hiremath <[email protected]>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 24, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref a1e8018
Unique ID func63587cf0c6
Image tag pr-func63587cf0c6
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func63587cf0c6
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func63587cf0c6
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func63587cf0c6
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func63587cf0c6
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting datastoresrp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ datastoresrp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

lakshmimsft
lakshmimsft previously approved these changes Jul 24, 2024
Signed-off-by: Vishwanath Hiremath <[email protected]>
@@ -69,6 +69,10 @@ spec:
volumeMounts:
- name: config-volume
mountPath: /etc/config
{{- if eq .Values.global.aws.irsa.enabled true }}
- name: aws-iam-token
mountPath: /var/run/secrets/eks.amazonaws.com/serviceaccount
Copy link
Contributor

Choose a reason for hiding this comment

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

@nithyatsu did we say during design discussion that IRSA can be enabled on non EKS clusters as well? Would this mount path still be applicable on other clusters?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi Karishma, IRSA is not specific to eks clusters. But the first iteration of the feature is based on eks.
We would have to make the token path configurable in order to support it on other clusters too. Would it be OK to log a ticket to cover this?

Copy link
Contributor

@kachawla kachawla Jul 30, 2024

Choose a reason for hiding this comment

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

@nithyatsu yeah that sounds good as long as it is intentional and being tracked

Copy link
Contributor

Choose a reason for hiding this comment

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

created #7774 for tracking this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this actually something we'd have to change for another cluster?

From what I understand, the AWS SDKS will use the value of AWS_WEB_IDENTITY_TOKEN_FILE to load the token. There's nothing special about this file path (or any other file path) as long as the environment variable points to the token on disk.

Copy link
Contributor

@nithyatsu nithyatsu Jul 30, 2024

Choose a reason for hiding this comment

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

@rynowak In code, we added the token file location as a const:

tokenFilePath = "/var/run/secrets/eks.amazonaws.com/serviceaccount/token"

The mount path should work, but it felt odd to reference eks in path for a cluster that was not on eks. Or is it OK since IRSA is a AWS feature? Also, instead of const, should I have looked to set the env variable for the pods?

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we should do the following:

  • Set the env-var AWS_WEB_IDENTITY_TOKEN_FILE to /var/run/secrets/eks.amazonaws.com/serviceaccount/token in the helm chart when IRSA is enabled. This is also done by the webhook here.
  • We can simplify the logic for Terraform because Terraform also uses AWS_WEB_IDENTITY_TOKEN_FILE. link

Then it doesn't matter what the path is, because it's not hardcoded.

Copy link
Contributor

Choose a reason for hiding this comment

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

updated the ticket #7774 to implement this comment.

sources:
- serviceAccountToken:
path: token
expirationSeconds: 86400
Copy link
Contributor

Choose a reason for hiding this comment

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

@nithyatsu @vishwahiremat could you share details on how did we decide on this number?

Copy link
Contributor

@nithyatsu nithyatsu Jul 24, 2024

Choose a reason for hiding this comment

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

Hi Karishma, the typical approach for IRSA was to use the pod identity webhook. (
ref. https://github.com/radius-project/design-notes/blob/3b3f66e7b6d340ef7beebcc4212fcd7129bf8b06/cli/2024-06-04-aws-irsa-support.md#alternatives-considered , https://github.com/aws/amazon-eks-pod-identity-webhook#amazon-eks-pod-identity-webhook)

The reason we did not choose the webhook was since it wasnt compatible with multi-tenancy and needed service restarts to register credential. But, we did the exact same thing the webhook does. These are the configurations the webhook sets (https://github.dev/aws/amazon-eks-pod-identity-webhook#amazon-eks-pod-identity-webhook) and mentions it as a default value.

@lakshmimsft
Copy link
Contributor

lakshmimsft commented Jul 24, 2024

let's pls rerun tests. we haven't seen a clean run last.

Signed-off-by: Vishwanath Hiremath <[email protected]>
Signed-off-by: Vishwanath Hiremath <[email protected]>
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 26, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref aff2f10
Unique ID func5864263279
Image tag pr-func5864263279
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func5864263279
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func5864263279
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func5864263279
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func5864263279
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting datastoresrp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
⌛ Starting ucp-cloud functional tests...
✅ datastoresrp-cloud functional tests succeeded
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 29, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref cfb5e80
Unique ID func5bc0d16753
Image tag pr-func5bc0d16753
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func5bc0d16753
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func5bc0d16753
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func5bc0d16753
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func5bc0d16753
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting datastoresrp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ datastoresrp-cloud functional tests succeeded
⌛ Starting corerp-cloud functional tests...
✅ corerp-cloud functional tests succeeded

@lakshmimsft
Copy link
Contributor

LTGM. Pls get another approval as well.

@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 30, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref 9f55960
Unique ID funcd13f9ede6f
Image tag pr-funcd13f9ede6f
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-funcd13f9ede6f
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-funcd13f9ede6f
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-funcd13f9ede6f
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-funcd13f9ede6f
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting ucp-cloud functional tests...
⌛ Starting datastoresrp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ datastoresrp-cloud functional tests succeeded
❌ corerp-cloud functional test failed. Please check the logs for more details

@kachawla kachawla temporarily deployed to functional-tests July 30, 2024 00:52 — with GitHub Actions Inactive
@radius-functional-tests
Copy link

radius-functional-tests bot commented Jul 30, 2024

Radius functional test overview

🔍 Go to test action run

Name Value
Repository vishwahiremat/radius
Commit ref 7dfbbbf
Unique ID func110b17179f
Image tag pr-func110b17179f
Click here to see the list of tools in the current test run
  • gotestsum 1.12.0
  • KinD: v0.20.0
  • Dapr: 1.12.0
  • Azure KeyVault CSI driver: 1.4.2
  • Azure Workload identity webhook: 1.1.0
  • Bicep recipe location ghcr.io/radius-project/dev/test/testrecipes/test-bicep-recipes/<name>:pr-func110b17179f
  • Terraform recipe location http://tf-module-server.radius-test-tf-module-server.svc.cluster.local/<name>.zip (in cluster)
  • applications-rp test image location: ghcr.io/radius-project/dev/applications-rp:pr-func110b17179f
  • controller test image location: ghcr.io/radius-project/dev/controller:pr-func110b17179f
  • ucp test image location: ghcr.io/radius-project/dev/ucpd:pr-func110b17179f
  • deployment-engine test image location: ghcr.io/radius-project/deployment-engine:latest

Test Status

⌛ Building Radius and pushing container images for functional tests...
✅ Container images build succeeded
⌛ Publishing Bicep Recipes for functional tests...
✅ Recipe publishing succeeded
⌛ Starting datastoresrp-cloud functional tests...
⌛ Starting corerp-cloud functional tests...
✅ datastoresrp-cloud functional tests succeeded
⌛ Starting ucp-cloud functional tests...
✅ ucp-cloud functional tests succeeded
✅ corerp-cloud functional tests succeeded

@kachawla kachawla changed the title Adding rad install changes for aws irsw support Adding rad install changes for AWS IRSA support Jul 30, 2024
@kachawla kachawla merged commit 81b89fd into radius-project:main Jul 30, 2024
26 checks passed
Reshrahim pushed a commit to Reshrahim/radius that referenced this pull request Aug 27, 2024
# Description

Added changes in deployment yaml to enable `global.awsIRSA.enabled` to
true it is set using `rad install kubernetes` command

## Type of change

<!--

Please select **one** of the following options that describes your
change and delete the others. Clearly identifying the type of change you
are making will help us review your PR faster, and is used in authoring
release notes.

If you are making a bug fix or functionality change to Radius and do not
have an associated issue link please create one now.

-->

- This pull request fixes a bug in Radius and has an approved issue
(issue link required).
- This pull request adds or changes features of Radius and has an
approved issue (issue link required).
- This pull request is a minor refactor, code cleanup, test improvement,
or other maintenance task and doesn't change the functionality of Radius
(issue link optional).

<!--

Please update the following to link the associated issue. This is
required for some kinds of changes (see above).

-->

Fixes: #issue_number

---------

Signed-off-by: Vishwanath Hiremath <[email protected]>
Co-authored-by: Karishma Chawla <[email protected]>
Signed-off-by: Reshma Abdul Rahim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants