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

Ignition and Security Group Modifiction #17

Merged
merged 3 commits into from
Aug 22, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
12 changes: 3 additions & 9 deletions aws/elastikube/etcd.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,14 @@ module "etcd" {
etcd_config = "${var.etcd_config}"

subnet_ids = ["${var.subnet_ids}"]
master_security_group_id = "${aws_security_group.master.id}"
master_security_group_id = "${module.master.master_sg_id}"
zone_id = "${aws_route53_zone.private.zone_id}"
s3_bucket = "${aws_s3_bucket.ignition.id}"
reboot_strategy = "${var.reboot_strategy}"

extra_ignition_file_ids = [
"${module.ignition_locksmithd.files}",
"${var.extra_etcd_ignition_file_ids}",
]
extra_ignition_file_ids = "${var.extra_etcd_ignition_file_ids}"

extra_ignition_systemd_unit_ids = [
"${module.ignition_locksmithd.systemd_units}",
"${var.extra_etcd_ignition_systemd_unit_ids}",
]
extra_ignition_systemd_unit_ids = "${var.extra_etcd_ignition_systemd_unit_ids}"

extra_tags = "${var.extra_tags}"
}
11 changes: 3 additions & 8 deletions aws/elastikube/master.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ module "master" {
role_name = "${var.role_name}"

security_group_ids = [
"${aws_security_group.master.id}",
"${var.security_group_ids}",
"${var.security_group_ids}"
]

lb_security_group_ids = ["${var.lb_security_group_ids}"]
Expand Down Expand Up @@ -49,19 +48,15 @@ module "master" {
"${module.ignition_kube_addon_dns.files}",
"${module.ignition_kube_addon_proxy.files}",
"${module.ignition_kube_addon_flannel_vxlan.files}",
"${module.ignition_node_exporter.files}",
"${module.ignition_locksmithd.files}",
"${var.extra_ignition_file_ids}",
"${var.extra_ignition_file_ids}"
]

extra_ignition_systemd_unit_ids = [
"${module.ignition_kube_addon_manager.systemd_units}",
"${module.ignition_kube_addon_dns.systemd_units}",
"${module.ignition_kube_addon_proxy.systemd_units}",
"${module.ignition_kube_addon_flannel_vxlan.systemd_units}",
"${module.ignition_node_exporter.systemd_units}",
"${module.ignition_locksmithd.systemd_units}",
"${var.extra_ignition_systemd_unit_ids}",
"${var.extra_ignition_systemd_unit_ids}"
]

extra_tags = "${var.extra_tags}"
Expand Down
4 changes: 4 additions & 0 deletions aws/elastikube/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ output "s3_bucket" {
value = "${aws_s3_bucket.ignition.id}"
}

output "master_sg_ids" {
value = ["${module.master.master_sg_id}"]
}

output "worker_sg_ids" {
value = ["${aws_security_group.workers.id}"]
}
9 changes: 0 additions & 9 deletions aws/elastikube/sg.tf

This file was deleted.

2 changes: 1 addition & 1 deletion aws/elastikube/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ variable "hostzone" {

variable "reboot_strategy" {
type = "string"
default = "etcd-lock"
default = "off"
description = "(Optional) CoreOS reboot strategies on updates, two option here: etcd-lock or off"
}

Expand Down
4 changes: 2 additions & 2 deletions aws/elastikube/worker-sg.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "aws_security_group_rule" "workers_ingress_cluster" {
type = "ingress"
description = "Allow workers Kubelets and pods to receive communication from the cluster control plane."
security_group_id = "${aws_security_group.workers.id}"
source_security_group_id = "${aws_security_group.master.id}"
source_security_group_id = "${module.master.master_sg_id}"

protocol = "tcp"
from_port = 1025
Expand Down Expand Up @@ -68,7 +68,7 @@ resource "aws_security_group_rule" "worker_ingress_flannel_from_master" {
description = "Allow access from other master flannel."
type = "ingress"
security_group_id = "${aws_security_group.workers.id}"
source_security_group_id = "${aws_security_group.master.id}"
source_security_group_id = "${module.master.master_sg_id}"

protocol = "udp"
from_port = 4789
Expand Down
12 changes: 1 addition & 11 deletions aws/kube-etcd/ign-node-exporter.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@ locals {
node_exporter_port = 9100
}

resource "aws_security_group_rule" "ingress_node_exporter" {
type = "ingress"
security_group_id = "${aws_security_group.etcd.id}"

protocol = "udp"
from_port = "${local.node_exporter_port}"
to_port = "${local.node_exporter_port}"
self = true
}

resource "aws_security_group_rule" "ingress_node_exporter_from_worker" {
type = "ingress"
security_group_id = "${aws_security_group.etcd.id}"

protocol = "udp"
protocol = "tcp"
cidr_blocks = ["${data.aws_vpc.etcd.cidr_block}"]
from_port = "${local.node_exporter_port}"
to_port = "${local.node_exporter_port}"
Expand Down
2 changes: 1 addition & 1 deletion aws/kube-master/ign-control-plane.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "aws_security_group_rule" "master_ingress" {
type = "ingress"
security_group_id = "${aws_security_group.master.id}"
security_group_id = "${local.master_sg_id}"

protocol = "tcp"
cidr_blocks = ["${data.aws_vpc.master.cidr_block}"]
Expand Down
4 changes: 2 additions & 2 deletions aws/kube-master/ign-kubelet.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "aws_security_group_rule" "master_ingress_kubelet_secure" {
type = "ingress"
security_group_id = "${aws_security_group.master.id}"
security_group_id = "${local.master_sg_id}"

protocol = "tcp"
from_port = 10255
Expand All @@ -10,7 +10,7 @@ resource "aws_security_group_rule" "master_ingress_kubelet_secure" {

resource "aws_security_group_rule" "master_ingress_kubelet_secure_from_worker" {
type = "ingress"
security_group_id = "${aws_security_group.master.id}"
security_group_id = "${local.master_sg_id}"

protocol = "tcp"
cidr_blocks = ["${data.aws_vpc.master.cidr_block}"]
Expand Down
2 changes: 1 addition & 1 deletion aws/kube-master/master.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resource "aws_launch_configuration" "master" {

security_groups = [
"${var.security_group_ids}",
"${aws_security_group.master.id}",
"${local.master_sg_id}",
]

iam_instance_profile = "${aws_iam_instance_profile.master.id}"
Expand Down
4 changes: 4 additions & 0 deletions aws/kube-master/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ output "certificate_authority" {
output "endpoint" {
value = "https://${aws_elb.master_internal.dns_name}"
}

output "master_sg_id" {
value = "${local.master_sg_id}"
}
1 change: 1 addition & 0 deletions ignitions/kubelet/resources/services/kubelet.service
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ExecStart=/usr/lib/coreos/kubelet-wrapper \
--minimum-container-ttl-duration=6m0s \
--client-ca-file=/etc/kubernetes/ca.crt \
--cluster-domain=cluster.local \
--authentication-token-webhook=true \

Choose a reason for hiding this comment

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

What is this for ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have removed and passed it from kubelet extra flag variable

${kubelet_flag_cloud_provider} \
${kubelet_flag_node_labels} \
${kubelet_flag_register_with_taints} \
Expand Down