↓ Skip to main content

A Pattern for Building Reproducible Public Kubernetes GitOps Repos Without Exposing Sensitive Data

·553 words·3 mins
Minh Phuong Nguyen
Author
Minh Phuong Nguyen

I’ve been considering publishing the reusable part of my homelab setup in such a way that it is easy to reproduce, without exposing sensitive information. For that, I split it into a public repository and a private repository, and make use of Argo CD to read both repositories as sources to deploy applications.

Image

Repositories have different purposes
#

RepositoryResponsibility
Public repoReusable Kubernetes baseline
Private repoCluster-specific desired state

The setup treats the public repo like upstream software, the same way you already treat a Helm chart: the chart and public values describe what can be deployed, and a private values.yaml describes how this cluster runs it. The public repo has dependencies, while the private repo has configuration.

Public (reusable baseline)
#

This has default Helm values, placeholder domains, generic settings, and nothing cluster-specific - no IP addresses, no real hostnames, etc. Every file has to pass “could another installation use this as-is?” If not, it goes in the private repo.

homelabs/
├── app-01/
│   └── values.yaml
└── app-02/
    └── values.yaml
# homelabs/app-01/values.yaml
replicaCount: 2
image:
  tag: "1.4.0"
ingress:
  enabled: false

Private (cluster overlay)
#

This holds Argo CD Applications, version pins, and values that only make sense on a specific cluster.

homelabs-private/
├── argocd/
│   └── projects/
│       └── homelab.yaml
└── clusters/
    └── home-dev/
        ├── argocd/
        │   ├── app-of-apps.yaml
        │   └── applications/
        │       ├── app-01.yaml
        │       └── app-02.yaml
        └── overlays/
            ├── app-01/
            │   └── values.yaml
            └── app-02/
                └── values.yaml
# clusters/home-dev/overlays/app-01/values.yaml
ingress:
  enabled: true
  hosts:
    - host: app-01.example.com

How Argo CD ties everything together
#

A multi-source Application can read from multiple Git repos, installing upstream defaults and private overlays. For example:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: app-01
  namespace: argocd
spec:
  project: homelab
  sources:
    - repoURL: https://charts.example.com
      chart: example-app
      targetRevision: 1.4.2
      helm:
        valueFiles:
          - $homelabs/app-01/values.yaml
          - $private/clusters/home-dev/overlays/app-01/values.yaml
    - repoURL: https://github.com/example/homelabs.git
      targetRevision: v1.2.0
      ref: homelabs
    - repoURL: https://github.com/example/homelabs-private.git
      targetRevision: main
      ref: private
  destination:
    server: https://kubernetes.default.svc
    namespace: app-01
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

Versioning: trunk-based, tags for promotion
#

I used to overthink this. GitFlow with main, develop, feature, release, and hotfix is what I use at work for medical software, where the ceremony matches the regulatory process. For GitOps, here and on the platform side, I want a pin I can bump: determinism, immutability, a short promotion path.

Trunk-based development:

main        → releasable
feature/*   → short-lived
tags        → v1.0.0, v1.1.0, etc.

The public main branch stays stable with semver tags. No environment branches.

The private main branch is the current cluster state. Promotion is a version bump in the Application, not a merge between long-lived branches. Extra environments are directories, not branches:

clusters/
├── home-dev/
└── home-prod/

How I promote a new version
#

Tag the public repo:

cd homelabs/
git tag v1.2.0
git push origin v1.2.0

Bump the public source in the private Application (and the Helm targetRevision if the chart moved):

cd homelabs-private/
# targetRevision on the homelabs ref: v1.1.0 → v1.2.0
git add clusters/home-dev/argocd/applications/app-01.yaml
git commit -m "Promote app-01 to v1.2.0"
git push origin main

Argo CD syncs the new pin (or I sync it by hand if auto-sync is off).

That is the whole workflow. Consume both repositories; do not sync them. Rollbacks are pin changes in the private Application, and the public tree can stay public because private settings never lived there.