diff --git a/Makefile b/Makefile index 84a2d07..940bd59 100644 --- a/Makefile +++ b/Makefile @@ -65,13 +65,14 @@ build: ## Build the binary using local golang ## Container ## -------------------------------------- ##@ container: -.PHONY: image_build -image_build: ## Build the container image + +.PHONY: image-build +image-build: ## Build the container image docker build --build-arg KUBERNETES_VERSION=$(KUBERNETES_VERSION) -t $(IMG_PATH):$(TAG) . docker tag $(IMG_PATH):$(TAG) $(IMG_PATH):latest .PHONY: image_push -image_push: ## Push the container image to k8s-staging bucket +image-push: ## Push the container image to k8s-staging bucket docker push $(IMG_PATH):$(TAG) docker push $(IMG_PATH):latest @@ -85,7 +86,7 @@ release-staging: ## Builds and push container image to k8s-staging bucket ##@ setup: .PHONY: local-kind-test -local-kind-test: image_build ## Run e2e tests with Kind, useful for development mode +local-kind-test: image-build ## Run e2e tests with Kind, useful for development mode ./hack/kind_run.sh ${IMG_REPO} ${IMG_NAME} ${TAG} ### -------------------------------------- diff --git a/README.md b/README.md index 74755cb..f287d22 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,7 @@ To retrieve the sonobuoy result: make sonobuoy-results ``` -The failed results are going to be formatted as follow by default: +The failed results are going to be formatted as follows by default: ``` Plugin: op-readiness @@ -193,7 +193,7 @@ to render a custom `sonobuoy-plugin.yaml` file. #### Running on CAPZ upstream -If you want to test your changes on upstream, use the following bot commmand: +If you want to test your changes on upstream, use the following bot command when opening a new PR: ```shell /test operational-tests-capz-windows-2019 diff --git a/hack/build_k8s_test_binary.sh b/hack/build_k8s_test_binary.sh index e44f159..7c26f96 100755 --- a/hack/build_k8s_test_binary.sh +++ b/hack/build_k8s_test_binary.sh @@ -19,7 +19,7 @@ set -o pipefail set -x # todo(knabben) - fetch latest or pass as argument -KUBERNETES_VERSION=${KUBERNETES_VERSION:-"v1.24.0"} +KUBERNETES_VERSION=${KUBERNETES_VERSION:-"v1.28.0"} KUBERNETES_REPO=${KUBERNETES_REPO:-"https://github.com/kubernetes/kubernetes.git"} if [ $1 != 0 ]; then diff --git a/terraform/.gitignore b/terraform/.gitignore new file mode 100644 index 0000000..92c001d --- /dev/null +++ b/terraform/.gitignore @@ -0,0 +1,2 @@ +terraform.tfstate* +.terraform* diff --git a/terraform/README.md b/terraform/README.md new file mode 100644 index 0000000..be4ca2a --- /dev/null +++ b/terraform/README.md @@ -0,0 +1,92 @@ +## Create a Windows Cluster + +In case you don't have a Windows cluster available, this project gives an option to bootstrap a new cluster +on AWS (initially) via Terraform using AWS managed clusters with EKS. Other projects exists in +case the user prefer to create the cluster locally with a robust machine, see [here](https://github.com/kubernetes-sigs/sig-windows-dev-tools). + +### Pre-requisites + +Terraform >= 1.1.0 +AWS Account with proper IAM permissions + +### Initializing modules + +Under the folder `./terraform` all the resources exists, to initizlie and download the used modules +call, terraform with init parameter: + +```shell +$ terraform init -backend false + +Initializing the backend... +Initializing modules... + +Initializing provider plugins... +- Reusing previous version of hashicorp/kubernetes from the dependency lock file +- Reusing previous version of hashicorp/cloudinit from the dependency lock file +- Reusing previous version of hashicorp/aws from the dependency lock file +- Reusing previous version of hashicorp/time from the dependency lock file +- Reusing previous version of hashicorp/tls from the dependency lock file +- Using previously-installed hashicorp/tls v4.0.4 +- Using previously-installed hashicorp/kubernetes v2.23.0 +- Using previously-installed hashicorp/cloudinit v2.3.2 +- Using previously-installed hashicorp/aws v5.26.0 +- Using previously-installed hashicorp/time v0.9.1 + +Terraform has been successfully initialized! + +You may now begin working with Terraform. Try running "terraform plan" to see +any changes that are required for your infrastructure. All Terraform commands +should now work. + +If you ever set or change modules or backend configuration for Terraform, +rerun this command to reinitialize your working directory. If you forget, other +commands will detect it and remind you to do so if necessary. +``` + +If the message `Terraform has been successfully initialized!` appears, proceed to the next +step, verify the version of the hashicorp plugins. + +### Verify the planning + +Terraform allows you to verify the resources on `dry-run` style, so you can double-check and verify if all +resources are being created in the DAG and managed correctly + +```shell +terraform plan +``` + +### Creating the cluster + +The new infrastructure is created using apply, based on the plan generated the DAG indicated all the AWS +resources created by this module. It includes a EKS cluster with 2 node groups: + +1. Linux node group with 3 nodes `t3.medium` using Amazon Linux +2. Windows node group with 1 node `t3.large` using Windows 2022 Core + +Addons are being installed on this clusters by default, kube-proxy, coredns and vpc-cni (with Windows support) + +To start creating, apply your plan with: + +```shell +terraform apply +... +Apply complete! Resources: 67 added, 0 changed, 0 destroyed. +``` + +## Notes + +There's **NO** persistence of the state, so a local `terraform.tfstate` file is created, keep it locally to manage +your cluster while you are working with it. + +To export the KubeConfig file and create new context for the new created cluster: + +```shell +aws eks update-kubeconfig --region us-east-1 --name eks-windows +``` + +## Resources + +A few other resources can be consulted in case of doubts or slight modification: + +* [Official EKS Documentation](https://docs.aws.amazon.com/eks/latest/userguide/windows-support.html) +* [Running Windows Containers on AWS: A complete guide to successfully running Windows containers on Amazon ECS, EKS, and AWS Fargate](https://www.amazon.com/Running-Windows-Containers-AWS-successfully/dp/1804614130) \ No newline at end of file diff --git a/terraform/jumper/data.tf b/terraform/data.tf similarity index 57% rename from terraform/jumper/data.tf rename to terraform/data.tf index ab7fcaf..1ad367b 100644 --- a/terraform/jumper/data.tf +++ b/terraform/data.tf @@ -11,36 +11,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -data "aws_caller_identity" "current" {} - data "aws_availability_zones" "available" {} -data "aws_ami" "ubuntu_2204" { - - owners = ["099720109477"] - name_regex = "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-\\d+" - - most_recent = true - - filter { - name = "name" - values = ["ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*"] - } - - filter { - name = "architecture" - values = ["x86_64"] - } - - filter { - name = "root-device-type" - values = ["ebs"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } -} - - +data "aws_caller_identity" "current" {} diff --git a/terraform/jumper/.terraform.lock.hcl b/terraform/jumper/.terraform.lock.hcl deleted file mode 100644 index 4071059..0000000 --- a/terraform/jumper/.terraform.lock.hcl +++ /dev/null @@ -1,106 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/aws" { - version = "5.17.0" - constraints = ">= 3.72.0, >= 4.47.0, >= 4.57.0, >= 5.0.0, 5.17.0" - hashes = [ - "h1:U+EDfeUqefebA1h7KyBMD1xH0h311LMi7wijPDPkC/0=", - "h1:rplvK7UGP2FuzM44t2eRX+QYYPC0aUIoKdi5XayRI8M=", - "zh:0087b9dd2c9c638fd63e527e5b9b70988008e263d480a199f180efe5a4f070f0", - "zh:0fd532a4fd03ddef11f0502ff9fe4343443e1ae805cb088825a71d6d48906ec7", - "zh:16411e731100cd15f7e165f53c23be784b2c86c2fcfd34781e0642d17090d342", - "zh:251d520927e77f091e2ec6302e921d839a2430ac541c6a461aed7c08fb5eae12", - "zh:4919e69682dc2a8c32d44f6ebc038a52c9f40af9c61cb574b64e322800d6a794", - "zh:5334c60759d5f76bdc51355d1a3ebcc451d4d20f632f5c73b6e55c52b5dc9e52", - "zh:7341a2b7247572eba0d0486094a870b872967702ec0ac7af728c2df2c30af4e5", - "zh:81d1b1cb2cac6b3922a05adab69543b678f344a01debd54500263700dad7a288", - "zh:882bc8e15ef6d4020a07321ec4c056977c5c1d96934118032922561d29504d43", - "zh:8cd4871ef2b03fd916de1a6dc7eb8a81a354c421177d4334a2e3308e50215e41", - "zh:97e12fe6529b21298adf1046c5e20ac35d0569c836a6f385ff041e257e00cfd2", - "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:9f5baf5d59b9f3cf5504d1fa975f10f27da3791896a9e18ece47c258bac17634", - "zh:dffafba6731ac1db1c540bdbd6a8c878486b71de9d0ca1d23c5c00a6c3c14d80", - "zh:fa7440c3c15a42fc5731444d324ced75407d417bfe3184661ae47d40a9718dce", - ] -} - -provider "registry.terraform.io/hashicorp/cloudinit" { - version = "2.3.2" - constraints = ">= 2.0.0" - hashes = [ - "h1:Vl0aixAYTV/bjathX7VArC5TVNkxBCsi3Vq7R4z1uvc=", - "zh:2487e498736ed90f53de8f66fe2b8c05665b9f8ff1506f751c5ee227c7f457d1", - "zh:3d8627d142942336cf65eea6eb6403692f47e9072ff3fa11c3f774a3b93130b3", - "zh:434b643054aeafb5df28d5529b72acc20c6f5ded24decad73b98657af2b53f4f", - "zh:436aa6c2b07d82aa6a9dd746a3e3a627f72787c27c80552ceda6dc52d01f4b6f", - "zh:458274c5aabe65ef4dbd61d43ce759287788e35a2da004e796373f88edcaa422", - "zh:54bc70fa6fb7da33292ae4d9ceef5398d637c7373e729ed4fce59bd7b8d67372", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:893ba267e18749c1a956b69be569f0d7bc043a49c3a0eb4d0d09a8e8b2ca3136", - "zh:95493b7517bce116f75cdd4c63b7c82a9d0d48ec2ef2f5eb836d262ef96d0aa7", - "zh:9ae21ab393be52e3e84e5cce0ef20e690d21f6c10ade7d9d9d22b39851bfeddc", - "zh:cc3b01ac2472e6d59358d54d5e4945032efbc8008739a6d4946ca1b621a16040", - "zh:f23bfe9758f06a1ec10ea3a81c9deedf3a7b42963568997d84a5153f35c5839a", - ] -} - -provider "registry.terraform.io/hashicorp/kubernetes" { - version = "2.23.0" - constraints = ">= 2.10.0" - hashes = [ - "h1:xyFc77aYkPoU4Xt1i5t0B1IaS8TbTtp9aCSuQKDayII=", - "zh:10488a12525ed674359585f83e3ee5e74818b5c98e033798351678b21b2f7d89", - "zh:1102ba5ca1a595f880e67102bbf999cc8b60203272a078a5b1e896d173f3f34b", - "zh:1347cf958ed3f3f80b3c7b3e23ddda3d6c6573a81847a8ee92b7df231c238bf6", - "zh:2cb18e9f5156bc1b1ee6bc580a709f7c2737d142722948f4a6c3c8efe757fa8d", - "zh:5506aa6f28dcca2a265ccf8e34478b5ec2cb43b867fe6d93b0158f01590fdadd", - "zh:6217a20686b631b1dcb448ee4bc795747ebc61b56fbe97a1ad51f375ebb0d996", - "zh:8accf916c00579c22806cb771e8909b349ffb7eb29d9c5468d0a3f3166c7a84a", - "zh:9379b0b54a0fa030b19c7b9356708ec8489e194c3b5e978df2d31368563308e5", - "zh:aa99c580890691036c2931841e88e7ee80d59ae52289c8c2c28ea0ac23e31520", - "zh:c57376d169875990ac68664d227fb69cd0037b92d0eba6921d757c3fd1879080", - "zh:e6068e3f94f6943b5586557b73f109debe19d1a75ca9273a681d22d1ce066579", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} - -provider "registry.terraform.io/hashicorp/time" { - version = "0.9.1" - constraints = ">= 0.9.0" - hashes = [ - "h1:NUv/YtEytDQncBQ2mTxnUZEy/rmDlPYmE9h2iokR0vk=", - "zh:00a1476ecf18c735cc08e27bfa835c33f8ac8fa6fa746b01cd3bcbad8ca84f7f", - "zh:3007f8fc4a4f8614c43e8ef1d4b0c773a5de1dcac50e701d8abc9fdc8fcb6bf5", - "zh:5f79d0730fdec8cb148b277de3f00485eff3e9cf1ff47fb715b1c969e5bbd9d4", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:8c8094689a2bed4bb597d24a418bbbf846e15507f08be447d0a5acea67c2265a", - "zh:a6d9206e95d5681229429b406bc7a9ba4b2d9b67470bda7df88fa161508ace57", - "zh:aa299ec058f23ebe68976c7581017de50da6204883950de228ed9246f309e7f1", - "zh:b129f00f45fba1991db0aa954a6ba48d90f64a738629119bfb8e9a844b66e80b", - "zh:ef6cecf5f50cda971c1b215847938ced4cb4a30a18095509c068643b14030b00", - "zh:f1f46a4f6c65886d2dd27b66d92632232adc64f92145bf8403fe64d5ffa5caea", - "zh:f79d6155cda7d559c60d74883a24879a01c4d5f6fd7e8d1e3250f3cd215fb904", - "zh:fd59fa73074805c3575f08cd627eef7acda14ab6dac2c135a66e7a38d262201c", - ] -} - -provider "registry.terraform.io/hashicorp/tls" { - version = "4.0.4" - constraints = ">= 3.0.0" - hashes = [ - "h1:pe9vq86dZZKCm+8k1RhzARwENslF3SXb9ErHbQfgjXU=", - "zh:23671ed83e1fcf79745534841e10291bbf34046b27d6e68a5d0aab77206f4a55", - "zh:45292421211ffd9e8e3eb3655677700e3c5047f71d8f7650d2ce30242335f848", - "zh:59fedb519f4433c0fdb1d58b27c210b27415fddd0cd73c5312530b4309c088be", - "zh:5a8eec2409a9ff7cd0758a9d818c74bcba92a240e6c5e54b99df68fff312bbd5", - "zh:5e6a4b39f3171f53292ab88058a59e64825f2b842760a4869e64dc1dc093d1fe", - "zh:810547d0bf9311d21c81cc306126d3547e7bd3f194fc295836acf164b9f8424e", - "zh:824a5f3617624243bed0259d7dd37d76017097dc3193dac669be342b90b2ab48", - "zh:9361ccc7048be5dcbc2fafe2d8216939765b3160bd52734f7a9fd917a39ecbd8", - "zh:aa02ea625aaf672e649296bce7580f62d724268189fe9ad7c1b36bb0fa12fa60", - "zh:c71b4cd40d6ec7815dfeefd57d88bc592c0c42f5e5858dcc88245d371b4b8b1e", - "zh:dabcd52f36b43d250a3d71ad7abfa07b5622c69068d989e60b79b2bb4f220316", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} diff --git a/terraform/jumper/README.md b/terraform/jumper/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/terraform/jumper/main.tf b/terraform/jumper/main.tf deleted file mode 100644 index 259fa06..0000000 --- a/terraform/jumper/main.tf +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright 2023 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -module "vpc" { - source = "terraform-aws-modules/vpc/aws" - - name = "${local.name}-vpc" - cidr = local.vpc_cidr - - azs = local.azs - private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 4, k)] - public_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 4, k + 10)] - - create_database_subnet_group = false - manage_default_network_acl = false - manage_default_route_table = false - manage_default_security_group = false - - enable_nat_gateway = true - single_nat_gateway = false - one_nat_gateway_per_az = true - -} - -module "eks" { - source = "terraform-aws-modules/eks/aws" - version = "~> 19.0" - - cluster_name = "${local.name}-cluster" - cluster_version = "1.27" - cluster_endpoint_public_access = true - - vpc_id = module.vpc.vpc_id - subnet_ids = module.vpc.private_subnets - - iam_role_name = "${local.name}-role" - - eks_managed_node_groups = { - core_node_group = { - // just coredns so t3.large is big enough - instance_types = ["t3.large"] - - #ami_type = "BOTTLEROCKET_x86_64" - #platform = "bottlerocket" - - min_size = 1 - max_size = 2 - desired_size = 2 - } - } - self_managed_node_groups = { - one = { - instance_types = "t3.large" - min_size = 2 - max_size = 4 - desired_size = 2 - platform = "windows" - } - } - - - - -} - - diff --git a/terraform/locals.tf b/terraform/locals.tf new file mode 100644 index 0000000..f1d50a7 --- /dev/null +++ b/terraform/locals.tf @@ -0,0 +1,31 @@ +/* +Copyright 2023 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +locals { + cluster_version = "1.28" + + azs = slice(data.aws_availability_zones.available.names, 0, 3) + vpc_cidr = "10.0.0.0/16" + + linux_node_group = "linux-node-group" + linux_instance_type = "t3.medium" + windows_node_group = "windows-node-group" + windows_ami_type = "WINDOWS_CORE_2022_x86_64" + windows_instance_type = "t3.large" + + tags = { + Cluster = var.cluster_name + GithubRepo = "sigs.k8s.io" + GithubOrg = "windows-operational-readiness" + } +} diff --git a/terraform/main.tf b/terraform/main.tf new file mode 100644 index 0000000..bcd3c6e --- /dev/null +++ b/terraform/main.tf @@ -0,0 +1,166 @@ +/* +Copyright 2023 The Kubernetes Authors. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + + +################################################################################ +# IAM Permissions +################################################################################ + +resource "aws_iam_role_policy_attachment" "node_group_role_attach" { + for_each = toset([ + "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy", + "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly", + "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy", + "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore" + ]) + role = aws_iam_role.node_group_role.name + policy_arn = each.value +} + +resource "aws_iam_role" "node_group_role" { + name = "${local.linux_node_group}-role" + + assume_role_policy = jsonencode({ + Statement = [{ + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "ec2.amazonaws.com" + } + }] + Version = "2012-10-17" + }) +} + +################################################################################ +# Supporting resources and networking +################################################################################ + +module "vpc" { + source = "terraform-aws-modules/vpc/aws" + version = "~> 4.0" + + name = "${var.cluster_name}-vpc" + cidr = local.vpc_cidr + + azs = local.azs + private_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 4, k)] + public_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 8, k + 48)] + intra_subnets = [for k, v in local.azs : cidrsubnet(local.vpc_cidr, 8, k + 52)] + + enable_nat_gateway = true + single_nat_gateway = true + + public_subnet_tags = { + "kubernetes.io/role/elb" = 1 + } + + private_subnet_tags = { + "kubernetes.io/role/internal-elb" = 1 + } + + tags = local.tags +} + +################################################################################ +# EKS Cluster main configuration +################################################################################ + +module "eks" { + source = "terraform-aws-modules/eks/aws" + cluster_name = var.cluster_name + cluster_version = local.cluster_version + cluster_endpoint_public_access = true + + vpc_id = module.vpc.vpc_id + subnet_ids = module.vpc.private_subnets + control_plane_subnet_ids = module.vpc.intra_subnets + + cluster_addons = { + coredns = { + most_recent = true + } + kube-proxy = { + most_recent = true + } + vpc-cni = { + most_recent = true + configuration_values = jsonencode({ + enableWindowsIpam : "true" + }) + } + } + + tags = local.tags +} + +################################################################################ +# Mixed Node group configuration +################################################################################ + +resource "aws_eks_node_group" "node_group_windows" { + node_group_name = local.windows_node_group + node_role_arn = aws_iam_role.node_group_role.arn + + cluster_name = module.eks.cluster_name + subnet_ids = module.vpc.private_subnets + depends_on = [ + aws_iam_role_policy_attachment.node_group_role_attach + ] + + ami_type = local.windows_ami_type + instance_types = [local.windows_instance_type] + + scaling_config { + desired_size = 1 + max_size = 5 + min_size = 1 + } + + update_config { + max_unavailable = 2 + } + + tags = merge( + { "node-group" : "windows" }, + local.tags, + ) +} + +resource "aws_eks_node_group" "node_group_linux" { + node_group_name = local.linux_node_group + node_role_arn = aws_iam_role.node_group_role.arn + + cluster_name = module.eks.cluster_name + subnet_ids = module.vpc.private_subnets + depends_on = [ + aws_iam_role_policy_attachment.node_group_role_attach + ] + + instance_types = [local.linux_instance_type] + + scaling_config { + desired_size = 3 + max_size = 5 + min_size = 1 + } + + update_config { + max_unavailable = 2 + } + + tags = merge( + { "node-group" : "linux" }, + local.tags, + ) +} diff --git a/terraform/jumper/versions.tf b/terraform/provider.tf similarity index 81% rename from terraform/jumper/versions.tf rename to terraform/provider.tf index b31b468..0c62ac1 100644 --- a/terraform/jumper/versions.tf +++ b/terraform/provider.tf @@ -11,8 +11,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -terraform { - # Minimum version is 1.5.1, Maximum version is 1.5.4 - # Still use MSL licence - required_version = "~> 1.5.0" +provider "aws" { + region = var.aws_region } diff --git a/terraform/jumper/locals.tf b/terraform/terraform.tf similarity index 77% rename from terraform/jumper/locals.tf rename to terraform/terraform.tf index e1d401a..693b653 100644 --- a/terraform/jumper/locals.tf +++ b/terraform/terraform.tf @@ -11,11 +11,12 @@ See the License for the specific language governing permissions and limitations under the License. */ -locals { - name = "${basename(path.cwd)}" - region = "eu-east-2" - - vpc_cidr = "10.0.0.0/16" - azs = slice(data.aws_availability_zones.available.names, 0, 3) +terraform { + required_version = ">= 1.1.0" + required_providers { + aws = { + source = "hashicorp/aws" + version = "~> 5.26.0" + } + } } - diff --git a/terraform/jumper/provider.tf b/terraform/variables.tf similarity index 58% rename from terraform/jumper/provider.tf rename to terraform/variables.tf index 565d321..fc6868c 100644 --- a/terraform/jumper/provider.tf +++ b/terraform/variables.tf @@ -1,5 +1,5 @@ /* -Copyright 2022 The Kubernetes Authors. +Copyright 2023 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -11,24 +11,14 @@ See the License for the specific language governing permissions and limitations under the License. */ -terraform { - required_providers { - aws = { - source = "hashicorp/aws" - version = "5.17.0" - } - } - - backend "s3" { - bucket = "win-operational-readiness-tf-state" - // profile = "windows-readiness" - key = "aws-jumper" - region = "us-east-2" - } +variable "cluster_name" { + type = string + default = "eks-windows" + description = "EKS Cluster name" } - -provider "aws" { - // profile = "windows-readiness" - region = "us-east-2" +variable "aws_region" { + type = string + default = "us-east-1" + description = "EKS AWS Region" }