Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Smart Columbus OS deployment #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Retrieve AWS credentials from env variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
provider "aws" {
region = "${var.aws_region}"
profile = "${var.aws_profile}"
}

#####
Expand Down Expand Up @@ -392,6 +393,6 @@ resource "aws_route53_record" "master" {
zone_id = "${data.aws_route53_zone.dns_zone.zone_id}"
name = "${var.cluster_name}.${var.hosted_zone}"
type = "A"
records = ["${aws_eip.master.public_ip}"]
records = ["${aws_instance.master.private_ip}"]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This DNS record is actually supposed to be used for accessing the cluster from the outside (using kubectl from your PC etc.). So this breaks this. Moreover, it leaves Elastic IP address unused.

What I think you should do is to revert this change and either:

  • Create a different hostname (e.g. something like internal.${var.cluster_name}.${var.hosted_zone})
  • Use the new hostname to link with the nodes
    or maybe be much easier and still fully sufficient:
  • Use the internal DNS record / private IP in the init_node template

That should keep the DNS record work as it worked before but also make sure that the cluster links through the private IP addresses which I agree should be much better ... even for people who have the public IP.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds a lot cleaner than this. Let me see what i can do

ttl = 300
}
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ output "public_ip" {
value = "${aws_eip.master.public_ip}"
}

output "private_ip" {
description = "Cluster private IP address"
value = "${aws_instance.master.private_ip}"
}

output "dns" {
description = "Cluster DNS address"
value = "${aws_route53_record.master.fqdn}"
Expand Down
7 changes: 6 additions & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ variable "aws_region" {
default = "eu-central-1"
}

variable "aws_profile" {
description = "AWS credentials profile to use"
default = "default"
}

variable "cluster_name" {
description = "Name of the AWS Kubernetes cluster - will be used to name all created resources"
}
Expand Down Expand Up @@ -77,4 +82,4 @@ variable api_access_cidr {
default = [
"0.0.0.0/0"
]
}
}