Skip to content

Git 13 - #6

Merged
noels merged 4 commits into
mainfrom
GIT-13
Aug 10, 2026
Merged

Git 13#6
noels merged 4 commits into
mainfrom
GIT-13

Conversation

@noels

@noels noels commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

Adds GIT-13: an opt-in "deployments" repo that layers private values over the public catalogues and adds net-new apps — without ever forking the public repos. A cluster opts in purely by annotating its Argo CD cluster secret with a private repo URL; with no annotation, a public-only "trial" install works unchanged.

How it works

  • Public catalogues stay canonical. *_repo_url is never repointed, so every child appset keeps sourcing its $values/$workloads base from the public repo.
  • Opt-in via Terraform. gitops_{addons,workloads}_private_repo now default to ""; locals emit the private URL only when a repo is set. Trial clusters emit no private annotation.
  • Root appsets choose the source. bootstrap/hub/{addons,workloads}.yaml become goTemplate and switch on {addons,workloads}_private_repo_url:
    • set → target the private repo's <basepath>/bootstrap (a Kustomize build that imports the clean public appsets, layers private values, and adds extra apps)
    • unset → the public catalogue directory (trial); directory.recurse is re-added via spec.templatePatch (structural toggles can't live in template).
  • The private repo carries the Kustomize patching; the public repos never reference it.

Also fixes a latent bug: an invalid preserveResourcesOnDeletion under template.spec.syncPolicy in workloads.yaml (an ApplicationSet-level field, not valid on an Application; kubectl apply strict-decodes and rejects it).

Design doc: docs/private-overlays-design.md.

Verified live (kind hub/spoke)

Flipped the local hub to deployments mode against gitops-private:

  • addons root Synced/Healthy off the private repo's Kustomize.
  • Argo repo-server builds remote Kustomize bases with default config (the main risk).
  • velero-ui gained a ref: private source + private valueFiles and scaled 1→2 replicas from a private cluster value — public base source unforked.
  • Net-new podinfo addon deployed (not present in the public catalogue).
  • SSH deploy-key auth to the private repo works.

Scope / follow-ups

  • Terraform changes span all three stacks (on-prem, hub, spokes); terraform validate passes on each.
  • Workloads overlay uses the same mechanism but needs a type: workload spoke to exercise.
  • ESO (runtime secrets, GIT-6/GIT-10 + GIT-7) is required by the AC and still blocks final GIT-13 closure — tracked separately.

noels and others added 4 commits August 8, 2026 17:40
Add a dedicated *_private_* namespace (distinct from the dead *_extras_*
"extra public charts" vars) so the catalogue ApplicationSets can layer a
private, SSH-accessed, values-only overlay repo over the public catalogues.

Across all three stacks (on-prem, hub-spoke/hub, hub-spoke/spokes):
- gitops_private_org: SSH org/prefix (git@github.com:SilexConsulting), separate
  from the HTTPS gitops_org
- gitops_{addons,workloads}_private_{repo,revision} vars (default gitops-private@main)
- gitops_{addons,workloads}_private_url locals
- {addons,workloads}_private_repo_{url,revision} cluster-secret annotations
- private_overlays added to allowed_addons so enable_private_overlays is a known flag

Values-only overlay -> a ref source consumes only url+revision; basepath/path
omitted to avoid dead annotations (environments/ and clusters/ live at repo root).
terraform validate passes on all three stacks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Documents the agreed architecture: clean public catalogues (trial-able),
a private "deployments" repo that owns bootstrap/ and carries the Kustomize
patching layering private values/secrets over the public appsets, two modes
(trial vs deployments) selected by repo path/basepath annotations, the private
annotation contract, precedence, and secrets/ESO scope.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Align the Terraform wiring with the final deployments-repo design:
- add {addons,workloads}_private_repo_basepath (vars/locals/annotations) across
  all three stacks — basepath selects the addons/workloads subtree and enables the
  one-repo-or-two choice; consumed by the private repo's bootstrap Kustomize.
- remove the enable_private_overlays toggle: mode is chosen by which appsets the
  root app targets (public vs private bootstrap/), not a per-cluster label. Revert
  private_overlays from allowed_addons.

terraform validate passes on all three stacks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Make the private deployments repo opt-in and let the hub root appsets target it
without forking the public catalogues.

Terraform (on-prem, hub, spokes):
- gitops_{addons,workloads}_private_repo now default to "" (opt-in). locals compute
  the private URL as `repo == "" ? "" : <org>/<repo>`, so a public-only trial cluster
  emits an empty private annotation and never references the private repo.

Root bootstrap appsets (bootstrap/hub/{addons,workloads}.yaml):
- Convert to goTemplate. The source is conditional on whether the cluster secret carries
  a non-empty {addons,workloads}_private_repo_url:
    set   -> target the private repo's <basepath>/bootstrap (Kustomize: imports the clean
             public appsets, layers private values, adds extra apps)
    unset -> the public catalogue directory (trial), with directory.recurse re-added via
             spec.templatePatch (structural toggles can't live in `template`)
- The public *_repo_url is never repointed, so every child appset keeps sourcing its
  $values/$workloads base from the public catalogue (resolves the two-consumers collision).
- Drop an invalid `preserveResourcesOnDeletion` under template.spec.syncPolicy in
  workloads.yaml (an ApplicationSet-level field, not valid on an Application).

Verified live on the kind-hub: addons flips to the private repo, remote Kustomize bases
build in Argo repo-server, velero-ui gains a ref:private source (+2 replicas from a private
value), and a net-new podinfo addon deploys. Public base sources remain unforked.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@noels
noels requested review from auxeria and a lite review from Copilot August 9, 2026 09:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds support for GIT-13 “deployments” (private overlays) as an opt-in mode, allowing clusters to layer private values and add net-new apps without forking the public catalog repos. This is implemented by extending Terraform to emit private-repo annotation inputs and updating hub bootstrap ApplicationSets to select either public catalog directories (trial) or a private repo bootstrap/ Kustomize entrypoint (deployments mode).

Changes:

  • Add Terraform variables/locals to define optional private repo URL/basepath/revision for addons and workloads, and propagate them as Argo CD cluster Secret annotations.
  • Update bootstrap/hub/{addons,workloads}.yaml to goTemplate and switch sources based on presence of private repo annotations, using templatePatch to conditionally enable directory.recurse only for trial mode.
  • Add docs/private-overlays-design.md design document describing the repo layout and annotation contract.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
terraform/on-prem/variables.tf Adds private-repo opt-in variables and SSH org/prefix for on-prem stack.
terraform/on-prem/locals.tf Constructs private repo URLs and propagates private annotation keys into cluster secret metadata.
terraform/hub-spoke/spokes/variables.tf Adds private-repo opt-in variables and SSH org/prefix for spokes stack.
terraform/hub-spoke/spokes/locals.tf Constructs private repo URLs and propagates private annotation keys into spoke cluster secret metadata.
terraform/hub-spoke/hub/variables.tf Adds private-repo opt-in variables and SSH org/prefix for hub stack.
terraform/hub-spoke/hub/locals.tf Constructs private repo URLs and propagates private annotation keys into hub cluster secret metadata.
docs/private-overlays-design.md Documents the private deployments repo design, layering, and annotation contract.
bootstrap/hub/workloads.yaml Switches workloads root ApplicationSet to template-driven public vs private source selection and fixes invalid per-Application field placement.
bootstrap/hub/addons.yaml Switches addons root ApplicationSet to template-driven public vs private source selection.
Suppressed comments (2)

bootstrap/hub/addons.yaml:43

  • Same issue as above: if not .metadata.annotations.addons_private_repo_url will error under missingkey=error if the optional annotation key is absent. Use index for the optional lookup.
    {{- if not .metadata.annotations.addons_private_repo_url }}

bootstrap/hub/workloads.yaml:43

  • Same optional-annotation issue in templatePatch: dot-access will error under missingkey=error if the key is absent. Use index for this lookup.
    {{- if not .metadata.annotations.workloads_private_repo_url }}

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread bootstrap/hub/addons.yaml
Comment thread bootstrap/hub/workloads.yaml
@noels
noels merged commit 4f63158 into main Aug 10, 2026
2 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