Skip to content

Commit

Permalink
Finished testing and updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgin314 committed Jul 26, 2024
1 parent 2d2d789 commit 65552fb
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ Karpenter is an open source tool developed by AWS for cluster autoscaling (Horiz

ref: [Karpenter Best Practices](https://aws.github.io/aws-eks-best-practices/karpenter/)

NOTE: Deploying Karpenter after deploying Istio is not recommended because it disrupts the handling of sidecars to pods on Karpenter managed nodes. As long as Karpenter is deployed first, there is no issue.

The module deploys Karpenter needed AWS resources, namely in IAM. It copies the Karpenter controller from the public registry to local ECR, deploys Karpenter via Helm and deploys a single default Karpenter Nodepool with EC2NodeClass.

# CHANGELOG

* 0.0.1 -- 2024-07-23
* 0.0.1 -- 2024-07-26
- Genesis/Initial development

<!-- BEGIN_TF_DOCS -->
Expand Down
86 changes: 86 additions & 0 deletions examples/simple/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Karpenter Example

Configuration in this directory creates an AWS EKS cluster with Karpenter provisioned for managing compute resource scaling. In the example, Karpenter is provisioned on top of an EKS Managed Node Group following best practice recommendations.

## Usage

To run this example you need to execute:

```bash
$ terraform init
$ terraform plan
$ terraform apply
```

Verifying Karpenter is deployed:

```bash
$ # Verify Karpenter controller pods
$ kubectl get pods -n karpenter
$
$ # Review controller logs with
$ kubectl logs -f -n karpenter -l app.kubernetes.io/name=karpenter -c controller
$
$ # Identify Karpenter managed nodes
$ kubectl get nodes -L karpenter.sh/registered
```

### Tear Down & Clean-Up

Because Karpenter manages the state of node resources outside of Terraform, Karpenter created resources will need to be de-provisioned first before removing the remaining resources with Terraform.

1. Remove any nodes created by Karpenter

```bash

kubectl delete node -l karpenter.sh/provisioner-name=default
```

2. Remove the resources created by Terraform

```bash
terraform destroy
```

<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | 5.57.0 |

## Modules

| Name | Source | Version |
|------|--------|---------|
| <a name="module_karpenter"></a> [karpenter](#module\_karpenter) | ../.. | n/a |

## Resources

| Name | Type |
|------|------|
| [aws_eks_cluster.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster) | data source |
| [aws_eks_cluster_auth.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster_auth) | data source |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_cluster_endpoint"></a> [cluster\_endpoint](#input\_cluster\_endpoint) | Endpoint for your Kubernetes API server | `string` | n/a | yes |
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | EKS cluster name name component used through out the EKS cluster describing its purpose (ex: dice-dev) | `string` | n/a | yes |
| <a name="input_karpenter_node_group_name"></a> [karpenter\_node\_group\_name](#input\_karpenter\_node\_group\_name) | The cluster node group that will host karpenter, should not be a karpenter managed node group | `string` | n/a | yes |
| <a name="input_oidc_provider_arn"></a> [oidc\_provider\_arn](#input\_oidc\_provider\_arn) | The ARN of the OIDC Provider if `enable_irsa = true` | `string` | n/a | yes |
| <a name="input_profile"></a> [profile](#input\_profile) | AWS config profile | `string` | `""` | no |
| <a name="input_region"></a> [region](#input\_region) | AWS region | `string` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | AWS Tags to apply to appropriate resources | `map(string)` | `{}` | no |

## Outputs

No outputs.
<!-- END_TF_DOCS -->

0 comments on commit 65552fb

Please sign in to comment.