-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add support for EBS CSI Driver #833
Comments
Hi @mresetar, thanks for the issue! I think you're correct - the switch from in-tree storage plugins happened in 1.23 and I think we should provide the functionality within the EKS component to install and configure the EBS CSI. I've edited the title and added a link to the EKS docs; hopefully we can use this ticket to track the implementation. Hope that's ok! Hopefully your solution of manually setting up the CSI driver is working for you, but you could alternatively make use of the Kubernetes provider to create it within Pulumi; it looks like AWS provide both a Kustomize directory and a Helm chart, both of which can be used in Pulumi Kubernetes. Hopefully this helps! |
Any update on when this will be implemented? Trying to piece together how to install this combined with the AWS documentation was a chore and this would save a lot of time for developers. |
@roothorp - While this feature is considered, I wonder if adding an example of using
to the docs would be useful for folks. It took me quite a while to find this issue but when I did, it really helped unblock me! |
@mresetar you can use https://www.pulumi.com/registry/packages/aws/api-docs/eks/addon/ to install CSI driver with Pulumi.
|
Thanks, klis. Currently not managing the EKS cluster but if I come back to it I'll be sure to remember this.
Returns available version for the k8s version. Currently, this would be |
Please review @roothorp |
While the PR is in progress, I can confirm that the following code will successfully deploy the Airflow Helm chart (at least, which did not work before due to the CSI driver no longer being present on more recent versions of EKS). This is for K8s version 1.27: const vpc = new awsx.ec2.Vpc("eks-airflow", {
enableDnsHostnames: true,
});
// We need to explicitly specify this role until
// https://github.com/pulumi/pulumi-eks/issues/833 is resolved:
const instanceRole = new aws.iam.Role("instance-role", {
assumeRolePolicy: JSON.stringify({
Version: "2012-10-17",
Statement: [
{
Action: "sts:AssumeRole",
Principal: { Service: "ec2.amazonaws.com" },
Effect: "Allow",
},
],
}),
});
const policyArns = [
"arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly",
"arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy",
"arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy",
"arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy",
];
policyArns.forEach((value, index) => new aws.iam.RolePolicyAttachment(`instance-role-policy-${index + 1}`, {
policyArn: value,
role: instanceRole.name,
}));
const cluster = new eks.Cluster(
"eks-airflow", {
vpcId: vpc.vpcId,
publicSubnetIds: vpc.publicSubnetIds,
privateSubnetIds: vpc.privateSubnetIds,
desiredCapacity: 3,
instanceType: "t3.medium",
minSize: 3,
maxSize: 6,
nodeAssociatePublicIpAddress: false,
instanceRole: instanceRole,
});
new aws.eks.Addon("ebs-csi-driver", {
addonName: "aws-ebs-csi-driver",
addonVersion: "v1.19.0-eksbuild.2",
clusterName: cluster.core.cluster.name
}); |
@jkodroff, thank you for sharing your solution! If anyone else is encountering the same issue, consider updating the driver version if you encounter any difficulties while using v1.19 ( |
Related: #857 |
Note that my solution above is not ideal from a security standpoint since it gives anything running on the node the ability to provision EBS volumes. It's just intended to get unblocked. A better solution is to use an IRSA role. |
What happened?
Whilst deploying "hello-world" eks cluster following https://www.pulumi.com/blog/crosswalk-for-aws-1-0/
I've noticed that gp2 class is created (default one) but CSI driver is not installed.
Maybe this is out of scope for Pulumi EKS support but it would be nice to have CSI driver automatically (as much as possible) setup for EKS.
More information on the EBS CSI is available in the AWS docs.
I've manually installed CSI driver following https://github.com/kubernetes-sigs/aws-ebs-csi-driver and after this done PVC are successfully bound.
Steps to reproduce
pulumi up with sample EKS configuration from above.
Create deployment with PVC.
PVC will not be bound.
Expected Behavior
EBS volumes (gp2) created and PVC bound in EKS.
Actual Behavior
PVC are not bound.
Output of
pulumi about
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: