|
|
|
@ -11,20 +11,33 @@ locals {
|
|
|
|
]
|
|
|
|
]
|
|
|
|
aws-security-group-id = module.aws-network-existing.default-sg.id
|
|
|
|
aws-security-group-id = module.aws-network-existing.default-sg.id
|
|
|
|
# aws-security-group-id = module.aws-network-from-scratch.default-security-group.id
|
|
|
|
# aws-security-group-id = module.aws-network-from-scratch.default-security-group.id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# The names of these nodes is created by:
|
|
|
|
|
|
|
|
# "{var.vm-name-prefix}-{name from nodes-config}-{number}"
|
|
|
|
|
|
|
|
# The length of this full name must be < 16 characters. This is a limitaion of
|
|
|
|
|
|
|
|
# Active Directory? The "realm join" command failed when the name was too
|
|
|
|
|
|
|
|
# long, although it did not give the reason for the failure, the reason was
|
|
|
|
|
|
|
|
# surmised because it looked like it was truncating the name when attempting
|
|
|
|
|
|
|
|
# to join.
|
|
|
|
nodes-config = {
|
|
|
|
nodes-config = {
|
|
|
|
|
|
|
|
# TODO if the above comment about the name length is true, then this name is
|
|
|
|
|
|
|
|
# too long. IMPORTANT! If you change this then you need to change the k8s
|
|
|
|
|
|
|
|
# ansible role that assigns roles based on wether or not 'master' is in the
|
|
|
|
|
|
|
|
# name.
|
|
|
|
"k8s-master" = {
|
|
|
|
"k8s-master" = {
|
|
|
|
base-image = var.ubuntu-ami
|
|
|
|
base-image = var.ubuntu-ami
|
|
|
|
aws-ec2-type = var.t2-medium-4gib-2vcpu
|
|
|
|
aws-ec2-type = var.t2-medium-4gib-2vcpu
|
|
|
|
subnet-ids = local.k8s-subnets-ids
|
|
|
|
subnet-ids = local.k8s-subnets-ids
|
|
|
|
num = 0
|
|
|
|
num = 1
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"k8s-worker" = {
|
|
|
|
"k8s-wrkr" = {
|
|
|
|
base-image = var.ubuntu-ami
|
|
|
|
base-image = var.ubuntu-ami
|
|
|
|
aws-ec2-type = var.t2-medium-4gib-2vcpu
|
|
|
|
aws-ec2-type = var.t2-medium-4gib-2vcpu
|
|
|
|
subnet-ids = local.k8s-subnets-ids
|
|
|
|
subnet-ids = local.k8s-subnets-ids
|
|
|
|
num = 0
|
|
|
|
disk-size = 20
|
|
|
|
|
|
|
|
num = 2
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"ansible-test" = {
|
|
|
|
"test" = {
|
|
|
|
base-image = var.ubuntu-ami
|
|
|
|
base-image = var.ubuntu-ami
|
|
|
|
aws-ec2-type = var.t2-micro-1gib-1vcpu
|
|
|
|
aws-ec2-type = var.t2-micro-1gib-1vcpu
|
|
|
|
# subnet-ids = [module.aws-network-from-scratch.subnet.id]
|
|
|
|
# subnet-ids = [module.aws-network-from-scratch.subnet.id]
|
|
|
|
@ -38,7 +51,7 @@ locals {
|
|
|
|
subnet-ids = [module.aws-network-existing.subnet-by-name["subnet_4"].id]
|
|
|
|
subnet-ids = [module.aws-network-existing.subnet-by-name["subnet_4"].id]
|
|
|
|
num = 1
|
|
|
|
num = 1
|
|
|
|
num-disks = 1
|
|
|
|
num-disks = 1
|
|
|
|
disk-size = 10
|
|
|
|
zfs-disk-size = 10
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"proxy" = {
|
|
|
|
"proxy" = {
|
|
|
|
base-image = var.ubuntu-ami
|
|
|
|
base-image = var.ubuntu-ami
|
|
|
|
@ -119,7 +132,7 @@ resource "aws_key_pair" "key" {
|
|
|
|
resource "aws_ebs_volume" "zfs" {
|
|
|
|
resource "aws_ebs_volume" "zfs" {
|
|
|
|
# TODO REM look at types.
|
|
|
|
# TODO REM look at types.
|
|
|
|
availability_zone = local.nfs-subnets[0].availability_zone
|
|
|
|
availability_zone = local.nfs-subnets[0].availability_zone
|
|
|
|
size = local.nodes-config["nfs"].disk-size
|
|
|
|
size = local.nodes-config["nfs"].zfs-disk-size
|
|
|
|
encrypted = true
|
|
|
|
encrypted = true
|
|
|
|
count = local.nodes-config["nfs"].num-disks
|
|
|
|
count = local.nodes-config["nfs"].num-disks
|
|
|
|
tags = {
|
|
|
|
tags = {
|
|
|
|
@ -147,12 +160,27 @@ module "nodes" {
|
|
|
|
private-ips = try(each.value.private-ips, [])
|
|
|
|
private-ips = try(each.value.private-ips, [])
|
|
|
|
security-group-ids = [local.aws-security-group-id]
|
|
|
|
security-group-ids = [local.aws-security-group-id]
|
|
|
|
user-datas = lookup(module.cloud-init-config, each.key, null).user-datas
|
|
|
|
user-datas = lookup(module.cloud-init-config, each.key, null).user-datas
|
|
|
|
|
|
|
|
disk-size = try(each.value.disk-size, null)
|
|
|
|
num-nodes = each.value.num
|
|
|
|
num-nodes = each.value.num
|
|
|
|
name-prefix = "${var.vm-name-prefix}-${each.key}"
|
|
|
|
name-prefix = "${var.vm-name-prefix}-${each.key}"
|
|
|
|
# TODO add a input for the key so that it will show up as the key in the aws
|
|
|
|
# TODO add a input for the key so that it will show up as the key in the aws
|
|
|
|
# console.
|
|
|
|
# console.
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# TODO an attempt to create a windows machine.
|
|
|
|
|
|
|
|
# module "nodes-win" {
|
|
|
|
|
|
|
|
# source = "./modules/aws-nodes"
|
|
|
|
|
|
|
|
# ec2-instance-type = var.t2-small-2gib-1vcpu
|
|
|
|
|
|
|
|
# ami = var.win-srv-2019-ami
|
|
|
|
|
|
|
|
# subnet-ids = [module.aws-network-existing.subnet-by-name["subnet_2"].id]
|
|
|
|
|
|
|
|
# private-ips = []
|
|
|
|
|
|
|
|
# security-group-ids = [local.aws-security-group-id]
|
|
|
|
|
|
|
|
# # TODO REM need to figure out how to not pass a user data.
|
|
|
|
|
|
|
|
# user-datas = [null]
|
|
|
|
|
|
|
|
# num-nodes = 1
|
|
|
|
|
|
|
|
# name-prefix = "${var.vm-name-prefix}-win-test"
|
|
|
|
|
|
|
|
# }
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
################################################################################
|
|
|
|
# end aws
|
|
|
|
# end aws
|
|
|
|
################################################################################
|
|
|
|
################################################################################
|
|
|
|
|