torvalds-deployment
Use when asking about adding services, createXxxDeployment patterns, or homelab deployment conventions. Services use per-namespace charts.
What this skill does
# Homelab Service Deployment
## Overview
Services are deployed across multiple namespaces using an app-of-apps pattern. Each service
category has its own namespace and Helm chart (e.g., `media`, `home`, `postal`). Services follow
a consistent `createXxxDeployment()` pattern.
## Namespace Structure
| Namespace | Services | Chart File |
| ----------- | -------------------------------------------- | -------------- |
| `media` | Plex, Radarr, Sonarr, Bazarr, Prowlarr, etc. | `media.ts` |
| `home` | Home Assistant, HA automations | `home.ts` |
| `postal` | Postal mail server, MariaDB | `postal.ts` |
| `syncthing` | Syncthing | `syncthing.ts` |
| `golink` | GoLink | `golink.ts` |
| `freshrss` | FreshRSS | `freshrss.ts` |
| `pokemon` | Pokemon bots | `pokemon.ts` |
| `gickup` | Gickup | `gickup.ts` |
## Standard Deployment Pattern
### Step 1: Create Deployment File
Create `src/cdk8s/src/resources/{category}/yourservice.ts`:
```typescript
import { Chart, Size } from "cdk8s";
import {
Cpu,
Deployment,
DeploymentStrategy,
type PersistentVolumeClaim,
Service,
Volume,
} from "cdk8s-plus-31";
import {
LINUXSERVER_GID,
withCommonLinuxServerProps,
} from "../../misc/linux-server.ts";
import { ZfsNvmeVolume } from "../../misc/zfs-nvme-volume.ts";
import { TailscaleIngress } from "../../misc/tailscale.ts";
import versions from "../../versions.ts";
export function createYourServiceDeployment(
chart: Chart,
claims?: {
downloads?: PersistentVolumeClaim;
media?: PersistentVolumeClaim;
},
) {
// 1. Create Deployment
const deployment = new Deployment(chart, "yourservice", {
replicas: 1,
strategy: DeploymentStrategy.recreate(),
securityContext: {
fsGroup: LINUXSERVER_GID,
},
});
// 2. Create config volume (SSD for performance)
const configVolume = new ZfsNvmeVolume(chart, "yourservice-pvc", {
storage: Size.gibibytes(8),
});
// 3. Add container
deployment.addContainer(
withCommonLinuxServerProps({
image: `ghcr.io/linuxserver/yourservice:${versions["linuxserver/yourservice"]}`,
portNumber: 8080,
volumeMounts: [
{
path: "/config",
volume: Volume.fromPersistentVolumeClaim(
chart,
"yourservice-config-volume",
configVolume.claim,
),
},
// Add shared volumes if needed
...(claims?.downloads
? [
{
path: "/downloads",
volume: Volume.fromPersistentVolumeClaim(
chart,
"yourservice-downloads-volume",
claims.downloads,
),
},
]
: []),
],
resources: {
cpu: {
request: Cpu.millis(100),
limit: Cpu.millis(1000),
},
memory: {
request: Size.mebibytes(256),
limit: Size.mebibytes(512),
},
},
}),
);
// 4. Create Service
const service = new Service(chart, "yourservice-service", {
selector: deployment,
ports: [{ port: 8080 }],
});
// 5. Create Tailscale Ingress
new TailscaleIngress(chart, "yourservice-ingress", {
service,
host: "yourservice",
});
}
```
### Step 2: Add Version
Edit `src/cdk8s/src/versions.ts`:
```typescript
const versions = {
// renovate: datasource=docker registryUrl=https://ghcr.io versioning=docker
"linuxserver/yourservice": "1.0.0@sha256:abc123...",
// ... other versions
};
```
### Step 3: Register in Appropriate Chart
For media services, edit `src/cdk8s/src/cdk8s-charts/media.ts`:
```typescript
import { createYourServiceDeployment } from "../resources/media/yourservice.ts";
export function createMediaChart(app: App) {
const chart = new Chart(app, "media", {
namespace: "media",
disableResourceNameHashes: true,
});
// Shared volumes
const downloadsVolume = new ZfsSataVolume(chart, "downloads-hdd-pvc", {
storage: Size.tebibytes(1),
});
// Add your service
createYourServiceDeployment(chart, {
downloads: downloadsVolume.claim,
});
// ... rest of chart
}
```
### Step 4: Create ArgoCD Application (if new namespace)
If creating a new namespace, add ArgoCD app in `src/cdk8s/src/resources/argo-applications/yournamespace.ts`:
```typescript
import { Chart } from "cdk8s";
import { Application } from "../../generated/imports/argoproj.io.ts";
import { createArgoApplication } from "./common.ts";
export function createYourNamespaceApplication(chart: Chart) {
return createArgoApplication(chart, "yournamespace", {
chart: {
repoUrl: "https://chartmuseum.tailnet-1a49.ts.net",
chartName: "yournamespace",
},
destination: {
namespace: "yournamespace",
},
});
}
```
Then register in `src/cdk8s/src/cdk8s-charts/apps.ts` and add to `HELM_CHARTS` in `.dagger/src/helm.ts`.
## Advanced Patterns
### Multiple Containers (Sidecar Pattern)
```typescript
// Main container
deployment.addContainer(
withCommonLinuxServerProps({
image: `...`,
portNumber: 8080,
}),
);
// Metrics sidecar
deployment.addContainer(
withCommonProps({
name: "exporter",
image: `...`,
ports: [{ number: 9090, name: "metrics" }],
securityContext: {
ensureNonRoot: true,
readOnlyRootFilesystem: true,
user: 65534,
group: 65534,
},
}),
);
```
### Prometheus ServiceMonitor
```typescript
import { ServiceMonitor } from "../../generated/imports/monitoring.coreos.com.ts";
new ServiceMonitor(chart, "yourservice-monitor", {
metadata: {
name: "yourservice-monitor",
labels: { release: "prometheus" },
},
spec: {
endpoints: [{ port: "metrics", interval: "60s", path: "/metrics" }],
selector: { matchLabels: { app: "yourservice" } },
},
});
```
### 1Password Secrets
```typescript
import { OnePasswordItem } from "../../generated/imports/onepassword.com.ts";
const secrets = new OnePasswordItem(chart, "yourservice-secrets", {
spec: {
itemPath: "vaults/xxx/items/yyy",
},
});
// Use in container
envVariables: {
API_KEY: EnvValue.fromSecretValue({
secret: Secret.fromSecretName(chart, "api-key", secrets.name),
key: "password",
}),
},
```
### Public Access via Funnel
```typescript
new TailscaleIngress(chart, "yourservice-ingress", {
service,
host: "yourservice",
funnel: true, // Accessible from public internet
});
```
## Directory Structure
```text
src/cdk8s/src/
├── cdk8s-charts/
│ ├── media.ts # Media namespace chart
│ ├── home.ts # Home namespace chart
│ ├── postal.ts # Postal namespace chart
│ └── ... # Other namespace charts
├── resources/
│ ├── torrents/ # Sonarr, Radarr, qBittorrent
│ ├── media/ # Plex, Tautulli, etc.
│ ├── home/ # Home Assistant
│ ├── mail/ # Postal mail server
│ └── argo-applications/ # ArgoCD app definitions
└── helm/
├── media/ # Media Helm chart
├── home/ # Home Helm chart
└── ... # Other Helm charts
```
## Key Files
- `src/cdk8s/src/cdk8s-charts/media.ts` - Media namespace chart
- `src/cdk8s/src/cdk8s-charts/home.ts` - Home namespace chart
- `src/cdk8s/src/resources/torrents/sonarr.ts` - Reference example
- `src/cdk8s/src/resources/media/plex.ts` - Complex example with sidecars
- `.dagger/src/helm.ts` - HELM_CHARTS list of all charts
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.