Skip to content

How to add k8s app to cluster?

Apps are managed via two maps in rpi-homelab/infra:

  • path_apps – manifest-based apps.
  • helm_apps – Helm chart apps.

Each map has its own Argo CD Application resource.


Path-based apps

1. Add manifests

In kubernetes-manifests:

kubernetes-manifests/<app>/

Add Deployments, Services, HTTPRoutes, ConfigMaps, Secrets, etc. Commit to main.

2. (Optional) Add configs / secrets

In configs:

configs/<app>/

Use for ConfigMaps/Secrets you want in a separate repo. For Bitwarden secrets:

apiVersion: k8s.bitwarden.com/v1
kind: BitwardenSecret

Commit to main.

3. Add to path_apps

In the argocd stack:

locals {
  path_apps = {
    example = {}

    example-with-configs = {
      configs_access = true
    }

    example-with-secrets = {
      configs_access    = true
      bw_secrets_access = true
    }

    example-custom-ns = {
      namespace = "custom-ns"
    }
  }
}

Fields:

  • namespace – target namespace (default: <app>).
  • configs_access = true – adds configs/<app> as an extra Argo CD source.
  • bw_secrets_access = true – creates bw-auth-token Secret for sm-operator.

Path apps always use kubernetes-manifests/<app> as their primary source.


Helm apps

1. (Optional) Add manifests and/or values

In kubernetes-manifests/<app>/:

  • Raw manifests: any .yaml files you want applied directly.
  • Values file: values.yaml (or similar) for Helm overrides.

Commit to main.

2. Add to helm_apps

locals {
  helm_apps = {
    example = {
      namespace        = "example"
      manifests_access = true   # raw manifests from kubernetes-manifests/<app>
      manifest_values  = true   # enable $values/<app>/values.yaml

      helm = {
        repo_url        = "https://example.com/helm-charts"
        chart           = "example"
        target_revision = "1.2.3"
        release_name    = "example"
        value_files     = ["$values/example/values.yaml"]
      }
    }
  }
}

Fields:

  • namespace – target namespace (default: <app>).
  • manifests_access = true – adds kubernetes-manifests/<app> as an additional source (raw manifests).
  • manifest_values = true – adds kubernetes-manifests as a $values source for Helm values.
  • helm.* – standard Helm chart parameters.
  • helm.value_files – values files, e.g. ["$values/<app>/values.yaml"] (requires manifest_values = true).

A Helm app can use:

  • Only the chart.
  • Chart + raw manifests (manifests_access).
  • Chart + values (manifest_values).
  • Chart + raw manifests + values (both flags).

Apply changes

After committing repo changes:

tofu plan
tofu apply

from the argocd stack.

Argo CD will:

  • Sync path_apps from kubernetes-manifests (+ optional configs).
  • Install/upgrade helm_apps from their Helm charts.
  • Load Helm values from kubernetes-manifests when manifest_values = true.