Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
clementbolin authored Apr 12, 2024
1 parent 150a299 commit baa995e
Showing 1 changed file with 59 additions and 14 deletions.
73 changes: 59 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,84 @@
# Documentation
# AWS EKS Cluster Terraform Module Documentation

To deploy and configure an AWS EKS cluster using Terraform, this guide will walk you through the usage of a custom Terraform module alongside explanations of key tools and AWS add-ons involved in the process. The deployment consists of three main steps: setting up IAM roles for EKS, creating the EKS cluster itself, and adding extra dependencies like Fargate profiles, Karpenter for auto-scaling, and IAM Roles for Service Accounts (IRSA) for AWS ALB Ingress Controller and ExternalDNS.
## Overview

## Example
This Terraform module is designed to deploy and configure an AWS EKS cluster. It includes the setup of IAM roles, creation of the EKS cluster, and configuration of additional dependencies such as Fargate profiles, Karpenter for auto-scaling, and IAM Roles for Service Accounts (IRSA) for the AWS ALB Ingress Controller and ExternalDNS.

## Prerequisites

- AWS CLI installed and configured
- Terraform v0.12+ installed
- Appropriate AWS permissions to create and manage EKS, IAM, and related resources

## Usage

To use this module, include it in your Terraform configuration with the required variables and settings. Below is an example of how to use this module to create an EKS cluster:

```terraform
module "eks" {
source = "./../"
source = "./../" # Adjust the source path based on your Terraform files structure
aws_region_short = var.aws_region_short
aws_region_short = "us-west-2" # Specify the AWS region
network = {
vpc_id = local.vpc_id
subnet_ids = var.vpc.subnet_ids
control_plane_subnet_ids = var.vpc.subnet_ids
vpc_id = "vpc-0a1b2c3d4e"
subnet_ids = ["subnet-67890", "subnet-abcde"]
control_plane_subnet_ids = ["subnet-67890", "subnet-abcde"]
}
cluster = {
version = "1.29"
name = var.cluster_name
name = "my-eks-cluster"
endpoint_public_access = false
}
kms_key_administrators = [
"arn:aws:iam::478986666586:user/trackit-eks",
"arn:aws:iam::123456789012:user/my-user",
]
ecr_token = {
password = data.aws_ecrpublic_authorization_token.token.password
user_name = data.aws_ecrpublic_authorization_token.token.user_name
password = "examplepassword"
user_name = "exampleusername"
}
env = "staging"
zone_name = "adn.tech"
zone_name = "example.com"
tags = var.tags
tags = {
Environment = "staging"
Team = "devops"
}
}
```

## Variables

- **aws_region_short** - The short name of the AWS region where the resources will be created.
- **network** - Configuration for the VPC and subnets.
- **cluster** - Specifications of the EKS cluster including version, name, and access settings.
- **kms_key_administrators** - AWS KMS key administrators for encrypted resources.
- **ecr_token** - Token for ECR authentication.
- **env** - Deployment environment identifier.
- **zone_name** - DNS zone name for route53 configurations.
- **tags** - Tags to apply to all resources created.

## Outputs

- **cluster_arn** - The ARN of the EKS cluster.
- **cluster_endpoint** - The endpoint URL for the Kubernetes API server.
- **cluster_oidc_issuer_url** - The URL for the OIDC provider.
- **node_security_group_id** - Security group ID associated with the node groups.
- **karpenter_iam_role_arn** - IAM role ARN used by Karpenter.

## Modules

This configuration uses several modules:

- **module.iam** - Manages IAM roles and policies.
- **module.eks** - Main module for creating and managing the EKS cluster.
- **module.karpenter** - Manages Karpenter-specific configurations for auto-scaling.
- **module.eks_auth** - Manages Kubernetes auth configurations.

## Contributing

To contribute to this project, please create pull requests or issues in the project's GitHub repository. Ensure you follow the existing code styles and add tests for new features.

0 comments on commit baa995e

Please sign in to comment.