Skip to content
New issue

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

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

Already on GitHub? # to your account

2025/dns #142

Merged
merged 3 commits into from
Mar 2, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion gen/k8s/dns-cache/configmap.yml

Large diffs are not rendered by default.

10 changes: 3 additions & 7 deletions gen/k8s/dns-cache/deployment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion k8s/dns-cache/deployment.jsonnet
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local commit = 'ae5a0d23fd293e7e1437519b816480cd01dba5f2';
local commit = 'd1e9b4c9ca3f068c5eae56e99b52a4dcd4f21110';

local tls_cert_secret = 'cert-resolver-rubykaigi-net';

Expand Down
11 changes: 11 additions & 0 deletions tf/core/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,17 @@ resource "aws_subnet" "d_private" {
"kubernetes.io/cluster/rknet" = "shared"
}
}
resource "aws_ec2_subnet_cidr_reservation" "c_private" {
Copy link
Member

Choose a reason for hiding this comment

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

便利!

subnet_id = aws_subnet.c_private.id
cidr_block = cidrsubnet(aws_subnet.c_private.cidr_block, 5, 0) # .0-.63
reservation_type = "explicit"
}
resource "aws_ec2_subnet_cidr_reservation" "d_private" {
subnet_id = aws_subnet.d_private.id
cidr_block = cidrsubnet(aws_subnet.d_private.cidr_block, 5, 0) # .0-.63
reservation_type = "explicit"
}


resource "aws_subnet" "c_onpremises" {
availability_zone = "ap-northeast-1c"
Expand Down
12 changes: 9 additions & 3 deletions tf/dns-cache/elb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ resource "aws_lb" "nlb" {
name = "dns-cache-${substr(uuid(), 0, 10)}"
internal = true
load_balancer_type = "network"
subnets = [for s in local.nlb_subnets : s.id]

dynamic "subnet_mapping" {
for_each = tomap(local.nlb_subnets)
content {
subnet_id = subnet_mapping.value.id
private_ipv4_address = cidrhost(subnet_mapping.value.cidr_block, 53)
}
}

lifecycle {
create_before_destroy = true
ignore_changes = [name]
ignore_changes = [name]
}
}

Expand Down