Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/adding kube proxy and fixing core dns #114

Merged
merged 6 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module "captain" {
eks_version = "1.28"
csi_driver_version = "v1.30.0-eksbuild.1"
coredns_version = "v1.10.1-eksbuild.7"
kube_proxy_version = "v1.28.6-eksbuild.2"
vpc_cidr_block = "10.65.0.0/26"
region = "us-west-2"
availability_zones = ["us-west-2a", "us-west-2b"]
Expand Down Expand Up @@ -154,6 +155,7 @@ No requirements.
|------|------|
| [aws_eks_addon.coredns](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_addon.ebs_csi](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_addon.kube_proxy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |
| [aws_iam_role.eks_addon_ebs_csi_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | resource |
| [aws_iam_role_policy_attachment.ebs_csi](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy_attachment) | resource |
| [aws_security_group.captain](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | resource |
Expand All @@ -168,10 +170,11 @@ No requirements.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_availability_zones"></a> [availability\_zones](#input\_availability\_zones) | The availability zones to deploy into | `list(string)` | <pre>[<br> "us-west-2a",<br> "us-west-2b",<br> "us-west-2c"<br>]</pre> | no |
| <a name="input_coredns_version"></a> [coredns\_version](#input\_coredns\_version) | You should grab the appropriate version number from: https://docs.aws.amazon.com/eks/latest/userguide/managing-coredns.html | `string` | `"v1.10.1-eksbuild.6"` | no |
| <a name="input_csi_driver_version"></a> [csi\_driver\_version](#input\_csi\_driver\_version) | You should grab the appropriate version number from: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/CHANGELOG.md | `string` | `"v1.26.1-eksbuild.1"` | no |
| <a name="input_eks_version"></a> [eks\_version](#input\_eks\_version) | The version of EKS to deploy | `string` | `"1.28"` | no |
| <a name="input_coredns_version"></a> [coredns\_version](#input\_coredns\_version) | You should grab the appropriate version number from: https://docs.aws.amazon.com/eks/latest/userguide/managing-coredns.html | `string` | `"v1.10.1-eksbuild.7"` | no |
| <a name="input_csi_driver_version"></a> [csi\_driver\_version](#input\_csi\_driver\_version) | You should grab the appropriate version number from: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/CHANGELOG.md | `string` | `"v1.29.1-eksbuild.1"` | no |
| <a name="input_eks_version"></a> [eks\_version](#input\_eks\_version) | The version of EKS to deploy | `string` | `"1.27"` | no |
| <a name="input_iam_role_to_assume"></a> [iam\_role\_to\_assume](#input\_iam\_role\_to\_assume) | The full ARN of the IAM role to assume | `string` | n/a | yes |
| <a name="input_kube_proxy_version"></a> [kube\_proxy\_version](#input\_kube\_proxy\_version) | You should grab the appropriate version number from: https://docs.aws.amazon.com/eks/latest/userguide/managing-kube-proxy.html | `string` | `"v1.27.10-eksbuild.2"` | no |
| <a name="input_node_pools"></a> [node\_pools](#input\_node\_pools) | node pool configurations:<br> - name (string): Name of the node pool. MUST BE UNIQUE! Recommended to use YYYYMMDD in the name<br> - node\_count (number): number of nodes to create in the node pool.<br> - instance\_type (string): Instance type to use for the nodes. ref: https://instances.vantage.sh/<br> - ami\_image\_id (string): AMI image ID to use for EKS worker nodes. This varies per region!! ref: https://github.com/awslabs/amazon-eks-ami/releases to find the AMI ID go to the console: https://us-west-2.console.aws.amazon.com/ec2/home?region=us-west-2#Images:visibility=public-images;search=amazon-eks-node-1.28-v20230703<br> - spot (bool): Enable spot instances for the nodes. DO NOT ENABLE IN PROD!<br> - disk\_size\_gb (number): Disk size in GB for the nodes.<br> - max\_pods (number): max pods that can be scheduled per node.<br> - ssh\_key\_pair\_names (list(string)): List of SSH key pair names to associate with the nodes. ref: https://us-west-2.console.aws.amazon.com/ec2/home?region=us-west-2#KeyPairs:<br> - kubernetes\_labels (map(string)): Map of labels to apply to the nodes. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/<br> - kubernetes\_taints (list(object)): List of taints to apply to the nodes. ref: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ | <pre>list(object({<br> name = string<br> node_count = number<br> instance_type = string<br> ami_image_id = string<br> spot = bool<br> disk_size_gb = number<br> max_pods = number<br> ssh_key_pair_names = list(string)<br> kubernetes_labels = map(string)<br> kubernetes_taints = list(object({<br> key = string<br> value = string<br> effect = string<br> }))<br><br> }))</pre> | <pre>[<br> {<br> "ami_image_id": "ami-077ca19cf151a75e0",<br> "disk_size_gb": 20,<br> "instance_type": "t3a.large",<br> "kubernetes_labels": {},<br> "kubernetes_taints": [],<br> "max_pods": 110,<br> "name": "default-pool",<br> "node_count": 1,<br> "spot": false,<br> "ssh_key_pair_names": []<br> }<br>]</pre> | no |
| <a name="input_peering_configs"></a> [peering\_configs](#input\_peering\_configs) | A list of maps containing VPC peering configuration details | <pre>list(object({<br> vpc_peering_connection_id = string<br> destination_cidr_block = string<br> }))</pre> | `[]` | no |
| <a name="input_region"></a> [region](#input\_region) | The AWS region to deploy into | `string` | n/a | yes |
Expand Down
15 changes: 0 additions & 15 deletions addon_coredns.tf

This file was deleted.

27 changes: 27 additions & 0 deletions addon_csi.tf → addons.tf
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,30 @@ resource "aws_eks_addon" "ebs_csi" {
configuration_values = local.csi_addon_node_tolerations

}

resource "aws_eks_addon" "coredns" {
cluster_name = module.kubernetes.eks_cluster_id
addon_name = "coredns"
addon_version = var.coredns_version
resolve_conflicts_on_create = "OVERWRITE"
resolve_conflicts_on_update = "OVERWRITE"

service_account_role_arn = null
depends_on = [module.node_pool]
count = length(var.node_pools) > 0 ? 1 : 0

configuration_values = local.coredns_addon_node_tolerations
}


resource "aws_eks_addon" "kube_proxy" {
cluster_name = module.kubernetes.eks_cluster_id
addon_name = "kube-proxy"
addon_version = var.kube_proxy_version
resolve_conflicts_on_create = "OVERWRITE"
resolve_conflicts_on_update = "OVERWRITE"

service_account_role_arn = null
depends_on = [module.node_pool]
count = length(var.node_pools) > 0 ? 1 : 0
}
1 change: 1 addition & 0 deletions docs/.header.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module "captain" {
eks_version = "1.28"
csi_driver_version = "v1.30.0-eksbuild.1"
coredns_version = "v1.10.1-eksbuild.7"
kube_proxy_version = "v1.28.6-eksbuild.2"
vpc_cidr_block = "10.65.0.0/26"
region = "us-west-2"
availability_zones = ["us-west-2a", "us-west-2b"]
Expand Down
1 change: 1 addition & 0 deletions tests/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module "captain" {
eks_version = "1.28"
csi_driver_version = "v1.30.0-eksbuild.1"
coredns_version = "v1.10.1-eksbuild.7"
kube_proxy_version = "v1.28.6-eksbuild.2"
vpc_cidr_block = "10.65.0.0/26"
region = "us-west-2"
availability_zones = ["us-west-2a", "us-west-2b"]
Expand Down
12 changes: 9 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@ variable "region" {

variable "csi_driver_version" {
type = string
default = "v1.26.1-eksbuild.1"
default = "v1.29.1-eksbuild.1"
description = "You should grab the appropriate version number from: https://github.com/kubernetes-sigs/aws-ebs-csi-driver/blob/master/CHANGELOG.md"
}

variable "coredns_version" {
type = string
default = "v1.10.1-eksbuild.6"
default = "v1.10.1-eksbuild.7"
description = "You should grab the appropriate version number from: https://docs.aws.amazon.com/eks/latest/userguide/managing-coredns.html"
}

variable "kube_proxy_version" {
type = string
default = "v1.27.10-eksbuild.2"
description = "You should grab the appropriate version number from: https://docs.aws.amazon.com/eks/latest/userguide/managing-kube-proxy.html"
}


locals {

Expand Down Expand Up @@ -59,7 +65,7 @@ variable "availability_zones" {
variable "eks_version" {
type = string
description = "The version of EKS to deploy"
default = "1.28"
default = "1.27"
}

variable "node_pools" {
Expand Down