| name | new-app |
| description | Scaffold a new app in this cluster - HelmRelease (app-template or non-app-template), ExternalSecret, and kopiur backup registration. Use when adding a new application to kubernetes/{namespace}/{app}/. |
Scaffolding a New App
Application Template (app-template chart)
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: &app app-name
namespace: target-namespace
spec:
chartRef:
kind: OCIRepository
name: app-template
namespace: flux-system
interval: 1h
values:
defaultPodOptions:
securityContext:
fsGroup: 1001
fsGroupChangePolicy: OnRootMismatch
runAsGroup: 1001
runAsNonRoot: true
runAsUser: 1001
controllers:
app-name:
containers:
app:
image:
repository: ghcr.io/org/image
tag: 1.0.0@sha256:...
resources:
requests:
cpu: 10m
memory: 128Mi
limits:
memory: 512Mi
securityContext:
allowPrivilegeEscalation: false
capabilities: {drop: ["ALL"]}
readOnlyRootFilesystem: true
persistence:
config:
existingClaim: app-name-config
route:
app:
parentRefs:
- name: internal
namespace: kube-system
hostnames:
- "app.eviljungle.com"
rules:
- matches:
- path: {type: PathPrefix, value: /}
backendRefs:
- name: app-name
port: http
service:
app:
controller: app-name
ports:
http:
port: 8080
Non-App-Template HelmReleases
For infrastructure charts (not using app-template), use this schema:
ExternalSecret Template
---
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: app-name-secret
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword-connect
target:
name: app-name-secret
template:
engineVersion: v2
data:
API_KEY: "{{ .api_key }}"
dataFrom:
- extract:
key: app-name
Backup Configuration
Add to kubernetes/kube-system/kopiur/resourceset-inputprovider.yaml:
apps:
- app: app-name
namespace: "default"
runAsUser: "1001"
capacity: 1Gi
schedule: "H */4 * * *"
pvcSuffix: "config"
cacheCapacity: 20Gi
Schedules use kopiur's Jenkins-style H cron substitution (H * * * *) — each app hashes to
a stable, deterministic minute so load self-distributes with no manual bucket bookkeeping.
kopiur only hashes a bare H token (no H/N step syntax — the admission webhook rejects
it), so trim low-churn apps with plain cron step syntax in the hour field, H */4 * * *
(every 4h), instead of hourly.
NFS repository (nas.home:/mnt/ssdtank/kopia) is configured on the single
ClusterRepository "nas" in clusterrepository.yaml — apps reference it by name
(repository: {kind: ClusterRepository, name: nas}), no per-app volume/secret wiring
needed.