-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e762208
commit f9f0137
Showing
12 changed files
with
165 additions
and
118 deletions.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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,118 @@ | ||
variable "AWS_REGION" { | ||
type = string | ||
} | ||
|
||
variable "AMIS" { | ||
type = map(string) | ||
default = { | ||
us-east-1 = "ami-0ae74ae9c43584639" | ||
us-west-2 = "ami-09f5b7791a4e85729" | ||
eu-west-1 = "ami-081ff4b9aa4e81a08" # ami-0da36f7f059b7086e | ||
} | ||
} | ||
|
||
variable "PATH_TO_PUBLIC_KEY" { | ||
type = string | ||
default = "~/.ssh/id_rsa.pub" | ||
description = "Path to your public key" | ||
} | ||
|
||
variable "PATH_TO_PRIVATE_KEY" { | ||
type = string | ||
default = "~/.ssh/id_rsa" | ||
description = "Path to your private key" | ||
} | ||
|
||
variable "vpc_id" { | ||
type = string | ||
description = "The vpc id" | ||
} | ||
|
||
variable "instance_profile_name" { | ||
type = string | ||
description = "The name of the instance profile to use" | ||
} | ||
|
||
variable "my_public_ip_cidr" { | ||
type = string | ||
description = "My public ip CIDR" | ||
} | ||
|
||
variable "vpc_subnet_cidr" { | ||
type = string | ||
description = "VPC subnet CIDR" | ||
} | ||
|
||
variable "vpc_subnets" { | ||
type = list(any) | ||
description = "The vpc subnets ids" | ||
} | ||
|
||
variable "default_instance_type" { | ||
type = string | ||
default = "t3.large" | ||
description = "Instance type to be used" | ||
} | ||
|
||
variable "instance_types" { | ||
description = "List of instance types to use" | ||
type = map(string) | ||
default = { | ||
asg_instance_type_1 = "t3.large" | ||
asg_instance_type_3 = "m4.large" | ||
asg_instance_type_4 = "t3a.large" | ||
} | ||
} | ||
|
||
variable "kube_api_port" { | ||
type = number | ||
default = 6443 | ||
description = "Kubeapi Port" | ||
} | ||
|
||
variable "k3s_server_desired_capacity" { | ||
type = number | ||
default = 3 | ||
description = "K3s server ASG desired capacity" | ||
} | ||
|
||
variable "k3s_server_min_capacity" { | ||
type = number | ||
default = 3 | ||
description = "K3s server ASG min capacity" | ||
} | ||
|
||
variable "k3s_server_max_capacity" { | ||
type = number | ||
default = 4 | ||
description = "K3s server ASG max capacity" | ||
} | ||
|
||
variable "k3s_worker_desired_capacity" { | ||
type = number | ||
default = 3 | ||
description = "K3s server ASG desired capacity" | ||
} | ||
|
||
variable "k3s_worker_min_capacity" { | ||
type = number | ||
default = 3 | ||
description = "K3s server ASG min capacity" | ||
} | ||
|
||
variable "k3s_worker_max_capacity" { | ||
type = number | ||
default = 4 | ||
description = "K3s server ASG max capacity" | ||
} | ||
|
||
variable "cluster_name" { | ||
type = string | ||
default = "k3s-cluster" | ||
description = "Cluster name" | ||
} | ||
|
||
variable "k3s_token" { | ||
type = string | ||
description = "Override to set k3s cluster registration token" | ||
} |
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,25 @@ | ||
variable "AWS_ACCESS_KEY" { | ||
|
||
} | ||
|
||
variable "AWS_SECRET_KEY" { | ||
|
||
} | ||
|
||
variable "AWS_REGION" { | ||
type = string | ||
default = "<change_me>" | ||
description = "AWS Zone" | ||
} | ||
|
||
module "k3s_cluster" { | ||
AWS_REGION = "<change_me>" | ||
instance_profile_name = "AmazonEC2ReadOnlyAccess" | ||
my_public_ip_cidr = "<change_me>" | ||
vpc_id = "<change_me>" | ||
vpc_subnets = ["<change_me>", "<change_me>", "<change_me>"] | ||
vpc_subnet_cidr = "<change_me>" | ||
cluster_name = "k3s-cluster" | ||
k3s_token = "<change_me>" | ||
source = "./k3s_cluster/" | ||
} |