Skip to content

[minor] Enable Public route for cpd - #578

Open
kushwahck-ibm wants to merge 29 commits into
mainfrom
15972-cpd_route_public
Open

[minor] Enable Public route for cpd#578
kushwahck-ibm wants to merge 29 commits into
mainfrom
15972-cpd_route_public

Conversation

@kushwahck-ibm

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

Copy link
Copy Markdown
Contributor

Summary

Adds a new Helm Job (09-ibm-cpd-public-route.yaml) to the 110-ibm-cp4d chart that
creates a public-facing CP4D URL accessible without VPN. Also wires up the new chart values
and passes them through from the instance root application.

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 cli#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

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

@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 job to expose CP4D on public URL without VPN [minor] Enable Public route for cpd Sep 2, 2026
Comment thread instance-applications/110-ibm-cp4d/templates/09-ibm-cpd-public-route.yaml Outdated
Comment thread instance-applications/110-ibm-cp4d/values.yaml Outdated
Comment thread instance-applications/110-ibm-cp4d/templates/09-ibm-cpd-public-route.yaml Outdated
Comment thread instance-applications/110-ibm-cp4d/README.md Outdated
Comment thread instance-applications/110-ibm-cp4d/templates/09-ibm-cpd-public-route.yaml Outdated
amitpandey0217
amitpandey0217 previously approved these changes Sep 3, 2026
kushwahck-ibm and others added 11 commits September 3, 2026 22:47
Move cpd route restore from Step 2 (before ZenService patch) to Step 4 (after
ZenService Completed). ZenService overwrites cpd route spec.host during its own
reconcile cycle — restoring before was immediately undone. Restoring after
ZenService Completed ensures the correct hostname sticks permanently.

Also: Step 1 now detects if ZenService already overwrote the host and derives
the correct internal hostname from the cluster ingress domain as a fallback.

Steps:
  1. Read internal cpd route host (with fallback if already overwritten)
  2. Patch ZenService zenCustomRoute
  3. Wait for ZenService Completed
  4. Restore internal cpd route host  ← key fix
  5. Restart nginx pods

Job version bumped v3 → v4.
type: external
route-type: external
{{ .Values.custom_labels | toYaml | indent 4 }}
{{- else }}

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.

This else condition is not required. You can have the custom labels value only within if condition

cpd_iam_integration: "{{ .Values.ibm_cp4d.cpd_iam_integration }}"
cpd_primary_storage_class: "{{ .Values.ibm_cp4d.cpd_primary_storage_class }}"
cpd_metadata_storage_class: "{{ .Values.ibm_cp4d.cpd_metadata_storage_class }}"
{{- if .Values.ibm_cp4d.cpd_public_route_enabled }}

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.

It would be better if we add condition that if dns provider is cis

{{- $visualinspection_str := ternary "" "visualinspection" (empty $visualinspection) -}}
{{- $optimizer_str := ternary "" "optimizer" (empty $optimizer) -}}
{{- $facilities_str := ternary "" "facilities" (empty $facilities) -}}
{{- $cpd_public_str := ternary (printf "cpd-public.%s" $core.cis_subdomain) "" (and (not (empty $core)) (not (empty .Values.ibm_cp4d)) (.Values.ibm_cp4d.cpd_public_route_enabled | default false)) -}}

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.

Can we just pass cpd-public only. Subdomain is not required to be passed from here

{{- $_cli_image_digest := "sha256:1c5701a24c9796e02b33036f56babbe74032831e1db733ce9228a46dce4a870b" }}
{{- $_cli_image_digest := "sha256:30d03b2ac994efe036af0dc91d0319f7f2c7cb6bb216ce0602f263165591848a" }}

{{- /*

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.

Also the required env property CPD_PUBLIC_ROUTE_ENABLED is not set as env property in this job

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.

done

- 010-ibm-sync-jobs.yaml (root app): pass cpd_public_route_enabled: true
  to sync-jobs chart values when cpd_public_route is enabled
- 01-ibm-mas_suite_dns_Job.yaml: add CPD_PUBLIC_ROUTE_ENABLED env var
  so gitops_suite_dns function creates CIS DNS CNAME + edge cert
  automatically without relying on prior manual setup
- bump suite_dns job version v3 -> v4
CPD_PUBLIC_ROUTE_ENABLED is not needed in the suite_dns job because:
- cis_entries_to_add already contains 'cpd-public' when cpd_public_route_enabled is true
- ansible-devops derives edge_certs_cpd_public from cis_entries_to_add directly
- setting CPD_PUBLIC_ROUTE_ENABLED=true in the CLI would override CIS_ENTRIES_TO_ADD
  entirely, wiping out core/manage/reportdb/facilities DNS entries

DNS CNAME and edge cert are created correctly via cis_entries_to_add alone.
Revert suite_dns job version v4 -> v3.
…tion

The suite_dns ansible role uses cpd_public_route_enabled (from CPD_PUBLIC_ROUTE_ENABLED
env var) in dnsentries.yml.j2 to create the cpd-public DNS CNAME. Without this env var
the CNAME is never created even though the edge cert is ordered correctly via
cis_entries_to_add.

The CLI gitops_suite_dns bug (overwriting CIS_ENTRIES_TO_ADD entirely) is fixed
separately in the CLI repo — it now appends cpd-public instead of overwriting.
Since cis_entries_to_add already contains cpd-public, the append is a no-op and
does not affect the cert ordering flow.

- 010-ibm-sync-jobs.yaml: pass cpd_public_route_enabled: true to chart values
- 01-ibm-mas_suite_dns_Job.yaml: add CPD_PUBLIC_ROUTE_ENABLED env var, bump v3->v4
…proxied:false fix) + bump suite_dns v6"

This reverts commit dae6ace.
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