From 197d46dd4138b154504720e3992188a1a220ada4 Mon Sep 17 00:00:00 2001 From: Eugene Istrati Date: Thu, 9 May 2024 13:09:12 -0400 Subject: [PATCH] core components --- iac/core/eks_cluster/default.tfvars | 32 +++++++++++++++++------------ iac/core/eks_cluster/main.tf | 14 ++++++++----- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/iac/core/eks_cluster/default.tfvars b/iac/core/eks_cluster/default.tfvars index 52a510d9..bbada5de 100644 --- a/iac/core/eks_cluster/default.tfvars +++ b/iac/core/eks_cluster/default.tfvars @@ -2,17 +2,23 @@ # SPDX-License-Identifier: MIT-0 q = { - name = "spf-eks-cluster" - version = "1.29" - public = true - private = true - admin = true - auth_mode = "API_AND_CONFIG_MAP" - addons = "vpc-cni,kube-proxy,eks-pod-identity-agent,coredns" - entry_type = "STANDARD" - groups = "" - access_type = "cluster" - namespaces = "" - log_types = "api,audit,authenticator,controllerManager,scheduler" - retention = 7 + name = "spf-eks-cluster" + version = "1.29" + public = true + private = true + admin = true + ip_family = "ipv4" + ipv4_cidr = "172.20.0.0/16" + ipv6_cidr = null + auth_mode = "API_AND_CONFIG_MAP" + addons = "vpc-cni,kube-proxy,eks-pod-identity-agent,coredns" + addons_version = "v1.18.1-eksbuild.1,v1.29.1-eksbuild.2,v1.2.0-eksbuild.1,v1.11.1-eksbuild.8" + addons_create = "OVERWRITE" + addons_update = "PRESERVE" + entry_type = "STANDARD" + groups = "" + access_type = "cluster" + namespaces = "" + log_types = "api,audit,authenticator,controllerManager,scheduler" + retention = 7 } diff --git a/iac/core/eks_cluster/main.tf b/iac/core/eks_cluster/main.tf index 88f0707e..6e2d6b9b 100644 --- a/iac/core/eks_cluster/main.tf +++ b/iac/core/eks_cluster/main.tf @@ -14,8 +14,9 @@ resource "aws_eks_cluster" "this" { } kubernetes_network_config { - ip_family = "ipv4" - service_ipv4_cidr = "172.20.0.0/16" + ip_family = var.q.ip_family + service_ipv4_cidr = var.q.ipv4_cidr + service_ipv6_cidr = var.q.ipv6_cidr } vpc_config { @@ -27,9 +28,12 @@ resource "aws_eks_cluster" "this" { } resource "aws_eks_addon" "this" { - count = length(split(",", var.q.addons)) - cluster_name = aws_eks_cluster.this.name - addon_name = element(split(",", var.q.addons), count.index) + count = length(split(",", var.q.addons)) + cluster_name = aws_eks_cluster.this.name + addon_name = element(split(",", var.q.addons), count.index) + addon_version = element(split(",", var.q.addons_version), count.index) + resolve_conflicts_on_create = var.q.addons_create + resolve_conflicts_on_update = var.q.addons_update } resource "aws_eks_access_entry" "this" {