This repository was archived by the owner on May 17, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Expand file tree Collapse file tree 4 files changed +16
-6
lines changed Original file line number Diff line number Diff line change
1
+ /config-map-aws-auth_ *
2
+ /kubeconfig_ *
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ output "config" {
10
10
value = " ${ jsonencode (local. config )} "
11
11
}
12
12
13
- # output "kubeconfig_command" {
14
- # value = "eksctl utils write-kubeconfig --name=cluster- ${random_id.suffix.hex} --kubeconfig=$KUBECONFIG --set-kubeconfig-context=true --region=${var.region} && cat infrastructure/amazon/aws-auth.yaml | sed -e \"s~{{ROLE_ARN}}~${module.cluster.cluster_node_arn}~g\" | kubectl apply -f - "
15
- # }
13
+ output "kubeconfig_command" {
14
+ value = " cp infrastructure/amazon/kubeconfig_cluster- ${ random_id . suffix . hex } $$KUBECONFIG "
15
+ }
16
16
17
17
output "kubeconfig" {
18
18
description = " kubectl config as generated by the module."
Original file line number Diff line number Diff line change @@ -2,11 +2,17 @@ variable "region" {
2
2
default = " eu-west-1"
3
3
}
4
4
5
+ variable "cluster_version" {
6
+ default = " 1.12"
7
+ }
8
+
5
9
provider "aws" {
6
10
region = " ${ var . region } "
7
11
}
8
12
9
13
module "cluster" {
10
- source = " ../modules/amazon-cluster"
11
- suffix = " ${ random_id . suffix . hex } "
14
+ source = " ../modules/amazon-cluster"
15
+ suffix = " ${ random_id . suffix . hex } "
16
+
17
+ cluster_version = " ${ var . cluster_version } "
12
18
}
Original file line number Diff line number Diff line change 1
1
variable "suffix" {}
2
+ variable "cluster_version" {}
2
3
3
4
data "aws_availability_zones" "available" {}
4
5
5
6
locals {
6
- cluster_name = " cluster-${ var . suffix } "
7
+ cluster_name = " cluster-${ var . suffix } "
7
8
8
9
worker_groups = [
9
10
{
@@ -94,6 +95,7 @@ module "vpc" {
94
95
module "eks" {
95
96
source = " terraform-aws-modules/eks/aws"
96
97
cluster_name = " ${ local . cluster_name } "
98
+ cluster_version = " ${ var . cluster_version } "
97
99
subnets = [" ${ module . vpc . private_subnets } " ]
98
100
tags = " ${ local . tags } "
99
101
vpc_id = " ${ module . vpc . vpc_id } "
You can’t perform that action at this time.
0 commit comments