Skip to content

wilfb-debug/kubernetes-linkding-persistent-storage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Linkding with Persistent Storage

Kubernetes K3s Storage Stateful

Overview

This project demonstrates how to deploy a stateful application on Kubernetes using PersistentVolumeClaims (PVCs) to ensure data durability across pod restarts.

The application used is Linkding, a self-hosted bookmark manager, deployed into its own namespace with persistent SQLite storage.

This lab was built and tested locally using Rancher Desktop (K3s), following production-grade Kubernetes storage patterns.


Architecture Summary

  • Namespace isolation (linkding)
  • Deployment for application lifecycle management
  • Service for internal access
  • PersistentVolumeClaim (PVC) for durable storage
  • StorageClass: local-path (dynamic provisioning)

Key Kubernetes Concepts Demonstrated

1. Stateless vs Stateful Containers

  • Containers are ephemeral by default
  • Application data is lost when pods restart unless persisted externally

2. PersistentVolumeClaim (PVC)

  • Requests storage independently of pod lifecycle
  • Automatically provisioned via StorageClass
  • Bound to a PersistentVolume (PV)

3. Volume Mounting

  • PVC mounted into container at /etc/linkding/data
  • SQLite database persists across pod restarts

Repository Structure

.
├── manifests/
│   ├── linkding/
│   │   ├── linkding.yaml                # Deployment + Service (no storage)
│   │   └── linkding-with-storage.yaml   # PVC + Deployment + Service
│   └── nginx/                           # Earlier learning artifacts
├── screenshots/
│   ├── 01-pods-running.png
│   ├── 02-pvc-bound.png
│   ├── 02-describe-pvc.png
│   ├── 03-container-data-dir.png
│   ├── 03-sqlite-data-persisted.png
│   └── 04-linkding-ui.png
└── README.md

Deployment

# Create namespace
kubectl create namespace linkding

# Deploy with persistent storage
kubectl apply -f manifests/linkding/linkding-with-storage.yaml -n linkding

# Verify pods and PVC
kubectl get pods -n linkding
kubectl get pvc -n linkding

# Access Linkding UI
kubectl port-forward svc/linkding -n linkding 9090:9090

Open http://localhost:9090 in your browser.


Evidence

Pods Running

Pods Running

PVC Bound

PVC Bound

PVC Details

PVC Describe

Container Data Directory

Data Dir

SQLite Data Persisted

SQLite Persisted

Linkding UI

Linkding UI


What This Demonstrates

  • Kubernetes namespace isolation for workload separation
  • Stateful application deployment using PVCs
  • Dynamic storage provisioning via StorageClass
  • Production-grade volume mounting patterns
  • Data persistence validation across pod restarts

About

Deployed Linkding on local Kubernetes (Rancher Desktop/K3s) using namespaces, YAML manifests, Services, and PersistentVolumeClaims to persist SQLite data across pod restarts.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors