Skip to content

feat: support deploying ZTVP from private git repositories#140

Merged
sabre1041 merged 6 commits into
validatedpatterns:mainfrom
minmzzhang:ztvp-private-repos
Jun 5, 2026
Merged

feat: support deploying ZTVP from private git repositories#140
sabre1041 merged 6 commits into
validatedpatterns:mainfrom
minmzzhang:ztvp-private-repos

Conversation

@minmzzhang
Copy link
Copy Markdown
Collaborator

@minmzzhang minmzzhang commented May 29, 2026

Summary

  • Add bootstrap_secrets configuration to values-secret.yaml.template for both SSH and HTTPS/PAT authentication to private Git repositories
  • Create docs/private-repos.md with step-by-step deployment instructions, verification steps, and troubleshooting guide
  • Update ztvp-certificates chart to merge existing proxy CA ConfigMaps (e.g. corporate CAs added pre-install for internal GitLab) into ztvp-proxy-ca, ensuring workloads like ACS Central can trust both cluster-internal routes and external hosts without manual intervention

Key features

  • SSH key authentication with insecureIgnoreHostKey for ArgoCD repo-server containers
  • HTTPS/PAT authentication with support for GitHub and GitLab (including internal instances)
  • ACM chart 0.2.x: bump chartVersion from 0.1.* to 0.2.* so the vp-private-hub-policy reads global.vpArgoNamespace (set automatically by the VP operator) instead of hardcoding openshift-gitops
  • Corporate CA handling: documents the pre-install custom-ca requirement for internal Git hosts, and the automatic merge into ztvp-proxy-ca post-install
  • DISABLE_VALIDATE_ORIGIN support for skipping local git ls-remote pre-flight check

Troubleshooting coverage

  • Git remote URL / auth type mismatch
  • SSH knownhosts: key is unknown
  • HTTPS x509: certificate signed by unknown authority (internal CAs)
  • GitLab PAT authorization failed (Reporter role + read_repository scope required)
  • ACM vp-private-hub-policy NonCompliant

Add bootstrap_secrets configuration to values-secret.yaml.template
with two options for private repository access:
- Option A: SSH deploy key authentication
- Option B: HTTPS with Personal Access Token (PAT)

Add docs/private-repos.md with step-by-step deployment instructions,
verification steps, and troubleshooting guidance.

The common Makefile already supports TOKEN_SECRET and TOKEN_NAMESPACE;
this commit provides the pattern-level configuration and documentation.

Signed-off-by: Min Zhang <minzhang@redhat.com>
The ArgoCD repo-server container does not have Git host SSH fingerprints
in its known_hosts file, causing "knownhosts: key is unknown" errors.
Add insecureIgnoreHostKey field to the SSH bootstrap_secrets template.

Also document:
- DISABLE_VALIDATE_ORIGIN for private repo pre-flight check
- ACM temporary Degraded state during initial install (self-heals)
- SSH known_hosts troubleshooting entry

Signed-off-by: Min Zhang <minzhang@redhat.com>
When deploying from an internal Git host (e.g. gitlab.cee.redhat.com),
users must add corporate CAs to proxy/cluster before install.  Previously
the ztvp-certificates job refused to overwrite a user-set trustedCA,
leaving ACS Central unable to trust Keycloak via the ingress CA.

Changes:
- PHASE 8.5: include all extracted CAs (custom, additional, cluster) in
  the proxy CA bundle, not just ingress + service
- PHASE 8.6: merge existing proxy CA ConfigMap content into ztvp-proxy-ca
  before taking over trustedCA management
- docs/private-repos.md: document pre-install CA requirement and explain
  automatic merge behavior
- values-secret.yaml.template: add ACM workaround bootstrap_secrets entry

Signed-off-by: Min Zhang <minzhang@redhat.com>
@minmzzhang minmzzhang requested review from mlorenzofr, p-rog and sabre1041 and removed request for mlorenzofr May 29, 2026 14:29
The duplicate bootstrap_secrets entry targeting openshift-gitops is no
longer needed.  The VP operator (0.0.70+) copies credentials into
vp-gitops and automatically sets global.vpArgoNamespace.  The ACM chart
0.2.x reads that variable, so the private-repo policy resolves without
any manual override or duplicate secret.

- Remove second bootstrap_secrets entries (SSH and HTTPS workarounds)
- Bump ACM chartVersion from 0.1.* to 0.2.*
- Update docs/private-repos.md and values-secret.yaml.template comments

Signed-off-by: Min Zhang <minzhang@redhat.com>
@minmzzhang minmzzhang force-pushed the ztvp-private-repos branch from dd8c6ab to cb9264d Compare May 29, 2026 20:20
Move the DISABLE_VALIDATE_ORIGIN=true flag directly into the deploy
command so users don't hit the git ls-remote failure before discovering
the workaround in a separate section.

Signed-off-by: Min Zhang <minzhang@redhat.com>
Copy link
Copy Markdown
Collaborator

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

Looks really good and testing SSH successfully. Added one blocking comment that we need to implement. Then we can look to merge this integration

Comment thread docs/private-repos.md Outdated
Comment thread docs/private-repos.md
value: git
- name: url
value: git@github.com:YOUR-ORG/layered-zero-trust.git
- name: insecureIgnoreHostKey
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there any support to provide known hosts at provisioning time? I did a quick check in the VP repos and did not locate an option

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated the doc mentioning that the insecureIgnoreHostKey is only needed for self-hosted git servers, it is not needed for public git servers like gitlab.com, github.com.

- Add DISABLE_VALIDATE_ORIGIN=true to SSH deploy step (same issue as
  HTTPS: Makefile git ls-remote fails against private remotes)
- Document insecureIgnoreHostKey alternatives: major providers have
  pre-populated fingerprints; self-hosted Git requires the flag since
  vp-gitops namespace does not exist until install; post-install
  hardening via ssh-keyscan + oc patch is described

Signed-off-by: Min Zhang <minzhang@redhat.com>
Copy link
Copy Markdown
Collaborator

@sabre1041 sabre1041 left a comment

Choose a reason for hiding this comment

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

LGTM

@sabre1041 sabre1041 merged commit 3d68f0b into validatedpatterns:main Jun 5, 2026
3 checks passed
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.

2 participants