Skip to content

Commit

Permalink
Merge pull request #10 from boozallen/master
Browse files Browse the repository at this point in the history
Update main
  • Loading branch information
gosim-bah authored Jul 11, 2023
2 parents 5f38427 + 42821d7 commit b72e5c0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# default codeowners/project maintainers
* @steven-terrana-bah @gosim-bah
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ module "servers" {
name = "${local.uname}-server"

vpc_id = var.vpc_id
subnets = var.subnets
subnets = var.control_plane_subnets
ami = var.ami
instance_type = var.instance_type
block_device_mappings = var.block_device_mappings
Expand Down
1 change: 1 addition & 0 deletions modules/agent-nodepool/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ module "nodepool" {

vpc_id = var.vpc_id
subnets = var.subnets
target_group_arns = var.target_group_arns
ami = var.ami
instance_type = var.instance_type
block_device_mappings = var.block_device_mappings
Expand Down
5 changes: 5 additions & 0 deletions modules/agent-nodepool/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,8 @@ variable "associate_public_ip_address" {
type = bool
default = false
}

variable "target_group_arns" {
type = list(string)
default = []
}
12 changes: 11 additions & 1 deletion modules/userdata/files/rke2-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,18 @@ upload() {

if [ $CCM = "true" ]; then
if [ $CCM_EXTERNAL = "true" ]; then
append_config 'cloud-provider-name: "external"'
TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
AZ=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/placement/availability-zone)
IID=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/instance-id)
NAME=$(curl -H "X-aws-ec2-metadata-token: $TOKEN" http://169.254.169.254/latest/meta-data/local-hostname)
append_config 'disable-cloud-controller: "true"'
append_config 'kubelet-arg:'
append_config ' - cloud-provider=external'
append_config " - provider-id=aws:///$AZ/$IID"
append_config 'kube-apiserver-arg: cloud-provider=external'
append_config 'kube-controller-manager-arg: cloud-provider=external'
append_config "node-name: $NAME"
append_config 'write-kubeconfig-mode: "0644"'
else
append_config 'cloud-provider-name: "aws"'
fi
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ variable "subnets" {
type = list(string)
}

variable "control_plane_subnets" {
description = "List of subnets to place the control plane nodes in"
type = list(string)
}

variable "tags" {
description = "Map of tags to add to all resources created"
default = {}
Expand Down

0 comments on commit b72e5c0

Please sign in to comment.