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

(aws-eks) EKS Add-On support as L2/3 construct #19688

Open
2 tasks
endersonmaia opened this issue Apr 1, 2022 · 5 comments
Open
2 tasks

(aws-eks) EKS Add-On support as L2/3 construct #19688

endersonmaia opened this issue Apr 1, 2022 · 5 comments
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service effort/large Large work item – several weeks of effort feature/new-construct A request for a new L2 construct feature/service-integration Add functionality to an L2 construct to enable easier integration with another service feature-request A feature should be added or improved. needs-design This feature request needs additional design work. p2

Comments

@endersonmaia
Copy link

Describe the feature

As of 2022-03-01 we have the possibility to install the EBS CSI Driver via eksctl and management console.

I couldn't find a way to do this via aws-eks CDK module.

References:

Use Case

I'm using the instructions at this link [1] to install EBS CSI Driver using helm inside CDK, but it could be simpler to use an add-on via CDK.

  1. https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks-readme.html#table-of-contents

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.19.0

Environment details (OS name and version, etc.)

Ubuntu 20.04

@endersonmaia endersonmaia added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 1, 2022
@github-actions github-actions bot added the @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service label Apr 1, 2022
@indrora
Copy link
Contributor

indrora commented Jun 9, 2022

Reading through the documentation on this, it appears that this sort of add-in functionality would make for a good L2/L3 construct later on.

There are a few workarounds. The easiest is to deploy, then as a post-deploy action modify your created stack.

In your CDK app, create the outputs for your role ARN and such:

    new cdk.CfnOutput(this, 'eksClusterid', {
      value: eksCluster.name,
      description: 'Name of the EKS cluster',
      exportName: 'eksClusterId',
    });
    new cdk.CfnOutput(this, 'ebsrolearn', {
      value: eksCluster_EbsCsiRole.arn,
      description: 'ARN of the role used for the EKS CSI driver',
      exportName: 'eksEbsCsiDriverRoleArn',
    });

Then, in your deployment, modify the EKS cluster post-deployment of the CDK app

# Deploy the app
cdk deploy --app (..)

# Get the requisite info
export MY_EKS_CLUSTER=$(aws cloudformation describe-stacks --stack-name (..) --query "Stacks[0].Outputs[?OutputKey=='eksClusterId'].OutputValue" --output text
export CSI_DRIVER_ROLE=$(aws cloudformation describe-stacks --stack-name (..) --query "Stacks[0].Outputs[?OutputKey=='eksEbsCsiDriverRoleArn'].OutputValue" --output text

# ... modify the EKS cluster with your appropriate info 
aws eks create-addon \
  --cluster-name $MY_EKS_CLUSTER \
  --addon-name aws-ebs-csi-driver \
  --service-account-role-arn $CSI_DRIVER_ROLE

I'm not aware of how the behavior of create-addon changes if the addon is already added.

post-deployment scripts have been discussed in an RFC: aws/aws-cdk-rfcs#228 -- If this is something you're interested in, please go comment or react to that.

@indrora indrora changed the title (aws-eks) Make it possible to install EBS CSI Driver add-on via CDK (aws-eks) EKS Add-On support as L2/3 construct Jun 9, 2022
@indrora indrora added p2 effort/large Large work item – several weeks of effort needs-design This feature request needs additional design work. feature/service-integration Add functionality to an L2 construct to enable easier integration with another service feature/new-construct A request for a new L2 construct and removed needs-triage This issue or PR still needs to be triaged. labels Jun 9, 2022
@otaviomacedo otaviomacedo removed their assignment Jun 27, 2022
@mburket
Copy link

mburket commented Dec 19, 2022

The market place for EKS add-ons was announced at re:Invent recently -- https://aws.amazon.com/blogs/aws/new-aws-marketplace-for-containers-now-supports-direct-deployment-to-amazon-eks-clusters/. It will be great if CDK can support this.

@pahud
Copy link
Contributor

pahud commented Jan 26, 2023

Still relevant. We now have Addon L1 construct ICYMI.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.CfnAddon.html

@RichiCoder1
Copy link
Contributor

An L2 would be great, and L3s for the various core addons would be fantastic.

@yakobe
Copy link

yakobe commented Aug 14, 2024

Is this now solved with the construct: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.Addon.html and this issue can be resolved?

If the Addon construct does indeed solve this, how can set the serviceAccountRoleArn for the aws-ebs-csi-driver addon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service effort/large Large work item – several weeks of effort feature/new-construct A request for a new L2 construct feature/service-integration Add functionality to an L2 construct to enable easier integration with another service feature-request A feature should be added or improved. needs-design This feature request needs additional design work. p2
Projects
None yet
Development

No branches or pull requests

7 participants