3.1 KiB
name, description
| name | description |
|---|---|
| add-service | Add a new service to the homelab cluster end-to-end (manifests, Argo CD Application, DNS, certs/secrets). Use when the user wants to deploy a new app or service to the K3s cluster. |
Add a new service to the cluster: $ARGUMENTS
Follow the checklist from argocd/README.md, in order:
1. Manifests or Helm values
- Raw resources: create
manifests/<area>/<service>.yaml. Follow the style of existing files (seemanifests/portfolio/portfolio.yamlfor a full example:Namespace→Deployment→Service→Certificate→IngressRoute, all in one file separated by---). Start the file with an# Apply:/# Delete:/# Description:comment block matching sibling files. - Helm chart instead: add
values/<service>.yamlwith the chart's values.
2. Argo CD Application
Add argocd/apps/<service>.yaml. For a raw manifest directory:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: <service>
namespace: argocd
spec:
project: default
source:
repoURL: https://gitea.nik4nao.com/nik/homelab.git
targetRevision: main
path: manifests/<area>
directory:
recurse: true
include: '*.yaml'
destination:
server: https://kubernetes.default.svc
namespace: <service>
syncPolicy:
automated:
prune: false
selfHeal: true
syncOptions:
- CreateNamespace=true
For a Helm chart, mirror an existing chart-backed Application (e.g.
argocd/apps/traefik.yaml) and point it at values/<service>.yaml.
prune: false is deliberate — deleting a manifest from Git will NOT remove
the resource from the cluster automatically; say so if the user is removing
something, not just adding.
3. DNS (internal services only)
home.arpa has no wildcard DNS. If this service gets a *.home.arpa
hostname, add it to both:
values/pihole.yaml(dnsmasq.customDnsEntries, formataddress=/<host>.home.arpa/<node-ip>, plus aningress.hostsentry if the service itself is exposed through Pi-hole's own ingress block — most services don't need that part, just thecustomDnsEntriesline)values/pihole-debian.yaml(same entry, kept in sync with the primary)
Public services use nik4nao.com and don't need Pi-hole entries.
4. Certificates and secrets
- Internal (
home.arpa):CertificatewithissuerRef.name: internal-ca-issuer. - Public (
nik4nao.com):CertificatewithissuerRef.name: letsencrypt-prod. - If the service needs credentials, decide runtime-script vs sealed-secret —
see the
regen-sealed-secretskill /manifests/README.mdfor the distinction. Don't hardcode secret values into the manifest. - If the image is pulled from the private Gitea registry, add an
imagePullSecretsreference and reuse/create the matchingregistry-secret.shpattern (seemanifests/portfolio/registry-secret.sh).
5. Commit
Commit manifests, the Application file, and any DNS/values changes together.
Do not commit .env or any plaintext secret values. Let the app-of-apps
reconcile — don't kubectl apply the new Application by hand unless the user
asks for an immediate manual sync.