Skip to content

[minor] Enable Public route for cpd - #2566

Open
kushwahck-ibm wants to merge 10 commits into
masterfrom
mascore15972
Open

[minor] Enable Public route for cpd#2566
kushwahck-ibm wants to merge 10 commits into
masterfrom
mascore15972

Conversation

@kushwahck-ibm

@kushwahck-ibm kushwahck-ibm commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds --cpd-public-route-enabled flag to gitops_cp4d and wires up automatic CIS DNS
CNAME + edge certificate provisioning in gitops_suite_dns when the flag is set.

https://jsw.ibm.com/browse/MASCORE-15972

Testing

Tested on: mas-cluster-8 / inst1002

Steps Performed

  1. Created CLI image from PR [minor] Enable Public route for cpd with ansible-devops #2582 (branch name same as [minor] Enable Public route for cpd ansible-devops#2433)

    • Built image: quay.io/ibmmas/cli@sha256:30d03b2ac994efe036af0dc91d0319f7f2c7cb6bb216ce0602f263165591848a
  2. Updated CLI image digest in gitops/instance-applications/010-ibm-sync-jobs/templates/01-ibm-mas_suite_dns_Job.yaml

    • digest: sha256:30d03b2ac994efe036af0dc91d0319f7f2c7cb6bb216ce0602f263165591848a
  3. Updated saas-tekton branch (saas-tekton#281) in mcsp-gitops-mas-instance and mcsp-gitops-mas-apps pipelines

  4. Enabled cpd_public_route_enabled: true in saas-envs

    • saas-envs commit: 863b33e
    • Auto-propagated to mas-dev: commit 7f757ad
  5. Gitops changes merged into mas-gitops via argo-test-branch, ArgoCD app pointed to mas-gitops branch

    • Route cpd-public created automatically with correct hostname and type=external label
    • Job patched ZenService zenCustomRoute and restarted nginx — zero manual steps
  6. Verified suite_dns job picked up cpd_public_route_enabled property:

    • CIS_ENTRIES_TO_ADD included cpd-public.inst1002.saasmax
    • CIS DNS CNAME created → resolves to public NLB
    • Let's Encrypt edge cert ordered with cpd-public.inst1002.saasmax.ibmmasivt.com as SAN
  7. CPD public URL accessible without VPN:
    https://cpd-public.inst1002.saasmax.ibmmasivt.com

Result Recording

Screen.Recording.2026-09-08.at.1.40.44.AM.mov

@kushwahck-ibm
kushwahck-ibm requested a review from a team as a code owner August 28, 2026 10:16
@kushwahck-ibm
kushwahck-ibm marked this pull request as draft August 28, 2026 10:16
@kushwahck-ibm
kushwahck-ibm marked this pull request as ready for review September 1, 2026 07:28
@mnivedithaa mnivedithaa changed the title feat: add cpd-public-route-enabled support in gitops_cp4d and gitops_suite_dns [minor] Enable Public route for cpd Sep 2, 2026
amitpandey0217
amitpandey0217 previously approved these changes Sep 3, 2026

# If CPD public route is enabled, add the cpd-public hostname to CIS DNS + edge cert
if [[ "${CPD_PUBLIC_ROUTE_ENABLED}" == "true" ]]; then
export CIS_ENTRIES_TO_ADD="cpd-public.${CIS_SUBDOMAIN}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Qn: Is this function used anywhere?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's used in two places in the CLI workspace:

  1. gitops_suite_dns:143-146 — the exact snippet you pasted. When CPD_PUBLIC_ROUTE_ENABLED=true, it overrides CIS_ENTRIES_TO_ADD to include cpd-public.${CIS_SUBDOMAIN} so the DNS CNAME and edge cert are created for the public route.

  2. gitops_cp4d:135-136 — parses --cpd-public-route-enabled CLI flag and exports CPD_PUBLIC_ROUTE_ENABLED.

  3. ibm-cp4d.yaml.j2:25-26 — Jinja2 template that writes cpd_public_route_enabled: true into the gitops-envs YAML when CPD_PUBLIC_ROUTE_ENABLED == 'true'.

So CPD_PUBLIC_ROUTE_ENABLED flows end-to-end:

CLI flag --cpd-public-route-enabled

  → gitops_cp4d exports CPD_PUBLIC_ROUTE_ENABLED
    → ibm-cp4d.yaml.j2 writes cpd_public_route_enabled: true to gitops-envs
      → gitops_suite_dns adds cpd-public.<subdomain> to CIS_ENTRIES_TO_ADD
        → DNS CNAME + edge cert created

Previously when CPD_PUBLIC_ROUTE_ENABLED=true, the entire CIS_ENTRIES_TO_ADD
was replaced with just 'cpd-public.<subdomain>', wiping out core/manage/reportdb
etc. and breaking DNS/cert creation for all other MAS components.

Now cpd-public is appended to the existing CIS_ENTRIES_TO_ADD list, and only
if not already present (idempotent). Since gitops already adds cpd-public to
cis_entries_to_add via 010-ibm-sync-jobs.yaml, this append is a no-op in the
gitops flow but correctly handles the standalone CLI case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants