public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: cel@kernel.org
To: <kdevops@lists.linux.dev>
Cc: Chuck Lever <chuck.lever@oracle.com>
Subject: [RFC PATCH 2/2] aws: Add each test instance to the local DNS service
Date: Fri,  8 Nov 2024 15:12:45 -0500	[thread overview]
Message-ID: <20241108201245.561269-3-cel@kernel.org> (raw)
In-Reply-To: <20241108201245.561269-1-cel@kernel.org>

From: Chuck Lever <chuck.lever@oracle.com>

The kdevops NFS workflows typically set up separate nodes for an NFS
server and NFS clients. kdevops then provisions exports on the NFS
server and mount points on the clients.

For libvirt, kdevops adds the IP address of each test node to all of
the /etc/hosts files. This enables the clients to mount the test NFS
server conveniently by hostname.

For AWS, kdevops can provision a private DNS service and add "A"
records for each test host there. This patch implements that
approach.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 terraform/aws/main.tf | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/terraform/aws/main.tf b/terraform/aws/main.tf
index 62730d77422c..77aabd79e658 100644
--- a/terraform/aws/main.tf
+++ b/terraform/aws/main.tf
@@ -184,3 +184,33 @@ resource "aws_route_table_association" "kdevops_rt_assoc" {
   route_table_id = aws_route_table.kdevops_rt.id
 }
 
+resource "aws_vpc_dhcp_options" "kdevops_dhcp_opts" {
+  domain_name         = "kdevops.local"
+  domain_name_servers = ["AmazonProvidedDNS"]
+
+  tags = {
+    Name = "kdevops_dhcp_opts"
+  }
+}
+
+resource "aws_vpc_dhcp_options_association" "kdevops_dhcp_association" {
+  vpc_id          = aws_vpc.kdevops_vpc.id
+  dhcp_options_id = aws_vpc_dhcp_options.kdevops_dhcp_opts.id
+}
+
+resource "aws_route53_zone" "kdevops_private_zone" {
+  name = "kdevops.local"
+  vpc {
+    vpc_id = aws_vpc.kdevops_vpc.id
+  }
+}
+
+resource "aws_route53_record" "kdevops_dns_record" {
+  count   = local.kdevops_num_boxes
+  zone_id = aws_route53_zone.kdevops_private_zone.zone_id
+  name    = "${element(var.kdevops_nodes, count.index)}.kdevops.local"
+  type    = "A"
+  ttl     = "300"
+  records = ["${element(aws_instance.kdevops_instance.*.private_ip, count.index)}"]
+}
+
-- 
2.47.0


  parent reply	other threads:[~2024-11-08 20:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-08 20:12 [RFC PATCH 0/2] Provisioning the AWS private network cel
2024-11-08 20:12 ` [RFC PATCH 1/2] aws: Permit inter-node network traffic cel
2024-11-08 20:12 ` cel [this message]
2024-11-09  0:44 ` [RFC PATCH 0/2] Provisioning the AWS private network Luis Chamberlain
2024-11-09 17:19   ` Chuck Lever III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241108201245.561269-3-cel@kernel.org \
    --to=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=kdevops@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox