Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
terraform_validation:
strategy:
matrix:
version: [1.3, 1.4, latest]
version: ["1.10", latest]
runs-on: ubuntu-latest

steps:
Expand Down
57 changes: 32 additions & 25 deletions examples/eks/eks_cluster_access_entries/eks.tf
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# 2. Create EKS cluster.
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "20.8.3"
version = "21.3.1"
putin_khuylo = true

cluster_name = var.cluster_name
cluster_version = var.cluster_version
cluster_endpoint_public_access = true
name = var.cluster_name
kubernetes_version = var.cluster_version
endpoint_public_access = true

cluster_addons = {
coredns = {
most_recent = true
}
kube-proxy = {
most_recent = true
addons = {
coredns = {}
eks-pod-identity-agent = {
before_compute = true
}
kube-proxy = {}
vpc-cni = {
most_recent = true
before_compute = true
}
}

Expand All @@ -25,29 +24,36 @@ module "eks" {

authentication_mode = "API_AND_CONFIG_MAP"

self_managed_node_groups = {
node_group_1 = {
name = "${var.cluster_name}-ng-1"
instance_type = "m5.large"
max_size = 5
min_size = 2
desired_size = 2
access_entries = {
for key, arn in var.additional_cluster_admin_arns :
key => {
principal_arn = arn
policy_associations = {
admin = {
policy_arn = "arn:aws:eks::aws:cluster-access-policy/AmazonEKSClusterAdminPolicy"
access_scope = {
type = "cluster"
}
}
}
}
}

eks_managed_node_groups = {
node_group_spot = {
name = "${var.cluster_name}-spot"
min_size = 1
node_group = {
name = "${var.cluster_name}"
min_size = 2
max_size = 10
desired_size = 1
desired_size = 2

instance_types = ["t3.large"]
capacity_type = "SPOT"
instance_types = ["m5.large"]

update_config = {
max_unavailable_percentage = 50 # or set `max_unavailable`
}
metadata_options = {
http_put_response_hop_limit = 2
}
}
}
}
Expand All @@ -71,4 +77,5 @@ resource "aws_eks_access_entry" "access_entry" {
cluster_name = var.cluster_name
principal_arn = module.castai-eks-role-iam.instance_profile_role_arn
type = "EC2_LINUX"
}
}

6 changes: 6 additions & 0 deletions examples/eks/eks_cluster_access_entries/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ variable "tags" {
description = "Optional tags for new cluster nodes. This parameter applies only to new nodes - tags for old nodes are not reconciled."
default = {}
}

variable "additional_cluster_admin_arns" {
type = map(string)
description = "Map of additional IAM user or role ARNs to be granted admin access to the EKS cluster."
default = {}
}
2 changes: 1 addition & 1 deletion examples/eks/eks_cluster_access_entries/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
version = "~> 6.0"
}
}
required_version = ">= 1.3.2"
Expand Down
2 changes: 1 addition & 1 deletion examples/eks/eks_cluster_access_entries/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ data "aws_availability_zones" "available" {}

module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "5.0.0"
version = "6.4.0"

name = var.cluster_name
cidr = "10.0.0.0/16"
Expand Down
Loading