Skip to content

Application Deployment

Aleksei Sviridkin edited this page Apr 22, 2025 · 1 revision

Application Deployment

This document explains how applications are structured and deployed in this cluster using the GitOps approach.

Application Structure

Applications in this repository are organized in two main directories:

  1. manifests/: Contains Kubernetes manifests for all applications
  2. argocd/: Contains ArgoCD application definitions that point to the manifests

Manifest Organization

The manifests/ directory is organized by application:

manifests/
├── cert-manager/       # Certificate management
├── csi-driver-nfs/     # NFS storage driver
├── estimator/          # Custom application
├── grafana-operator/   # Monitoring visualization
├── homeassistant/      # Home automation
├── job-countdown/      # Custom application
├── kubernetes-dashboard/ # Kubernetes management UI
├── mainsail/           # 3D printer interface
├── metallb/            # Load balancer
├── node-exporter/      # System metrics collection
├── nst/                # Custom application
├── papermc/            # Minecraft server
├── system-upgrade-controller/ # K3s upgrades
├── traefik/            # Ingress controller
└── transmission/       # BitTorrent client

Each application directory contains all the necessary resources for that application, such as:

  • Deployments/StatefulSets
  • Services
  • ConfigMaps/Secrets
  • PersistentVolumeClaims
  • Ingress/IngressRoutes

ArgoCD Application Definitions

Applications are defined in the argocd/ directory, organized by category:

argocd/
├── default/      # General applications
├── infra/        # Infrastructure components
├── meta/         # ArgoCD bootstrap
├── monitoring/   # Monitoring stack
├── smarthome/    # Home automation
└── workloads/    # User workloads

Each application is defined in a YAML file with this structure:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: app-name
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/lexfrei/k8s.git
    targetRevision: HEAD
    path: manifests/app-name
  destination:
    server: https://kubernetes.default.svc
    namespace: app-namespace
  syncPolicy:
    automated:
      prune: true
      selfHeal: true

Deployment Process

  1. Add Application Manifests:

    • Create a new directory in manifests/ for your application
    • Add all Kubernetes resource definitions
  2. Create ArgoCD Application:

    • Add an Application definition in the appropriate argocd/ directory
    • This will tell ArgoCD where to find the manifests and where to deploy them
  3. Commit and Push:

    • Commit changes to Git and push to the repository
    • ArgoCD automatically detects the changes and applies them
  4. Monitor Deployment:

    • ArgoCD UI shows the deployment status
    • Check application health and resource status

Example Applications

HomeAssistant (Smart Home)

Located in manifests/homeassistant/:

  • StatefulSet for persistent application
  • Service for network access
  • PVC for data storage
  • IngressRoute for web access

PaperMC (Game Server)

Located in manifests/papermc/:

  • Deployment for the Minecraft server
  • Service with specific ports
  • PVC for world data
  • ConfigMap for server properties

Application Categories

Applications in this cluster can be categorized as:

  1. Infrastructure: Components that support the cluster itself

    • MetalLB, Traefik, cert-manager, etc.
  2. System Tools: Management and monitoring tools

    • Kubernetes Dashboard, node-exporter, etc.
  3. Smart Home: Home automation applications

    • HomeAssistant
  4. Media/Entertainment: Media and game servers

    • PaperMC, Transmission

Documentation Links

Clone this wiki locally