mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-04-01 06:53:06 +02:00
added config files to local test space on converge
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,3 +7,5 @@
|
|||||||
.kitchen.local.yml
|
.kitchen.local.yml
|
||||||
Gemfile.lock
|
Gemfile.lock
|
||||||
terraform.tfstate.d/
|
terraform.tfstate.d/
|
||||||
|
config
|
||||||
|
config-map-aws-auth.yaml
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ script:
|
|||||||
- echo 'script'
|
- echo 'script'
|
||||||
- terraform init
|
- terraform init
|
||||||
- terraform fmt -check=true
|
- terraform fmt -check=true
|
||||||
- terraform validate -var "region=${AWS_REGION}" -var "subnets=[]" -var "workers_ami_id=ami-123456" -var "cluster_ingress_cidrs=[]" -var "cluster_name=test_cluster"
|
- terraform validate -var "region=${AWS_REGION}" -var "vpc_id=vpc-123456" -var "subnets=[]" -var "workers_ami_id=ami-123456" -var "cluster_ingress_cidrs=[]" -var "cluster_name=test_cluster"
|
||||||
- docker run --rm -v $(pwd):/app/ --workdir=/app/ -t wata727/tflint --error-with-issues
|
- docker run --rm -v $(pwd):/app/ --workdir=/app/ -t wata727/tflint --error-with-issues
|
||||||
- cd examples/eks_test_fixture
|
- cd examples/eks_test_fixture
|
||||||
- terraform init
|
- terraform init
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ A terraform module to create a managed Kubernetes cluster on AWS EKS. Available
|
|||||||
through the [Terraform registry](https://registry.terraform.io/modules/terraform-aws-modules/eks/aws).
|
through the [Terraform registry](https://registry.terraform.io/modules/terraform-aws-modules/eks/aws).
|
||||||
Inspired by and adapted from [this doc](https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html)
|
Inspired by and adapted from [this doc](https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html)
|
||||||
and its [source code](https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started).
|
and its [source code](https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started).
|
||||||
|
Instructions on [this post](https://aws.amazon.com/blogs/aws/amazon-eks-now-generally-available/)
|
||||||
|
can help guide you through connecting to the cluster via `kubectl`.
|
||||||
|
|
||||||
| Branch | Build status |
|
| Branch | Build status |
|
||||||
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
@@ -104,5 +106,5 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
|
|||||||
| cluster_id | The name/id of the cluster. |
|
| cluster_id | The name/id of the cluster. |
|
||||||
| cluster_security_group_ids | description |
|
| cluster_security_group_ids | description |
|
||||||
| cluster_version | The Kubernetes server version for the cluster. |
|
| cluster_version | The Kubernetes server version for the cluster. |
|
||||||
| config_map_aws_auth | |
|
| config_map_aws_auth | A kubernetes configuration to authenticate to this cluster. |
|
||||||
| kubeconfig | kubectl config file contents for this cluster. |
|
| kubeconfig | kubectl config file contents for this cluster. |
|
||||||
|
|||||||
@@ -45,14 +45,24 @@ resource "random_string" "suffix" {
|
|||||||
special = false
|
special = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "local_file" "config" {
|
||||||
|
content = "${module.eks.kubeconfig}"
|
||||||
|
filename = "${path.module}/config"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "local_file" "config-map-aws-auth" {
|
||||||
|
content = "${module.eks.config_map_aws_auth}"
|
||||||
|
filename = "${path.module}/config-map-aws-auth.yaml"
|
||||||
|
}
|
||||||
|
|
||||||
module "vpc" {
|
module "vpc" {
|
||||||
source = "terraform-aws-modules/vpc/aws"
|
source = "terraform-aws-modules/vpc/aws"
|
||||||
version = "1.14.0"
|
version = "1.14.0"
|
||||||
name = "test-vpc"
|
name = "test-vpc"
|
||||||
cidr = "10.0.0.0/16"
|
cidr = "10.0.0.0/16"
|
||||||
azs = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}"]
|
azs = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}", "${data.aws_availability_zones.available.names[2]}"]
|
||||||
private_subnets = ["10.0.1.0/24", "10.0.2.0/24"]
|
private_subnets = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
|
||||||
public_subnets = ["10.0.3.0/24", "10.0.4.0/24"]
|
public_subnets = ["10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24"]
|
||||||
enable_nat_gateway = true
|
enable_nat_gateway = true
|
||||||
single_nat_gateway = true
|
single_nat_gateway = true
|
||||||
tags = "${merge(local.tags, map("kubernetes.io/cluster/${local.cluster_name}", "shared"))}"
|
tags = "${merge(local.tags, map("kubernetes.io/cluster/${local.cluster_name}", "shared"))}"
|
||||||
|
|||||||
2
main.tf
2
main.tf
@@ -5,6 +5,8 @@
|
|||||||
* through the [Terraform registry](https://registry.terraform.io/modules/terraform-aws-modules/eks/aws).
|
* through the [Terraform registry](https://registry.terraform.io/modules/terraform-aws-modules/eks/aws).
|
||||||
* Inspired by and adapted from [this doc](https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html)
|
* Inspired by and adapted from [this doc](https://www.terraform.io/docs/providers/aws/guides/eks-getting-started.html)
|
||||||
* and its [source code](https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started).
|
* and its [source code](https://github.com/terraform-providers/terraform-provider-aws/tree/master/examples/eks-getting-started).
|
||||||
|
* Instructions on [this post](https://aws.amazon.com/blogs/aws/amazon-eks-now-generally-available/)
|
||||||
|
* can help guide you through connecting to the cluster via `kubectl`.
|
||||||
|
|
||||||
* | Branch | Build status |
|
* | Branch | Build status |
|
||||||
* | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
* | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
output "config_map_aws_auth" {
|
output "config_map_aws_auth" {
|
||||||
description = ""
|
description = "A kubernetes configuration to authenticate to this cluster."
|
||||||
value = "${local.config_map_aws_auth}"
|
value = "${local.config_map_aws_auth}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user