Apps and Services
TrueNAS SCALE Apps
Section titled “TrueNAS SCALE Apps”Kubernetes-Based App Architecture
Section titled “Kubernetes-Based App Architecture”TrueNAS SCALE uses a Kubernetes-based application framework. Apps run as Helm charts deployed into a Lightweight Kubernetes cluster managed by TrueNAS. This provides:
- Container orchestration (restart policies, health checks)
- Service discovery and networking
- Persistent storage via iX volumes (backed by ZFS datasets)
- Resource limits (CPU, memory)
- Rollback capabilities
App Catalog
Section titled “App Catalog”TrueNAS SCALE provides two app catalogs:
| Catalog | Source | Update Frequency | Trust Level |
|---|---|---|---|
| Official | TrueNAS/iXsystems | Regular | High — tested by iXsystems |
| Community | Community-contributed | Variable | Medium — review before deploying |
| Custom | Your own charts | Manual | Depends on source |
Installing Apps
Section titled “Installing Apps”- Navigate to Apps → Settings → Ensure the app pool and configuration are set.
- Select the desired app from the catalog.
- Configure the app settings (storage, networking, environment variables).
- Deploy.
Custom Apps
Section titled “Custom Apps”For applications not in the catalog, deploy custom Docker Compose or Helm charts:
- Navigate to Apps → Launch → Custom App.
- Choose “Docker Compose” or “Helm Chart.”
- Paste the compose file or Helm values.
- Configure storage and network settings.
- Deploy.
# Example Docker Compose for a custom appservices: myapp: image: myapp:latest ports: - "8080:8080' volumes: - type: volume source: myapp-data target: /data environment: - TZ=UTC - LOG_LEVEL=infoCommon Self-Hosted Apps
Section titled “Common Self-Hosted Apps”Media Server (Plex/Jellyfin)
Section titled “Media Server (Plex/Jellyfin)”Plex is a commercial media server with client apps for virtually every platform. Jellyfin is The open-source alternative.
TrueNAS configuration:
- Install Plex or Jellyfin from the app catalog.
- Create a dataset for media:
tank/media/movies``tank/media/tv``tank/media/music. - Configure storage mounts in the app settings to point to the media datasets.
- Set the container’s PUID/PGID to match the user that owns the media files.
- For hardware transcoding (Plex Pass), configure GPU passthrough.
Key considerations:
- Transcoding requires significant CPU or GPU resources. An Intel QuickSync GPU or NVIDIA Quadro/Tesla is recommended.
- Direct play (no transcoding) requires no CPU/GPU and is preferred. Ensure your media is in a format compatible with your clients (H.264/H.265, AAC audio).
- Metadata databases should be stored on SSD-backed datasets for fast library scanning.
Nextcloud
Section titled “Nextcloud”Nextcloud is a self-hosted file sync, collaboration, and communication platform.
TrueNAS configuration:
- Install Nextcloud from the app catalog.
- Create a dataset for Nextcloud data:
tank/apps/nextcloud/data. - Create a database (MariaDB/PostgreSQL). Either as a separate app or using the built-in SQLite.
- Configure the database connection in Nextcloud’s environment variables.
- Set up a reverse proxy (Traefik or Nginx Proxy Manager) for HTTPS.
Key considerations:
- Nextcloud’s performance is heavily dependent on database performance. Use PostgreSQL on an SSD for best results.
- For large deployments, enable Redis caching and PHP OPcache.
- Regularly update Nextcloud — security updates are frequent.
Home Assistant
Section titled “Home Assistant”Home Assistant is an open-source home automation platform.
TrueNAS configuration:
- Install Home Assistant from the app catalog.
- Create a dataset for configuration and data persistence.
- Ensure the container has access to the host network (required for device discovery).
- For Zigbee/Z-Wave USB dongles, pass through the USB device to the container.
Vaultwarden
Section titled “Vaultwarden”Vaultwarden is a lightweight, self-hosted Bitwarden-compatible password manager.
TrueNAS configuration:
- Install Vaultwarden from the app catalog.
- Create a dataset for data persistence.
- Set up HTTPS via a reverse proxy (required for Bitwarden clients).
- Enable WebSocket notifications (WebSocket support in the reverse proxy config).
- Configure automated backups of the Vaultwarden data directory.
Grafana + Prometheus Stack
Section titled “Grafana + Prometheus Stack”For monitoring your TrueNAS and other systems:
- Install the “Prometheus + Grafana” stack from the app catalog.
- Configure Prometheus to scrape TrueNAS metrics (node exporter, SMART metrics).
- Create Grafana dashboards for NAS health, storage capacity, and performance.
- Set up alerting rules for disk failures, temperature, capacity thresholds.
Virtual Machines
Section titled “Virtual Machines”VM Configuration on TrueNAS
Section titled “VM Configuration on TrueNAS”TrueNAS SCALE supports KVM-based virtual machines with full hardware virtualization.
Key settings:
| Setting | Recommendation | Notes |
|---|---|---|
| CPU | 2+ vCPUs | Pin to specific cores for performance |
| Memory | 4 GB+ | Use dynamic memory if workload varies |
| Disk | ZVOL | Use volblocksize=64K or 128K |
| Network | VirtIO | VirtIO is fastest; use e1000 only for legacy OS |
| Boot firmware | UEFI | Required for modern OS (Windows 11, Linux) |
| Graphics | VNC or SPICE | SPICE provides better performance |
GPU Passthrough
Section titled “GPU Passthrough”GPU passthrough allows a VM to directly access a physical GPU, enabling hardware acceleration for Gaming, ML workloads, or transcoding.
Requirements:
- CPU and motherboard must support IOMMU (Intel VT-d or AMD-Vi).
- GPU must support UEFI mode (NVIDIA GTX 900+ or AMD RX 400+).
- Enable IOMMU in BIOS and add kernel parameters to TrueNAS.
- The GPU must not be used by the host (no host display output from the passed-through GPU).
Configuration steps:
# Enable IOMMU (add to TrueNAS kernel parameters)# For Intel: intel_iommu=on iommu=pt# For AMD: amd_iommu=on iommu=pt
# Verify IOMMU groupsdmesg | grep -i iommu
# Check which devices are in each IOMMU groupfind /sys/kernel/iommu_groups/ -type l | sort
# In the VM configuration:# 1. Select the GPU from the "PCIe" device list# 2. Enable "ROM BAR" for GPU firmware# 3. Add the GPU's audio device (HD Audio) as wellVirtIO Drivers
Section titled “VirtIO Drivers”VirtIO is the paravirtualized I/O framework for KVM. It provides near-native I/O performance by Eliminating the overhead of emulating hardware devices.
| Device | VirtIO Driver | Windows Driver Source |
|---|---|---|
| Network | VirtIO Network | virtio-win ISO from Fedora |
| Disk | VirtIO Block or VirtIO SCSI | virtio-win ISO |
| Balloon | VirtIO Balloon | virtio-win ISO |
| RNG | VirtIO RNG | Built-in |
| GPU | VirtIO GPU | Built-in (Spice Guest Tools) |
:::info For Windows VMs, download the virtio-win ISO from the Fedora project and attach it as a CD-ROM drive during installation. Install the VirtIO drivers before installing Windows, or use the e1000 network driver temporarily and switch to VirtIO after driver installation. :::
Networking for Apps
Section titled “Networking for Apps”Network Modes
Section titled “Network Modes”| Mode | Behavior | Use Case |
|---|---|---|
| Bridge | App gets its own IP on a virtual network | Most apps, isolation |
| Host | App shares the host’s network stack | Apps that need host-level access |
| Custom | User-defined network with specific subnet | Multi-app communication |
| DHCP | App gets an IP from the network DHCP server | Most apps |
| Static | App gets a manually assigned IP | Apps accessed by fixed address |
Port Management
Section titled “Port Management”Each app’s port must be unique on the host. If two apps both want port 8080, one must be remapped:
# Remap port 8080 to 8081services: app1: ports: - '8081:8080' # Host port 8081 maps to container port 8080Reverse Proxy (Traefik)
Section titled “Reverse Proxy (Traefik)”A reverse proxy provides:
- Single entry point: All apps accessible via the same host with different paths or subdomains.
- TLS termination: HTTPS for all apps with automatic certificate management (Let’s Encrypt).
- Load balancing: Distribute traffic across multiple app instances.
Refer to the dedicated Traefik guide for TrueNAS Traefik configuration.
Storage for Apps
Section titled “Storage for Apps”iX Volumes
Section titled “iX Volumes”IX volumes are TrueNAS-managed persistent storage volumes backed by ZFS datasets. When you configure Storage for an app, TrueNAS creates a ZFS dataset at the specified path and mounts it into the Container.
Host Path Volumes
Section titled “Host Path Volumes”Host path volumes mount an existing ZFS dataset directly into the container. This provides:
- Full control over the dataset properties (compression, snapshots, encryption)
- Direct access to the data from the host system
- Ability to use ZFS snapshots and replication for app data backup
Storage Best Practices
Section titled “Storage Best Practices”- Separate datasets per app: This allows per-app snapshot policies and quota management.
- Use SSD-backed datasets for databases and metadata: SQLite, PostgreSQL, and metadata directories benefit from SSD latency.
- Enable snapshots on app data datasets: This allows point-in-time recovery of app data.
- Set quotas: Prevent a single app from consuming all available storage.
App Data Persistence
Section titled “App Data Persistence”What Needs to Be Persistent
Section titled “What Needs to Be Persistent”| Data Type | Persistence Required | Backup Strategy |
|---|---|---|
| Configuration files | Yes | Snapshot or file backup |
| Databases | Yes | ZFS snapshot + replication |
| Media libraries | Yes | Snapshot + cloud sync |
| Application logs | Optional | Log rotation, short retention |
| Cache/temp data | No | Use ephemeral storage |
| Container images | No | Re-downloaded on deploy |
Backup App Data
Section titled “Backup App Data”# Snapshot app data before updatingzfs snapshot tank/apps/nextcloud/data@pre-update-$(date +%Y%m%d)
# After update, if everything works:# The snapshot is kept as a restore point
# If the update breaks something:zfs rollback tank/apps/nextcloud/data@pre-update-20240101App Troubleshooting
Section titled “App Troubleshooting”Common Issues
Section titled “Common Issues”| Issue | Likely Cause | Solution |
|---|---|---|
| App won’t start | Port conflict, missing storage, image pull failure | Check logs, verify config |
| App starts but is unreachable | Network misconfiguration, firewall | Check port mapping, DNS |
| App crashes after update | Data migration issue, config change | Check logs, rollback snapshot |
| Slow performance | Storage on HDD, insufficient resources | Move to SSD, increase CPU/RAM |
| Cannot connect to database | Database not ready, wrong credentials | Wait for DB to initialize, verify |
Checking Logs
Section titled “Checking Logs”# View app logs via kubectl (TrueNAS SCALE)kubectl logs -n ix-apps deployment/<app-name>
# View all pods in the apps namespacekubectl get pods -n ix-apps
# View app statusmidclt call chart.release.queryUpdating Apps
Section titled “Updating Apps”- Check the app’s changelog for breaking changes before updating.
- Snapshot the app’s data dataset.
- Update the app via the TrueNAS web interface.
- Verify the app is functioning correctly after the update.
- If the update breaks the app, rollback using the snapshot.
Common Pitfalls
Section titled “Common Pitfalls”Using Host Network Mode Unnecessarily
Section titled “Using Host Network Mode Unnecessarily”Host network mode eliminates network isolation between the container and the host. This can cause Port conflicts (two apps trying to bind the same port) and security issues. Use bridge mode with Port mapping unless the app specifically requires host networking (e.g., Home Assistant for device Discovery).
Not Setting Resource Limits
Section titled “Not Setting Resource Limits”Without resource limits, a single misbehaving app can consume all available CPU and memory, Affecting other apps and the TrueNAS host itself. Always set CPU and memory limits appropriate for The app’s expected usage.
Storing Database Data on HDDs
Section titled “Storing Database Data on HDDs”Databases (MySQL, PostgreSQL, SQLite) perform many small random I/O operations. HDDs handle random I/O at 100–200 IOPS, while SSDs handle 50,000–100,000 IOPS. A Nextcloud instance with its database On an HDD will feel sluggish. Always store database data on SSD-backed datasets.
Ignoring App Security Updates
Section titled “Ignoring App Security Updates”Self-hosted apps frequently receive security updates. Ignoring these updates leaves known Vulnerabilities exposed to the network. Subscribe to security advisories for your critical apps and Apply updates promptly. Use the TrueNAS app catalog’s “Available Updates” notification.
Not Backing Up App Configuration
Section titled “Not Backing Up App Configuration”App data snapshots protect the data, but configuration (environment variables, network settings, Custom configurations) may be stored separately. Export and version-control your app configurations So they can be recreated after a disaster.
Container Orchestration in TrueNAS SCALE
Section titled “Container Orchestration in TrueNAS SCALE”Kubernetes Architecture on TrueNAS
Section titled “Kubernetes Architecture on TrueNAS”TrueNAS SCALE runs a lightweight Kubernetes cluster under the hood. Apps are deployed as Helm Releases into this cluster. Understanding the K8s architecture helps with troubleshooting:
graph TD
A[TrueNAS SCALE Web UI] --> B[iX Apps Controller]
B --> C[Kubernetes API Server]
C --> D[Helm Controller]
D --> E[App Chart Release]
E --> F[Pod 1]
E --> G[Pod 2]
E --> H[Service]
H --> I[Ingress / Traefik]Inspecting App Resources
Section titled “Inspecting App Resources”# List all pods in the apps namespacekubectl get pods -n ix-apps
# Describe a specific pod (for troubleshooting)kubectl describe pod -n ix-apps <pod-name>
# View app logskubectl logs -n ix-apps <pod-name> --tail=100
# View app eventskubectl get events -n ix-apps --sort-by=.lastTimestamp
# List all Helm releaseshelm list -n ix-apps
# Get Helm values for an apphelm get values -n ix-apps <release-name>Resource Limits Configuration
Section titled “Resource Limits Configuration”Every app should have resource limits configured to prevent resource starvation:
# Example resource configuration in Helm valuesresources: requests: cpu: "250m'' memory: "256Mi' limits: cpu: "2000m'' memory: "2048Mi'| Resource | Request vs Limit | Recommendation |
|---|---|---|
| CPU request | Guaranteed minimum | 10–25% of typical usage |
| CPU limit | Maximum allowed | 2–4x typical usage (allow bursts) |
| Memory request | Guaranteed minimum | Match typical usage |
| Memory limit | Maximum allowed (OOM if exceeded) | 1.5–2x typical usage |
Detailed App Configurations
Section titled “Detailed App Configurations”Plex Media Server
Section titled “Plex Media Server”Recommended storage layout:
tank/ media/ movies/ # Movie library tv/ # TV show library music/ # Music library photos/ # Photo library apps/ plex/ config/ # Plex configuration and metadata transcode/ # Transcode cache directory (SSD-backed)Performance tuning:
- Set the transcode directory to an SSD-backed dataset. Transcoding generates many small temporary files that benefit from SSD latency.
- Allocate sufficient memory (2–4 GB depending on library size).
- Enable hardware transcoding if available (Intel QuickSync or NVIDIA GPU).
- Set
PLEX_MEDIA_SERVER_USE_HARDWARE transcodingenvironment variable. - Schedule library scans during off-peak hours to reduce I/O impact.
GPU passthrough for Plex:
# In the app's Helm values, add GPU device allocationextraEnv: - name: PLEX_MEDIA_SERVER_USE_HARDWARE value: "true''hostGPU: true# Or for specific GPU:# nodeSelector:# gpu: "true"Nextcloud
Section titled “Nextcloud”Database selection:
| Database | Performance | Complexity | Recommendation |
|---|---|---|---|
| SQLite (built-in) | Poor for large installs | None | Small/personal only |
| MariaDB | Good | Moderate | Medium installs |
| PostgreSQL | Best | Moderate | Large installs |
PostgreSQL tuning for Nextcloud:
# Create PostgreSQL as a separate app# Tune for Nextcloud workload:shared_buffers = 256MB # 25% of available RAMeffective_cache_size = 768MB # 75% of available RAMmax_connections = 100 # Default is 100, may need increasework_mem = 16MB # Per-connection memory for sortsRedis cache configuration:
# Add Redis for file locking and cachingredis: enabled: true resources: limits: memory: "128Mi'Home Assistant
Section titled “Home Assistant”Integration with TrueNAS:
- Install Home Assistant from the app catalog.
- Create a dedicated dataset:
tank/apps/homeassistant/. - Configure USB device passthrough for Zigbee/Z-Wave dongles.
- Use the TrueNAS integration for monitoring NAS health within Home Assistant.
USB passthrough configuration:
# In the app's Helm valuesextraVolumes: - name: usb-zigbee hostPath: path: /dev/serial/by-id/usb-Silicon_Labs_CP2102extraVolumeMounts: - name: usb-zigbee mountPath: /dev/ttyUSB0Grafana + Prometheus Stack
Section titled “Grafana + Prometheus Stack”Prometheus configuration for TrueNAS:
# Add TrueNAS as a scrape targetscrape_configs: - job_name: "truenas'' static_configs: - targets: ["truenas.local:9100'] # node-exporter - job_name: "smartmon'' static_configs: - targets: ["truenas.local:9633'] # smartmon-exporterGrafana dashboard for TrueNAS:
Key panels to include:
- Pool capacity gauge per pool
- Pool I/O throughput (read/write) time series
- ARC hit ratio and size time series
- Disk temperature heatmap
- SMART health status table (error counts, wear level)
- Network interface throughput
- CPU and memory utilization
- Replication lag indicator
Vaultwarden
Section titled “Vaultwarden”Security hardening:
- Enable HTTPS via reverse proxy (Traefik or Nginx).
- Enable WebSocket support for real-time sync.
- Configure automated backups of the vaultwarden data directory.
- Restrict admin panel access to specific IP ranges.
- Enable rate limiting to prevent brute-force attacks.
# Vaultwarden security configurationextraEnv: - name: DOMAIN value: "https://vault.example.com'' - name: WEBSOCKET_ENABLED value: "true' - name: SHOW_PASSWORD_HINT value: "false'' - name: LOG_FILE value: "/data/vaultwarden.log' - name: LOG_LEVEL value: "warn'' - name: ADMIN_TOKEN valueFrom: secretKeyRef: name: vaultwarden-secret key: admin-tokenVM Management on TrueNAS
Section titled “VM Management on TrueNAS”VM Creation Best Practices
Section titled “VM Creation Best Practices”| Setting | Recommendation | Notes |
|---|---|---|
| CPU | Pin to specific cores | Reduces latency from scheduler migration |
| Memory | Use balloon driver | Allows dynamic memory adjustment |
| Disk | ZVOL with volblocksize=64K | Better performance than file-backed disk |
| Network | VirtIO | 10x faster than emulated e1000 |
| Boot | UEFI with OVMF | Required for modern OS |
| Graphics | QXL or VirtIO-GPU | Use SPICE for best remote display |
| TPM | Software TPM (swtpm) | Required for Windows 11 |
VM Storage Options
Section titled “VM Storage Options”| Option | Performance | Flexibility | Use Case |
|---|---|---|---|
| ZVOL | Best | Low (fixed size) | Production VMs, databases |
| File-backed disk image | Good | High (thin provision) | Development VMs |
| Virtio-FS | Best for shared files | Medium | Shared data between host and VM |
VM Network Configuration
Section titled “VM Network Configuration”| Mode | Behavior | Use Case |
|---|---|---|
| VirtIO | Paravirtualized NIC, best performance | Most VMs |
| E1000 | Emulated Intel NIC, broad compatibility | Legacy OS, PXE boot |
| SR-IOV | Direct PCI passthrough of VF | High-performance networking |
VM Backup Strategy
Section titled “VM Backup Strategy”- ZFS snapshot the ZVOL before making changes to the VM.
- Use
zfs sendto replicate the VM”s ZVOL to a backup pool. - Export the VM configuration from the TrueNAS web UI and store it alongside the ZVOL snapshot.
- To restore: Import the ZVOL, recreate the VM with the exported configuration, and attach the ZVOL.
Networking for Apps - Advanced
Section titled “Networking for Apps - Advanced”Custom Docker Compose Networking
Section titled “Custom Docker Compose Networking”# Custom Docker Compose with explicit network configurationservices: myapp: image: myapp:latest networks: - app-network ports: - '8080:8080'
database: image: postgres:15 networks: - internal-network
networks: app-network: driver: bridge internal-network: driver: bridge internal: true # No external accessDNS Resolution for Apps
Section titled “DNS Resolution for Apps”TrueNAS provides internal DNS resolution for apps via CoreDNS. Apps can reference each other by Service name:
# App A can connect to App B using the service name# In App A's configuration:# DATABASE_HOST: app-b-service# This resolves to the internal IP of App B's podService Discovery
Section titled “Service Discovery”TrueNAS Kubernetes cluster uses CoreDNS for service discovery. Services are accessible via:
<service-name>.ix-apps.svc.cluster.local(full FQDN)<service-name>(within the same namespace)
App Security Considerations
Section titled “App Security Considerations”Running Apps as Non-Root
Section titled “Running Apps as Non-Root”By default, many Docker containers run as root. For security:
# Run as non-root usersecurityContext: runAsUser: 1000 runAsGroup: 1000 fsGroup: 1000Network Policies
Section titled “Network Policies”Use Kubernetes NetworkPolicies to restrict traffic between apps:
apiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata: name: restrict-database-access namespace: ix-appsspec: podSelector: matchLabels: app: database policyTypes: - Ingress ingress: - from: - podSelector: matchLabels: app: myapp ports: - port: 5432Secret Management
Section titled “Secret Management”Do not store secrets in plain text in Helm values. Use Kubernetes secrets:
# Create a secret from the command linekubectl create secret generic myapp-secret \ --from-literal=password='my-password' \ -n ix-apps
# Reference in Helm valuesextraEnv: - name: DATABASE_PASSWORD valueFrom: secretKeyRef: name: myapp-secret key: passwordTroubleshooting Common Issues
Section titled “Troubleshooting Common Issues”App Fails to Start
Section titled “App Fails to Start”# 1. Check pod statuskubectl get pods -n ix-apps | grep <app-name>
# 2. If pod is in CrashLoopBackOff or Error:kubectl logs -n ix-apps <pod-name> --previous
# 3. If pod is in ImagePullBackOff:kubectl describe pod -n ix-apps <pod-name># Check if the image exists and is accessible
# 4. If pod is pending:kubectl describe pod -n ix-apps <pod-name># Check for insufficient resources or taintsApp Storage Issues
Section titled “App Storage Issues”# Check if the dataset is mounted in the containerkubectl exec -it -n ix-apps <pod-name> -- df -h
# Check if the dataset has the correct permissionsls -la /mnt/tank/apps/<app-name>/
# Check if the dataset has snapshots that need releasingzfs list -o name,used,usedbysnapshots -r tank/apps/<app-name>App Network Issues
Section titled “App Network Issues”# Check service endpointskubectl get endpoints -n ix-apps <service-name>
# Check if the app is listening on the expected portkubectl exec -it -n ix-apps <pod-name> -- netstat -tlnp
# Check DNS resolutionkubectl exec -it -n ix-apps <pod-name> -- nslookup <other-service>Advanced App Deployment
Section titled “Advanced App Deployment”Custom App Development
Section titled “Custom App Development”For applications not in the TrueNAS catalog, develop and deploy custom apps:
# Directory structure for a custom appcustom-app/ Chart.yaml # Helm chart metadata values.yaml # Default values templates/ deployment.yaml # Kubernetes deployment template service.yaml # Kubernetes service template _helpers.tpl # Template helpers app/ Dockerfile # Application Dockerfile main.py # Application code requirements.txt # Python dependenciesHelm Chart.yaml
Section titled “Helm Chart.yaml”apiVersion: v2name: my-custom-appversion: 0.1.0description: "TrueNAS SCALE uses a Kubernetes-based application framework. Apps run as Helm charts deployed into a Lightweight Kubernetes cluster managed by TrueNAS. This..."type: applicationappVersion: "1.0.0'maintainers: - name: Your Namekeywords: - custom - python - apihome: https://github.com/yourusername/my-custom-appvalues.yaml
Section titled “values.yaml”image: repository: ghcr.io/yourusername/my-custom-app tag: latest pullPolicy: IfNotPresent
resources: requests: cpu: 100m memory: 128Mi limits: cpu: 500m memory: 512Mi
service: type: ClusterIP port: 8080
ingress: enabled: false className: "'' annotations: {} hosts: [] tls: []
persistence: enabled: true size: 1Gi storageClass: "' accessMode: ReadWriteOnceApplication Networking Patterns
Section titled “Application Networking Patterns”Service Discovery
Section titled “Service Discovery”TrueNAS apps can communicate with each other using Kubernetes service names:
# App A connects to App B# In App A's values.yaml:config: DATABASE_URL: "postgres://postgres-service:5432/mydb''# Kubernetes resolves "postgres-service" to the internal ClusterIP# This works within the same namespace (ix-apps)External Access Configuration
Section titled “External Access Configuration”For apps that need external access:
# Option 1: NodePort (simple, limited)service: type: NodePort nodePort: 30080 # Access via <node-ip>:30080
# Option 2: LoadBalancer (if supported)service: type: LoadBalancer port: 80
# Option 3: Ingress + Traefik (recommended for production)ingress: enabled: true className: traefik annotations: traefik.ingress.kubernetes.io/router.entrypoints: web traefik.ingress.kubernetes.io/router.tls: "true" hosts: - host: myapp.example.com paths: - path: /Application Data Management
Section titled “Application Data Management”Backup Strategies for App Data
Section titled “Backup Strategies for App Data”# Create periodic snapshots of app datasetszfs snapshot tank/apps/nextcloud/data@auto-daily-$(date +%Y%m%d)
# Retention: keep last 30 daily snapshotszfs list -t snapshot -o name -S creation -r tank/apps/nextcloud/data | tail -n +31 | xargs -n1 zfs destroy
# For databases, use ZFS replication to a remote systemzfs send -Rcv tank/apps/postgres/data@auto-daily-$(date +%Y%m%d) | ssh backup-nas zfs recv -F backup/apps/postgres/dataData Migration Between Apps
Section titled “Data Migration Between Apps”When upgrading or replacing an app:
- Snapshot the current app”s data dataset.
- Clone the snapshot to a temporary location.
- Deploy the new app with a reference to the cloned data.
- Verify the new app can read the data.
- Destroy the temporary clone after verification.
# Snapshot current datazfs snapshot tank/apps/old-app/data@pre-migration
# Clone for the new appzfs clone tank/apps/old-app/data@pre-migration tank/apps/new-app/data
# After verification, clean upzfs promote tank/apps/new-app/datazfs destroy tank/apps/old-app/data@pre-migrationApplication Security Hardening
Section titled “Application Security Hardening”Network Policies
Section titled “Network Policies”# Restrict app network accessapiVersion: networking.k8s.io/v1kind: NetworkPolicymetadata: name: restrict-database-access namespace: ix-appsspec: podSelector: matchLabels: app: postgres policyTypes: - type: Ingress ingress: - from: - podSelector: matchLabels: app: webappPod Security Standards
Section titled “Pod Security Standards”# Pod security context (add to values.yaml)podSecurityContext: runAsNonRoot: true runAsUser: 1000 fsGroup: 1000 seccompProfile: type: RuntimeDefaultSummary
Section titled “Summary”This topic covers the essential concepts and techniques related to apps and services, including key principles and practical applications.
Key concepts include:
- core concepts and definitions
- key principles and frameworks
- practical applications
- common techniques and methods
- evaluation and critical analysis
A thorough understanding of these concepts, combined with regular practice and review, is essential for mastery of this topic.
Worked Examples
Section titled “Worked Examples”Worked examples demonstrating the application of key concepts are covered in the detailed sub-pages linked above.