From 53a96defe0ba66c6ad562882404953dfd09955da Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 30 Jan 2025 11:12:34 +0530 Subject: [PATCH] Add IP address value to DNS records for webapp deployments --- .../deploy/webapp/deploy_webapp_from_registry.py | 5 +++++ stack_orchestrator/deploy/webapp/util.py | 2 ++ 2 files changed, 7 insertions(+) diff --git a/stack_orchestrator/deploy/webapp/deploy_webapp_from_registry.py b/stack_orchestrator/deploy/webapp/deploy_webapp_from_registry.py index 4e57659d..a4606dc9 100644 --- a/stack_orchestrator/deploy/webapp/deploy_webapp_from_registry.py +++ b/stack_orchestrator/deploy/webapp/deploy_webapp_from_registry.py @@ -54,6 +54,7 @@ def process_app_deployment_request( deployment_record_namespace, dns_record_namespace, default_dns_suffix, + dns_value, deployment_parent_dir, kube_config, image_registry, @@ -250,6 +251,7 @@ def process_app_deployment_request( app_deployment_lrn, dns_record, dns_lrn, + dns_value, deployment_dir, app_deployment_request, webapp_deployer_record, @@ -304,6 +306,7 @@ def dump_known_requests(filename, requests, status="SEEN"): help="How to handle requests with an FQDN: prohibit, allow, preexisting", default="prohibit", ) +@click.option("--ip", help="IP address of the k8s deployment (to be set in DNS record)") @click.option("--record-namespace-dns", help="eg, lrn://laconic/dns", required=True) @click.option( "--record-namespace-deployments", @@ -381,6 +384,7 @@ def command( # noqa: C901 only_update_state, dns_suffix, fqdn_policy, + ip, record_namespace_dns, record_namespace_deployments, dry_run, @@ -665,6 +669,7 @@ def command( # noqa: C901 record_namespace_deployments, record_namespace_dns, dns_suffix, + ip, os.path.abspath(deployment_parent_dir), kube_config, image_registry, diff --git a/stack_orchestrator/deploy/webapp/util.py b/stack_orchestrator/deploy/webapp/util.py index eebdb23c..375ee5be 100644 --- a/stack_orchestrator/deploy/webapp/util.py +++ b/stack_orchestrator/deploy/webapp/util.py @@ -688,6 +688,7 @@ def publish_deployment( deployment_lrn, dns_record, dns_lrn, + dns_value: str, deployment_dir, app_deployment_request=None, webapp_deployer_record=None, @@ -716,6 +717,7 @@ def publish_deployment( "version": dns_ver, "name": fqdn, "resource_type": "A", + "value": dns_value, "meta": {"so": uniq.hex}, } }