diff --git a/README.md b/README.md index cd39e18..b658356 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ module "captain" { node_pools = [ # { # "kubernetes_version" : "1.30", -# "ami_release_version" : "1.30.8-20250116", +# "ami_release_version" : "1.30.8-20250123", # "ami_type" : "AL2_x86_64", # "instance_type" : "t3a.large", # "name" : "glueops-platform-node-pool-1", @@ -49,7 +49,7 @@ module "captain" { # }, # { # "kubernetes_version" : "1.30", -# "ami_release_version" : "1.30.8-20250116", +# "ami_release_version" : "1.30.8-20250123", # "ami_type" : "AL2_x86_64", # "instance_type" : "t3a.small", # "name" : "glueops-platform-node-pool-argocd-app-controller-1", @@ -71,7 +71,7 @@ module "captain" { # }, # { # "kubernetes_version" : "1.30", -# "ami_release_version" : "1.30.8-20250116", +# "ami_release_version" : "1.30.8-20250123", # "ami_type" : "AL2_x86_64", # "instance_type" : "t3a.medium", # "name" : "clusterwide-node-pool-1", @@ -200,7 +200,7 @@ No requirements. | [eks\_version](#input\_eks\_version) | The version of EKS to deploy | `string` | `"1.30"` | no | | [iam\_role\_to\_assume](#input\_iam\_role\_to\_assume) | The full ARN of the IAM role to assume | `string` | n/a | yes | | [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.30.7-eksbuild.2"` | no | -| [node\_pools](#input\_node\_pools) | node pool configurations:
- name (string): Name of the node pool. MUST BE UNIQUE! Recommended to use YYYYMMDD in the name
- node\_count (number): number of nodes to create in the node pool.
- instance\_type (string): Instance type to use for the nodes. ref: https://instances.vantage.sh/
- kubernetes\_version (string): Generally this is the same version as the EKS cluster. But if doing a node pool upgrade this may be a different version.
- ami\_release\_version (string): AMI Release version to use for EKS worker nodes. ref: https://github.com/awslabs/amazon-eks-ami/releases
- ami\_type (string): e.g. AMD64 or ARM
- spot (bool): Enable spot instances for the nodes. DO NOT ENABLE IN PROD!
- disk\_size\_gb (number): Disk size in GB for the nodes.
- max\_pods (number): max pods that can be scheduled per node.
- 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:
- kubernetes\_labels (map(string)): Map of labels to apply to the nodes. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
- kubernetes\_taints (list(object)): List of taints to apply to the nodes. ref: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ |
list(object({
name = string
node_count = number
instance_type = string
kubernetes_version = string
ami_release_version = string
ami_type = string
spot = bool
disk_size_gb = number
max_pods = number
ssh_key_pair_names = list(string)
kubernetes_labels = map(string)
kubernetes_taints = list(object({
key = string
value = string
effect = string
}))

}))
|
[
{
"ami_release_version": "1.30.8-20250116",
"ami_type": "AL2_x86_64",
"disk_size_gb": 20,
"instance_type": "t3a.large",
"kubernetes_labels": {},
"kubernetes_taints": [],
"kubernetes_version": "1.30",
"max_pods": 110,
"name": "default-pool",
"node_count": 1,
"spot": false,
"ssh_key_pair_names": []
}
]
| no | +| [node\_pools](#input\_node\_pools) | node pool configurations:
- name (string): Name of the node pool. MUST BE UNIQUE! Recommended to use YYYYMMDD in the name
- node\_count (number): number of nodes to create in the node pool.
- instance\_type (string): Instance type to use for the nodes. ref: https://instances.vantage.sh/
- kubernetes\_version (string): Generally this is the same version as the EKS cluster. But if doing a node pool upgrade this may be a different version.
- ami\_release\_version (string): AMI Release version to use for EKS worker nodes. ref: https://github.com/awslabs/amazon-eks-ami/releases
- ami\_type (string): e.g. AMD64 or ARM
- spot (bool): Enable spot instances for the nodes. DO NOT ENABLE IN PROD!
- disk\_size\_gb (number): Disk size in GB for the nodes.
- max\_pods (number): max pods that can be scheduled per node.
- 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:
- kubernetes\_labels (map(string)): Map of labels to apply to the nodes. ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
- kubernetes\_taints (list(object)): List of taints to apply to the nodes. ref: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ |
list(object({
name = string
node_count = number
instance_type = string
kubernetes_version = string
ami_release_version = string
ami_type = string
spot = bool
disk_size_gb = number
max_pods = number
ssh_key_pair_names = list(string)
kubernetes_labels = map(string)
kubernetes_taints = list(object({
key = string
value = string
effect = string
}))

}))
|
[
{
"ami_release_version": "1.30.8-20250123",
"ami_type": "AL2_x86_64",
"disk_size_gb": 20,
"instance_type": "t3a.large",
"kubernetes_labels": {},
"kubernetes_taints": [],
"kubernetes_version": "1.30",
"max_pods": 110,
"name": "default-pool",
"node_count": 1,
"spot": false,
"ssh_key_pair_names": []
}
]
| no | | [peering\_configs](#input\_peering\_configs) | A list of maps containing VPC peering configuration details |
list(object({
vpc_peering_connection_id = string
destination_cidr_block = string
}))
| `[]` | no | | [region](#input\_region) | The AWS region to deploy into | `string` | n/a | yes | | [vpc\_cidr\_block](#input\_vpc\_cidr\_block) | The CIDR block for the VPC | `string` | `"10.65.0.0/26"` | no | diff --git a/docs/.header.md b/docs/.header.md index 90b688b..9a5ad63 100644 --- a/docs/.header.md +++ b/docs/.header.md @@ -27,7 +27,7 @@ module "captain" { node_pools = [ # { # "kubernetes_version" : "1.30", -# "ami_release_version" : "1.30.8-20250116", +# "ami_release_version" : "1.30.8-20250123", # "ami_type" : "AL2_x86_64", # "instance_type" : "t3a.large", # "name" : "glueops-platform-node-pool-1", @@ -49,7 +49,7 @@ module "captain" { # }, # { # "kubernetes_version" : "1.30", -# "ami_release_version" : "1.30.8-20250116", +# "ami_release_version" : "1.30.8-20250123", # "ami_type" : "AL2_x86_64", # "instance_type" : "t3a.small", # "name" : "glueops-platform-node-pool-argocd-app-controller-1", @@ -71,7 +71,7 @@ module "captain" { # }, # { # "kubernetes_version" : "1.30", -# "ami_release_version" : "1.30.8-20250116", +# "ami_release_version" : "1.30.8-20250123", # "ami_type" : "AL2_x86_64", # "instance_type" : "t3a.medium", # "name" : "clusterwide-node-pool-1", diff --git a/tests/k8s-test.sh b/tests/k8s-test.sh index 085a16b..111fdf7 100755 --- a/tests/k8s-test.sh +++ b/tests/k8s-test.sh @@ -2,6 +2,37 @@ set -e +# Step 1: Verify pods can get created on the current ami_release_version +echo "::group::Creating pods on every node in the cluster" +for node in $(kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}'); do + kubectl run -n test-pods-creation alpine-on-$node \ + --image=alpine:latest \ + --overrides='{ + "apiVersion": "v1", + "kind": "Pod", + "spec": { + "nodeName": "'"$node"'", + "containers": [{ + "name": "alpine", + "image": "alpine:latest", + "command": ["/bin/sh", "-c", "while true; do echo Running on $(hostname); sleep 3600; done"] + }] + } + }' +done +sleep 300 +echo "::group::Checking the all pods are in running state" +POD_COUNT=$(kubectl get pods -n test-pods-creation --field-selector=status.phase=Running --no-headers | wc -l) +echo "::group::Comparing number of running pods to the desired count" +if [ "$POD_COUNT" -ne 8 ]; then + echo "Expected 8 pods, but found $POD_COUNT." + exit 1 +else + echo "Pod count matches expected value: $POD_COUNT." +fi +kubectl delete pods --all -n test-pods-creation +echo "::endgroup::" + # Step 1: Verify storage driver installation (Amazon EBS CSI Driver) echo "::group::Checking if the storage driver is installed..." kubectl get pods -n kube-system | grep "ebs-csi-" diff --git a/tests/main.tf b/tests/main.tf index 338c48f..a033ff4 100644 --- a/tests/main.tf +++ b/tests/main.tf @@ -11,7 +11,7 @@ module "captain" { node_pools = [ # { # "kubernetes_version" : "1.30", - # "ami_release_version" : "1.30.8-20250116", + # "ami_release_version" : "1.30.8-20250123", # "ami_type" : "AL2_x86_64", # "instance_type" : "t3a.large", # "name" : "glueops-platform-node-pool-1", @@ -33,7 +33,7 @@ module "captain" { # }, # { # "kubernetes_version" : "1.30", - # "ami_release_version" : "1.30.8-20250116", + # "ami_release_version" : "1.30.8-20250123", # "ami_type" : "AL2_x86_64", # "instance_type" : "t3a.small", # "name" : "glueops-platform-node-pool-argocd-app-controller-1", @@ -55,7 +55,7 @@ module "captain" { # }, # { # "kubernetes_version" : "1.30", - # "ami_release_version" : "1.30.8-20250116", + # "ami_release_version" : "1.30.8-20250123", # "ami_type" : "AL2_x86_64", # "instance_type" : "t3a.medium", # "name" : "clusterwide-node-pool-1", diff --git a/variables.tf b/variables.tf index 5793731..75a11d4 100644 --- a/variables.tf +++ b/variables.tf @@ -98,7 +98,7 @@ variable "node_pools" { name = "default-pool" node_count = 1 instance_type = "t3a.large" - ami_release_version = "1.30.8-20250116" + ami_release_version = "1.30.8-20250123" kubernetes_version = "1.30" ami_type = "AL2_x86_64" spot = false