cdk-eks-blueprints icon indicating copy to clipboard operation
cdk-eks-blueprints copied to clipboard

[Feature] diskSize property for root device disk size in ClusterProvider

Open engel80 opened this issue 3 years ago • 3 comments

In case of the CDK v2, NodegroupOptions provides the diskSize property for root device disk size. https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_eks.NodegroupOptions.html#disksize

I could not find the diskSize property in ManagedNodeGroup interface: https://github.com/aws-samples/cdk-eks-blueprints-patterns/blob/main/lib/generic-cluster-construct/index.ts

        const clusterProvider = new blueprints.GenericClusterProvider({
            version: eks.KubernetesVersion.V1_21,
            managedNodeGroups: [
                {
                    id: "mng-ondemand",
                    amiType: eks.NodegroupAmiType.AL2_X86_64,
                    instanceTypes: [new ec2.InstanceType('m5.2xlarge')]
                },
                {
                    id: "mng2-spot",
                    instanceTypes: [ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE3, ec2.InstanceSize.MEDIUM)],
                    nodeGroupCapacityType: eks.CapacityType.SPOT
                }
            ]
        });

How can I set the Volume size in blueprints?

Thank you

engel80 avatar May 02 '22 12:05 engel80

This will be fixed by exposing the disk size parameter. If there is anything else of similar nature that you would like to add to the node group configuration, please let me know.

shapirov103 avatar May 09 '22 20:05 shapirov103

This will be fixed by exposing the disk size parameter. If there is anything else of similar nature that you would like to add to the node group configuration, please let me know.

Thank you Mikhail Shapirov As of now, K8s label feature is not yet supported. In case of GPU instance, it's mandatory to use GPU like the following:

        const cluster = new eks.Cluster(this, 'eksCluster', {
            clusterName: CLUSTER_NAME,
            tags: {
                Name: CLUSTER_NAME,
            },
            mastersRole: clusterAdmin,
            role: eksRole,
            version: eks.KubernetesVersion.V1_21,
            vpc: vpc,
            defaultCapacity: 2,
            defaultCapacityInstance: new ec2.InstanceType('c5.large'),
            clusterLogging: [
                eks.ClusterLoggingTypes.API,
                eks.ClusterLoggingTypes.SCHEDULER
            ],
        });
        const gpuNodeGroup = cluster.addNodegroupCapacity('gpuNg', {
            nodegroupName: 'gpu-ng',
            instanceTypes: [new ec2.InstanceType('p2.xlarge')],
            labels: { 'accelerator': 'nvidia-gpu' }, <- like this
            minSize: 2,
            maxSize: 10,
            capacityType: eks.CapacityType.SPOT
        });

Please add a function or property for labels as well.

engel80 avatar May 10 '22 08:05 engel80

@engel80 this has been supported for a couple of patch releases. You can use labels like this:

   const clusterProvider = new blueprints.GenericClusterProvider({
            version: KubernetesVersion.V1_21,
            managedNodeGroups: [
                {
                    id: "mng1",
                    amiType: NodegroupAmiType.AL2_X86_64,
                    instanceTypes: [new ec2.InstanceType('m5.2xlarge')],
                    diskSize: 25,
                    nodeGroupSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT },
                    labels: {
                        "key": "value"
                    }
                }

Please verify if you get a chance.

shapirov103 avatar Jul 28 '22 04:07 shapirov103

This issue has been automatically marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this issue will be closed in 10 days

github-actions[bot] avatar Jul 22 '23 00:07 github-actions[bot]

Issue closed due to inactivity.

github-actions[bot] avatar Sep 20 '23 00:09 github-actions[bot]