This repository has been archived by the owner on Mar 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
add the AmazonEKS template function to the amazon_eks and kubectl_apply docs #422
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e86bd14
add the AmazonEKS template function to the amazon_eks and kubectl_app…
laverya 6417ef7
update amazon_eks extended description
laverya f99c2a9
add integration test for AmazonEKS template function
laverya 308ad54
Merge branch 'master' into update-amazon_eks-docs
laverya dfee36d
moved amazon-eks-template integration test to init_app suite
laverya b9598cd
Merge branch 'update-amazon_eks-docs' of github.com:laverya/ship into…
laverya 0e82cb6
Merge branch 'master' into update-amazon_eks-docs
laverya 8e08f43
fix parallel init_app integration tests
laverya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
integration/base/amazon-eks-template/expected/.ship/release.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
assets: | ||
v1: | ||
- amazon_eks: | ||
dest: new/new_vpc.tf | ||
cluster_name: new-vpc-cluster | ||
region: "us-west-2" | ||
created_vpc: | ||
vpc_cidr: "10.0.0.0/16" | ||
zones: | ||
- us-west-2a | ||
- us-west-2b | ||
public_subnets: | ||
- "10.0.1.0/24" | ||
- "10.0.2.0/24" | ||
private_subnets: | ||
- "10.0.129.0/24" | ||
- "10.0.130.0/24" | ||
autoscaling_groups: | ||
- name: alpha | ||
group_size: 3 | ||
machine_type: m5.2xlarge | ||
- name: bravo | ||
group_size: 1 | ||
machine_type: m5.4xlarge | ||
- inline: | ||
dest: install.sh | ||
contents: | | ||
#!/bin/bash | ||
echo "run:" | ||
echo "terraform apply -f new/new_vpc.tf" | ||
echo "kubectl apply -f kube.yaml --kubeconfig {{repl AmazonEKS "new-vpc-cluster" }}" | ||
mode: 0777 | ||
- inline: | ||
dest: kube.yaml | ||
contents: | | ||
this is not a valid kubernetes yaml | ||
mode: 0777 | ||
|
||
config: {} | ||
|
||
lifecycle: | ||
v1: | ||
- message: | ||
contents: "hi" | ||
- render: {} | ||
- message: | ||
contents: "bye" |
5 changes: 5 additions & 0 deletions
5
integration/base/amazon-eks-template/expected/.ship/state.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"v1": { | ||
"config": {} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
integration/base/amazon-eks-template/expected/installer/install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
echo "run:" | ||
echo "terraform apply -f new/new_vpc.tf" | ||
echo "kubectl apply -f kube.yaml --kubeconfig new/kubeconfig_new-vpc-cluster" |
1 change: 1 addition & 0 deletions
1
integration/base/amazon-eks-template/expected/installer/kube.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this is not a valid kubernetes yaml |
100 changes: 100 additions & 0 deletions
100
integration/base/amazon-eks-template/expected/installer/new/new_vpc.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
|
||
variable "vpc_cidr" { | ||
type = "string" | ||
default = "10.0.0.0/16" | ||
} | ||
|
||
variable "vpc_public_subnets" { | ||
default = [ | ||
"10.0.1.0/24", | ||
"10.0.2.0/24", | ||
] | ||
} | ||
|
||
variable "vpc_private_subnets" { | ||
default = [ | ||
"10.0.129.0/24", | ||
"10.0.130.0/24", | ||
] | ||
} | ||
|
||
variable "vpc_azs" { | ||
default = [ | ||
"us-west-2a", | ||
"us-west-2b", | ||
] | ||
} | ||
|
||
module "vpc" { | ||
source = "terraform-aws-modules/vpc/aws" | ||
version = "1.37.0" | ||
name = "eks-vpc" | ||
cidr = "${var.vpc_cidr}" | ||
azs = "${var.vpc_azs}" | ||
|
||
private_subnets = "${var.vpc_private_subnets}" | ||
public_subnets = "${var.vpc_public_subnets}" | ||
|
||
map_public_ip_on_launch = true | ||
enable_nat_gateway = true | ||
single_nat_gateway = true | ||
|
||
tags = "${map("kubernetes.io/cluster/${var.eks-cluster-name}", "shared")}" | ||
} | ||
|
||
locals { | ||
"eks_vpc" = "${module.vpc.vpc_id}" | ||
"eks_vpc_public_subnets" = "${module.vpc.public_subnets}" | ||
"eks_vpc_private_subnets" = "${module.vpc.private_subnets}" | ||
} | ||
|
||
locals { | ||
"worker_group_count" = "2" | ||
} | ||
|
||
locals { | ||
"worker_groups" = [ | ||
{ | ||
name = "alpha" | ||
asg_min_size = "3" | ||
asg_max_size = "3" | ||
asg_desired_capacity = "3" | ||
instance_type = "m5.2xlarge" | ||
|
||
subnets = "${join(",", local.eks_vpc_private_subnets)}" | ||
}, | ||
{ | ||
name = "bravo" | ||
asg_min_size = "1" | ||
asg_max_size = "1" | ||
asg_desired_capacity = "1" | ||
instance_type = "m5.4xlarge" | ||
|
||
subnets = "${join(",", local.eks_vpc_private_subnets)}" | ||
}, | ||
] | ||
} | ||
|
||
provider "aws" { | ||
version = "~> 1.27" | ||
region = "us-west-2" | ||
} | ||
|
||
variable "eks-cluster-name" { | ||
default = "new-vpc-cluster" | ||
type = "string" | ||
} | ||
|
||
module "eks" { | ||
source = "terraform-aws-modules/eks/aws" | ||
version = "1.4.0" | ||
|
||
cluster_name = "${var.eks-cluster-name}" | ||
|
||
subnets = ["${local.eks_vpc_private_subnets}", "${local.eks_vpc_public_subnets}"] | ||
|
||
vpc_id = "${local.eks_vpc}" | ||
|
||
worker_group_count = "${local.worker_group_count}" | ||
worker_groups = "${local.worker_groups}" | ||
} |
47 changes: 47 additions & 0 deletions
47
integration/base/amazon-eks-template/input/.ship/release.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
assets: | ||
v1: | ||
- amazon_eks: | ||
dest: new/new_vpc.tf | ||
cluster_name: new-vpc-cluster | ||
region: "us-west-2" | ||
created_vpc: | ||
vpc_cidr: "10.0.0.0/16" | ||
zones: | ||
- us-west-2a | ||
- us-west-2b | ||
public_subnets: | ||
- "10.0.1.0/24" | ||
- "10.0.2.0/24" | ||
private_subnets: | ||
- "10.0.129.0/24" | ||
- "10.0.130.0/24" | ||
autoscaling_groups: | ||
- name: alpha | ||
group_size: 3 | ||
machine_type: m5.2xlarge | ||
- name: bravo | ||
group_size: 1 | ||
machine_type: m5.4xlarge | ||
- inline: | ||
dest: install.sh | ||
contents: | | ||
#!/bin/bash | ||
echo "run:" | ||
echo "terraform apply -f new/new_vpc.tf" | ||
echo "kubectl apply -f kube.yaml --kubeconfig {{repl AmazonEKS "new-vpc-cluster" }}" | ||
mode: 0777 | ||
- inline: | ||
dest: kube.yaml | ||
contents: | | ||
this is not a valid kubernetes yaml | ||
mode: 0777 | ||
|
||
config: {} | ||
|
||
lifecycle: | ||
v1: | ||
- message: | ||
contents: "hi" | ||
- render: {} | ||
- message: | ||
contents: "bye" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"v1":{"config":{}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
customer_id: "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G" | ||
installation_id: "Jn0nK8OlT3k9AYqpnq6SGqzo_srKjzjQ" | ||
release_version: "0.0.1-b" | ||
|
||
disable_online: true | ||
skip_cleanup: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should consider adding new tests to init_app instead of
base
, since init_app auto-creates the release in the staging envThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point, I'll move it