From 6322ebd30fd36ce903655b1f9b5b476cd6a14fe7 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 4 Feb 2025 13:27:17 +0000 Subject: [PATCH] Pass k8s cluster IP when deploying webapps (#25) Part of https://www.notion.so/Support-custom-domains-in-deploy-laconic-com-18aa6b22d4728067a44ae27090c02ce5 and https://git.vdb.to/cerc-io/snowballtools-base/issues/47 Requires https://git.vdb.to/cerc-io/stack-orchestrator/pulls/963 Reviewed-on: https://git.vdb.to/cerc-io/webapp-deployment-status-api/pulls/25 Reviewed-by: ashwin Co-authored-by: Prathamesh Musale Co-committed-by: Prathamesh Musale --- .env => .env.example | 3 ++- scripts/run.sh | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) rename .env => .env.example (85%) diff --git a/.env b/.env.example similarity index 85% rename from .env rename to .env.example index 8f44dc7..b6b19a2 100644 --- a/.env +++ b/.env.example @@ -9,4 +9,5 @@ CLEAN_CONTAINERS=false SYSTEM_PRUNE=false WEBAPP_IMAGE_PRUNE=true CHECK_INTERVAL=5 -FQDN_POLICY="allow" \ No newline at end of file +FQDN_POLICY="allow" +DEPLOYMENT_IP="k8s.cluster.ip.address" diff --git a/scripts/run.sh b/scripts/run.sh index f05b009..2de8f82 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -25,6 +25,11 @@ if [ -z "$DEPLOYMENT_RECORD_NAMESPACE" ]; then exit 2 fi +if [ "$FQDN_POLICY" = "allow" ] && [ -z "$DEPLOYMENT_IP" ]; then + echo "DEPLOYMENT_IP is required with 'allow' FQDN_POLICY" + exit 2 +fi + if [ -z "$IMAGE_REGISTRY" ]; then echo "IMAGE_REGISTRY is required." exit 2 @@ -160,6 +165,7 @@ while true; do --include-tags "$INCLUDE_TAGS" \ --exclude-tags "$EXCLUDE_TAGS" \ --fqdn-policy "${FQDN_POLICY:-prohibit}" \ + --ip "${DEPLOYMENT_IP}" \ --lrn "$LRN" \ --min-required-payment ${MIN_REQUIRED_PAYMENT:-0} \ --config-upload-dir "$UPLOAD_DIRECTORY" \