{"id":18498809,"url":"https://github.com/smallcase/cdk-eks-cluster-module","last_synced_at":"2025-04-09T00:31:25.774Z","repository":{"id":39582551,"uuid":"485324412","full_name":"smallcase/cdk-eks-cluster-module","owner":"smallcase","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-19T18:57:22.000Z","size":515,"stargazers_count":7,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-06T11:02:27.538Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smallcase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-25T10:27:50.000Z","updated_at":"2025-03-19T18:57:26.000Z","dependencies_parsed_at":"2024-11-06T13:47:11.684Z","dependency_job_id":"24c056ef-c8a0-4a62-ad74-b1a0d94ef95d","html_url":"https://github.com/smallcase/cdk-eks-cluster-module","commit_stats":{"total_commits":26,"total_committers":4,"mean_commits":6.5,"dds":0.5,"last_synced_commit":"a902d20500209b99edee884da7bdab8ba510416d"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallcase%2Fcdk-eks-cluster-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallcase%2Fcdk-eks-cluster-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallcase%2Fcdk-eks-cluster-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smallcase%2Fcdk-eks-cluster-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smallcase","download_url":"https://codeload.github.com/smallcase/cdk-eks-cluster-module/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247471512,"owners_count":20944158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T13:42:39.356Z","updated_at":"2025-04-09T00:31:23.865Z","avatar_url":"https://github.com/smallcase.png","language":"TypeScript","readme":"# cdk-eks-cluster-module\ncdk-eks-cluster-module  is a [CDK](\u003c(github.com/aws-cdk/cdk)\u003e) that helps you configure complete EKS clusters that are fully bootstrapped with the operational software that is needed to deploy and operate workloads. You can describe the configuration for the desired state of your EKS cluster, such as the control plane, worker nodes, and Kubernetes add-ons, as code.\n\n\n## :sparkles: Features\n\n- :white_check_mark: AWS EKS Cluster Addons\n- :white_check_mark: Support for Multiple NodeGroups with labels and taints\n- :white_check_mark: Support for Multiple fargate profiles with labels and namespace\n- :white_check_mark: AWS EKS Identity Provider Configuration\n- :white_check_mark: Support for custom AMI, custom launch template, and custom user data including custom user data template\n- :white_check_mark: commonComponents interface allow to install custom repo/local helm chart\n- :white_check_mark: Install aws-ebs-csi-driver,aws-efs-csi-driver,node-problem-detector helm charts to help manage storage, and nodes.\n\n## :clapper: Quick Start\n\nThe quick start shows you how to create an **AWS-EKS** using this module.\n\n### Prerequisites\n\n- A working [`aws`](https://aws.amazon.com/cli/) CLI installation with access to an account and administrator privileges\n- You'll need a recent [NodeJS](https://nodejs.org) installation\n- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) to interact with your fresh cluster\n\n\nTo get going you'll need a CDK project. For details please refer to the [detailed guide for CDK](https://docs.aws.amazon.com/cdk/latest/guide/hello_world.html).\n\nCreate an empty directory on your system.\n\n```bash\nmkdir aws-quick-start-eks \u0026\u0026 cd aws-quick-start-eks\n```\n\nBootstrap your CDK project, we will use TypeScript, but you can switch to any other supported language.\n\n```bash\nnpx cdk init sample-eks  --language typescript\nnpx cdk bootstrap \n```\n\nInstall using NPM:\n```\nnpm install @smallcase/cdk-eks-cluster-module\n```\nUsing yarn\n```\nyarn add @smallcase/cdk-eks-cluster-module\n```\nUsing eks cluster can be deployed using the following sample code snippet:\n```typescript\nimport {\n  EKSCluster,\n  VpcCniAddonVersion,\n} from '@smallcase/cdk-eks-cluster-module';\n\nconst key = new kms.Key(this, 'EKS-KMS', {\n      enabled: true,\n      alias: 'EKS-KMS',\n    });\nkey.addToResourcePolicy(new iam.PolicyStatement({\n      sid: 'encrypt root volumes of nodeGroup using kms',\n      actions: [\n        'kms:Encrypt',\n        'kms:Decrypt',\n        'kms:ReEncrypt*',\n        'kms:GenerateDataKey*',\n        'kms:CreateGrant',\n        'kms:DescribeKey',\n      ],\n      resources: ['*'],\n      principals: [new iam.AnyPrincipal()],\n      conditions: {\n        StringEquals: {\n          'kms:CallerAccount': '\u003cYOUR-AWS-ID\u003e',\n          'kms:ViaService': 'ec2.\u003cREGION\u003e.amazonaws.com',\n        },\n      },\n    }));\n\n  const securityGroup = new ec2.SecurityGroup(\n      this,\n      'EKS-WORKER-SG',\n      {\n        vpc: vpc,\n        description: 'Kubernetes Worker SecurityGroup',\n      },\n    );\n\n  const testNodeTemplete = new ec2.LaunchTemplate(this, 'testNodeTemplete', {\n      instanceType: new ec2.InstanceType('m5a.large'),\n      blockDevices: [\n        {\n          deviceName: '/dev/xvda',\n          volume: ec2.BlockDeviceVolume.ebs(40,\n            {\n              deleteOnTermination: true,\n              encrypted: true,\n              volumeType: ec2.EbsDeviceVolumeType.GP3,\n              kmsKey: key,\n            },\n          ),\n          mappingEnabled: true,\n        },\n      ],\n    });\nlet ekscluster = new EKSCluster(this, 'EKS-CLUSTER', {\n      availabilityZones: Stack.of(this).availabilityZones,\n      clusterVPC: vpc,\n      kmsKey: key,\n      region: Stack.of(this).region,\n      workerSecurityGroup: securityGroup,\n      addonProps: {\n        vpnCniAddonVersion: VpcCniAddonVersion.V1_11_0,\n      },\n      clusterConfig: {\n        clusterName: 'EKS-CLUSTER',\n        clusterVersion: eks.KubernetesVersion.V1_22,\n        // this will create cluster autoscaler service account with iam role\n        addAutoscalerIam: true,\n        albControllerVersion: eks.AlbControllerVersion.V2_2_4,\n        defaultCapacity: 3,\n        subnets: {\n          privateSubnetGroupName: 'Private',\n        },\n        nodeGroups: [\n          {\n            name: 'test-node',\n            instanceTypes: [],\n            minSize: 3,\n            maxSize: 6,\n            launchTemplateSpec: {\n              version: testNodeTemplete.versionNumber,\n              id: testNodeTemplete.launchTemplateId!,\n            },\n            subnetGroupName: 'Private',\n            labels: {\n              role: 'test-eks-cluster',\n            },\n            taints: {\n              role: 'test-eks-cluster',\n            },\n            tags: {\n              'k8s.io/cluster-autoscaler/enabled': 'TRUE',\n              'k8s.io/cluster-autoscaler/EKS-CLUSTER':\n                'owned',\n            },\n          },\n        ]\n        commonComponents: {\n          'aws-efs-csi-driver': {\n            iamPolicyPath: ['../../assets/policy/aws-efs-csi-driver-policy.json'],\n            // above mention iam policy will be used for this service account\n            serviceAccounts: ['efs-csi-controller-sa', 'efs-csi-node-sa'],\n            helm: {\n              chartName: 'aws-efs-csi-driver',\n              chartVersion: '2.2.0',\n              helmRepository: 'https://kubernetes-sigs.github.io/aws-efs-csi-driver/',\n              namespace: 'kube-system',\n            },\n          },\n        },\n        teamMembers: [\n          \"your-aws-user\",\n        ],\n        teamExistingRolePermission: { //optional\n          '\u003cYOUR_ROLE_ARN\u003e': 'system:masters',\n        },\n      }\n  })\n```\n\n## [API.md](./API.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallcase%2Fcdk-eks-cluster-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmallcase%2Fcdk-eks-cluster-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmallcase%2Fcdk-eks-cluster-module/lists"}