Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/umotif-public/terraform-aws-eks-node-group
Terraform module to provision EKS Managed Node Group
https://github.com/umotif-public/terraform-aws-eks-node-group
aws aws-eks eks eks-node-group kubernetes kubernetes-cluster node-group terraform terraform-module
Last synced: 29 days ago
JSON representation
Terraform module to provision EKS Managed Node Group
- Host: GitHub
- URL: https://github.com/umotif-public/terraform-aws-eks-node-group
- Owner: umotif-public
- License: other
- Created: 2020-01-23T11:40:42.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-04T08:35:09.000Z (over 3 years ago)
- Last Synced: 2023-03-08T23:35:23.970Z (almost 2 years ago)
- Topics: aws, aws-eks, eks, eks-node-group, kubernetes, kubernetes-cluster, node-group, terraform, terraform-module
- Language: HCL
- Homepage: https://registry.terraform.io/modules/umotif-public/eks-node-group/aws
- Size: 48.8 KB
- Stars: 14
- Watchers: 4
- Forks: 20
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/umotif-public/terraform-aws-eks-node-group?style=social)
# terraform-aws-eks-node-group
Terraform module to provision EKS Managed Node Group## Resources created
This module will create EKS managed Node Group that will join your existing Kubernetes cluster. It supports use of launch template which will allow you to further enhance and modify worker nodes.
## Terraform versions
Terraform 0.12. Pin module version to `~> v4.0`. Submit pull-requests to `master` branch.
## Usage
```hcl
module "eks-node-group" {
source = "umotif-public/eks-node-group/aws"
version = "~> 4.0.0"cluster_name = aws_eks_cluster.cluster.id
node_group_name_prefix = "eks-test-"
subnet_ids = ["subnet-1","subnet-2","subnet-3"]
desired_size = 1
min_size = 1
max_size = 1instance_types = ["t3.large","t2.large"]
capacity_type = "SPOT"ec2_ssh_key = "eks-test"
labels = {
lifecycle = "OnDemand"
}taints = [
{
key = "test-1"
value = null
effect = "NO_SCHEDULE"
},
{
key = "test-2"
value = "value-test"
effect = "NO_EXECUTE"
}
]force_update_version = true
tags = {
Environment = "test"
}
}
```## Examples
* [EKS Node Group- single](https://github.com/umotif-public/terraform-aws-eks-node-group/tree/master/examples/single-node-group)
* [EKS Node Group- multiple az setup](https://github.com/umotif-public/terraform-aws-eks-node-group/tree/master/examples/multiaz-node-group)
* [EKS Node Group- single named node group](https://github.com/umotif-public/terraform-aws-eks-node-group/tree/master/examples/single-named-node-group)
* [EKS Node Group- single with launch template](https://github.com/umotif-public/terraform-aws-eks-node-group/tree/master/examples/single-node-group-with-launch-template)## Authors
Module managed by [Marcin Cuber](https://github.com/marcincuber) [LinkedIn](https://www.linkedin.com/in/marcincuber/).
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.12.6 |
| [aws](#requirement\_aws) | >= 3.43 |## Providers
| Name | Version |
|------|---------|
| [aws](#provider\_aws) | >= 3.43 |
| [random](#provider\_random) | n/a |## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_eks_node_group.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_node_group) | resource |
| [aws_iam_role.main](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy_attachment.main_AmazonEC2ContainerRegistryReadOnly](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_iam_role_policy_attachment.main_AmazonEKSWorkerNodePolicy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_iam_role_policy_attachment.main_AmazonEKS_CNI_Policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [random_id.main](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/id) | resource |## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [ami\_release\_version](#input\_ami\_release\_version) | AMI version of the EKS Node Group. Defaults to latest version for Kubernetes version | `string` | `null` | no |
| [ami\_type](#input\_ami\_type) | Type of Amazon Machine Image (AMI) associated with the EKS Node Group. Valid values: `AL2_x86_64`, `AL2_x86_64_GPU`. Terraform will only perform drift detection if a configuration value is provided | `string` | `null` | no |
| [capacity\_type](#input\_capacity\_type) | Type of capacity associated with the EKS Node Group. Defaults to ON\_DEMAND. Valid values: ON\_DEMAND, SPOT. | `string` | `"ON_DEMAND"` | no |
| [cluster\_name](#input\_cluster\_name) | The name of the EKS cluster | `string` | n/a | yes |
| [create\_iam\_role](#input\_create\_iam\_role) | Create IAM role for node group. Set to false if pass `node_role_arn` as an argument | `bool` | `true` | no |
| [desired\_size](#input\_desired\_size) | Desired number of worker nodes | `number` | n/a | yes |
| [disk\_size](#input\_disk\_size) | Disk size in GiB for worker nodes. Defaults to 20. Terraform will only perform drift detection if a configuration value is provided | `number` | `null` | no |
| [ec2\_ssh\_key](#input\_ec2\_ssh\_key) | SSH key name that should be used to access the worker nodes | `string` | `null` | no |
| [force\_update\_version](#input\_force\_update\_version) | Force version update if existing pods are unable to be drained due to a pod disruption budget issue. | `bool` | `false` | no |
| [instance\_types](#input\_instance\_types) | List of instance types associated with the EKS Node Group. Terraform will only perform drift detection if a configuration value is provided | `list(string)` | `null` | no |
| [kubernetes\_version](#input\_kubernetes\_version) | Kubernetes version. Defaults to EKS Cluster Kubernetes version. Terraform will only perform drift detection if a configuration value is provided | `string` | `null` | no |
| [labels](#input\_labels) | Key-value mapping of Kubernetes labels. Only labels that are applied with the EKS API are managed by this argument. Other Kubernetes labels applied to the EKS Node Group will not be managed | `map(string)` | `{}` | no |
| [launch\_template](#input\_launch\_template) | Configuration block with Launch Template settings. `name`, `id` and `version` parameters are available. | `map(string)` | `{}` | no |
| [max\_size](#input\_max\_size) | Maximum number of worker nodes | `number` | n/a | yes |
| [min\_size](#input\_min\_size) | Minimum number of worker nodes | `number` | n/a | yes |
| [node\_group\_name](#input\_node\_group\_name) | The name of the cluster node group. Defaults to - | `string` | `null` | no |
| [node\_group\_name\_prefix](#input\_node\_group\_name\_prefix) | Creates a unique name beginning with the specified prefix. Conflicts with node\_group\_name | `string` | `null` | no |
| [node\_group\_role\_name](#input\_node\_group\_role\_name) | The name of the cluster node group role. Defaults to -managed-group-node | `string` | `""` | no |
| [node\_role\_arn](#input\_node\_role\_arn) | IAM role arn that will be used by managed node group | `string` | `""` | no |
| [source\_security\_group\_ids](#input\_source\_security\_group\_ids) | Set of EC2 Security Group IDs to allow SSH access (port 22) from on the worker nodes. If you specify `ec2_ssh_key`, but do not specify this configuration when you create an EKS Node Group, port 22 on the worker nodes is opened to the Internet (0.0.0.0/0) | `list(string)` | `[]` | no |
| [subnet\_ids](#input\_subnet\_ids) | A list of subnet IDs to launch resources in | `list(string)` | n/a | yes |
| [tags](#input\_tags) | A map of tags (key-value pairs) passed to resources. | `map(string)` | `{}` | no |
| [taints](#input\_taints) | List of objects containing Kubernetes taints which will be applied to the nodes in the node group. Maximum of 50 taints per node group. | `list(object({ key = string, value = any, effect = string }))` | `[]` | no |## Outputs
| Name | Description |
|------|-------------|
| [iam\_role\_arn](#output\_iam\_role\_arn) | IAM role ARN used by node group. |
| [iam\_role\_id](#output\_iam\_role\_id) | IAM role ID used by node group. |
| [node\_group](#output\_node\_group) | Outputs from EKS node group. See `aws_eks_node_group` Terraform documentation for values |## License
See LICENSE for full details.
## Pre-commit hooks
### Install dependencies
* [`pre-commit`](https://pre-commit.com/#install)
* [`terraform-docs`](https://github.com/segmentio/terraform-docs) required for `terraform_docs` hooks.
* [`TFLint`](https://github.com/terraform-linters/tflint) required for `terraform_tflint` hook.##### MacOS
```bash
brew install pre-commit terraform-docs tflintbrew tap git-chglog/git-chglog
brew install git-chglog
```