Remplacement diagrammes PDF par PNG, ajout note Docker Swarm, traductions complètes
- Replace PDF diagrams with PNG images for inline display in docs - Add infrastructure diagram to Homelab actuel category page - Add network diagram to single-machine HA homelab page - Add Docker Swarm vs Kubernetes decision note in docker-compose page - Complete English translations for homepage tagline - Translate homepage tagline dynamically using Docusaurus i18n - Remove PDF diagram files from static assets (homelab-actuel-infra.pdf, homelab-futur-network.pdf) - Add new documentation pages: Docker Compose, Ansible playbooks, Traefik - Add Future Homelab pages: single-machine HA and 3-node Proxmox cluster - Remove example pages and notions category - Update sidebar configuration
This commit is contained in:
parent
cb1640c1cc
commit
ed2cca8c0e
27 changed files with 1482 additions and 636 deletions
|
|
@ -0,0 +1,95 @@
|
|||
---
|
||||
sidebar_position: 3
|
||||
---
|
||||
|
||||
# Docker and Docker Compose
|
||||
|
||||
:::info
|
||||
Full English translation coming soon.
|
||||
:::
|
||||
|
||||
Docker is a **containerization platform** that allows packaging applications and their dependencies into lightweight and isolated containers.
|
||||
|
||||
## What is Docker?
|
||||
|
||||
A container is a standardized software unit that contains:
|
||||
- The application itself
|
||||
- All its dependencies (libraries, runtime, system tools)
|
||||
- An isolated filesystem
|
||||
- Environment variables and configuration
|
||||
|
||||
**Difference with virtual machines**:
|
||||
- **Container**: Shares the host OS kernel, starts in seconds, very lightweight (~MB)
|
||||
- **VM**: Emulates a complete OS, starts in minutes, heavier (~GB)
|
||||
|
||||
## Docker Compose: Simplified orchestration
|
||||
|
||||
Docker Compose is an **orchestration tool** for defining and managing multi-container applications.
|
||||
|
||||
### Why Docker Compose?
|
||||
|
||||
- **Declarative configuration**: Everything defined in a `compose.yml` file
|
||||
- **Grouped management**: Start/stop all services with one command
|
||||
- **Automatic networks**: Containers communicate easily between them
|
||||
- **Persistent volumes**: Simple storage management
|
||||
- **Environment variables**: Flexible configuration via `.env` files
|
||||
|
||||
## Configuration examples
|
||||
|
||||
My Docker Compose stacks are available in the Ansible repository under `stacks/`. Key examples include:
|
||||
- **Traefik**: Advanced reverse proxy with two instances (public and private)
|
||||
- **Photoprism**: Application with database (app + DB)
|
||||
- **Mobilizon**: Multi-container application with multiple networks
|
||||
- **Vaultwarden**: Security-focused configuration
|
||||
|
||||
## Patterns and best practices
|
||||
|
||||
1. **External network `traefik_network`**: All services share a common Docker network
|
||||
2. **Traefik labels**: Dynamic configuration via Docker labels
|
||||
3. **Environment variables with .env files**: Secrets extracted from Compose files
|
||||
4. **Dual exposure**: local and production access for each service
|
||||
5. **Restart policies**: `unless-stopped` for resilience
|
||||
6. **Watchtower for monitoring**: Watchtower is used **only for notifications** of available image updates. Updates are performed **manually** to maintain control over changes. In the [Future Homelab](../homelab-futur/index.md), automated update management will be implemented via Renovate Bot integrated directly with Forgejo.
|
||||
|
||||
## Benefits for a homelab
|
||||
|
||||
- **Simplicity**: Readable and maintainable YAML files
|
||||
- **Performance**: Instant service startup, low overhead
|
||||
- **Flexibility**: Easy to add/remove services
|
||||
- **Rich ecosystem**: Docker Hub with thousands of ready-to-use images
|
||||
|
||||
## Why not Docker Swarm?
|
||||
|
||||
When considering the evolution of my infrastructure, **Docker Swarm** was evaluated as an alternative to Kubernetes for container orchestration.
|
||||
|
||||
### Docker Swarm: a tempting but outdated choice
|
||||
|
||||
**Advantages of Docker Swarm**:
|
||||
- Natively integrated with Docker (no additional installation)
|
||||
- Simpler configuration than Kubernetes
|
||||
- Gentler learning curve
|
||||
- Uses Docker Compose files directly (with some adaptations)
|
||||
- Less resource-intensive than Kubernetes
|
||||
|
||||
**Why I didn't choose it**:
|
||||
|
||||
1. **Kubernetes is the industry standard**: The vast majority of companies use Kubernetes in production. Learning K8S provides skills directly transferable to the professional world.
|
||||
|
||||
2. **Ecosystem and community**: Kubernetes benefits from a much richer ecosystem (Helm, operators, numerous DevOps tools) and a much larger community.
|
||||
|
||||
3. **Advanced features**: Kubernetes offers capabilities that Docker Swarm doesn't have:
|
||||
- More advanced rolling updates and rollbacks
|
||||
- Fine-grained resource management (CPU/RAM limits, requests)
|
||||
- More elaborate network policies
|
||||
- Native GitOps support (ArgoCD, Flux)
|
||||
- Better integrated distributed storage (CSI drivers)
|
||||
|
||||
4. **Evolution and support**: Docker Inc. has clearly oriented its development toward Kubernetes rather than Swarm. Swarm is maintained, but no longer evolves much.
|
||||
|
||||
5. **Learning objective**: My goal being to acquire modern DevOps skills, mastering Kubernetes is a better long-term investment.
|
||||
|
||||
**Conclusion**: Although Docker Swarm is simpler and sufficient for many homelabs, I preferred to invest directly in learning Kubernetes, which has become the essential standard for container orchestration.
|
||||
|
||||
:::note
|
||||
Detailed English translation of this page is in progress.
|
||||
:::
|
||||
|
|
@ -1,60 +0,0 @@
|
|||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Example
|
||||
|
||||
This is an example page in the Current Homelab category.
|
||||
|
||||
## Description
|
||||
|
||||
This page demonstrates how to document a service or configuration of the current homelab.
|
||||
|
||||
## Docker Compose Configuration
|
||||
|
||||
Example service configuration:
|
||||
|
||||
```yaml
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
example-service:
|
||||
image: nginx:latest
|
||||
container_name: example
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ./config:/etc/nginx/conf.d
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
## Ansible Playbook
|
||||
|
||||
Deployment example with Ansible:
|
||||
|
||||
```yaml
|
||||
---
|
||||
- name: Deploy example service
|
||||
hosts: homelab
|
||||
become: yes
|
||||
|
||||
tasks:
|
||||
- name: Copy docker-compose file
|
||||
copy:
|
||||
src: docker-compose.yml
|
||||
dest: /opt/example/docker-compose.yml
|
||||
|
||||
- name: Start the service
|
||||
command: docker-compose up -d
|
||||
args:
|
||||
chdir: /opt/example
|
||||
```
|
||||
|
||||
## Maintenance
|
||||
|
||||
Important maintenance points:
|
||||
|
||||
- Regular backups
|
||||
- Docker image updates
|
||||
- Log monitoring
|
||||
- Restore testing
|
||||
|
|
@ -15,17 +15,31 @@ My current homelab uses a simple and effective approach:
|
|||
|
||||
## Architecture
|
||||
|
||||
### Infrastructure Diagram
|
||||
|
||||
The diagram illustrates the complete architecture of my current homelab, including:
|
||||
- Network infrastructure with the main server
|
||||
- Deployed Docker services
|
||||
- Traefik configuration for the reverse proxy (public and private instances)
|
||||
- Connections between different components
|
||||
- Local DNS configuration with dnsmasq
|
||||
|
||||

|
||||
|
||||
### Physical/Virtual Infrastructure
|
||||
- Dedicated servers or VMs
|
||||
- Secure local network
|
||||
- Storage and backups
|
||||
- Ubuntu Server dedicated server
|
||||
- Secure local network with local DNS (dnsmasq)
|
||||
- Unified storage with MergerFS
|
||||
- Firewall with firewalld
|
||||
|
||||
### Tech Stack
|
||||
- **OS**: Linux (Debian/Ubuntu)
|
||||
- **OS**: Linux (Ubuntu Server)
|
||||
- **Containerization**: Docker & Docker Compose
|
||||
- **Automation**: Ansible playbooks
|
||||
- **Reverse proxy**: Traefik or Nginx
|
||||
- **Monitoring**: Prometheus, Grafana
|
||||
- **Reverse proxy**: Traefik v3 (public and private instances)
|
||||
- **Security**: CrowdSec, TLS with Let's Encrypt
|
||||
- **Monitoring**: Beszel, Uptime Kuma
|
||||
- **Local DNS**: dnsmasq for resolving *.local.tellserv.fr
|
||||
|
||||
## Deployed Services
|
||||
|
||||
|
|
@ -41,18 +55,39 @@ The documentation details:
|
|||
- Simple to set up and maintain
|
||||
- Ansible enables complete automation
|
||||
- Docker Compose facilitates service management
|
||||
- Reproducible and versioned with Git
|
||||
- Ideal for progressive automation learning
|
||||
|
||||
## Limitations
|
||||
|
||||
- Limited scalability
|
||||
- No native high availability
|
||||
- Manual orchestration for certain tasks
|
||||
This infrastructure has several important limitations that motivate the evolution toward a new approach (see "Future Homelab" section).
|
||||
|
||||
These limitations motivate the evolution towards Kubernetes (see "Future Homelab" section).
|
||||
### Initial Absence of Git Versioning
|
||||
|
||||
## Articles
|
||||
One of the main limitations of this initial approach was the **absence of infrastructure versioning with Git**. At this stage of my journey, I had not yet mastered the DevOps philosophy and infrastructure code management best practices.
|
||||
|
||||
import DocCardList from '@theme/DocCardList';
|
||||
**Consequences of this limitation:**
|
||||
- No history of configuration changes
|
||||
- Difficult to roll back in case of problems
|
||||
- No traceability of modifications
|
||||
- Complex collaboration
|
||||
- Absence of code review process
|
||||
- Risk of divergence between documentation and reality
|
||||
|
||||
<DocCardList />
|
||||
This gap was an **important lesson** that led me to:
|
||||
1. Progressively correct this infrastructure by versioning Ansible playbooks and Docker Compose files
|
||||
2. Adopt Git and DevOps practices for all my future projects
|
||||
3. Integrate the "Infrastructure as Code" philosophy from the design phase
|
||||
|
||||
**Important note**: The Git repository [Infra_ansible_dockercompose](https://forgejo.tellserv.fr/Tellsanguis/Infra_ansible_dockercompose) was created **after the fact** to present the work done. In the initial practice, Git, automated tests, and CI/CD were not used due to lack of knowledge at the time.
|
||||
|
||||
Git versioning is now in place for this infrastructure, but the architecture itself remains limited (see below).
|
||||
|
||||
### Technical Architecture Limitations
|
||||
|
||||
- **Limited scalability**: Single-machine infrastructure without load distribution capability
|
||||
- **No high availability**: Single point of failure (SPOF)
|
||||
- **Manual orchestration**: Some tasks still require manual intervention
|
||||
- **Initially absent CI/CD**: Manual deployments via Ansible (no automation on Git push)
|
||||
- **Limited testing**: No automatic validation of changes before deployment
|
||||
|
||||
These limitations motivate the evolution toward Kubernetes (K3S) and a complete Infrastructure as Code approach with CI/CD (see [Future Homelab](../homelab-futur/index.md) section).
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
---
|
||||
sidebar_position: 2
|
||||
---
|
||||
|
||||
# Ansible Playbooks
|
||||
|
||||
:::info
|
||||
Full English translation coming soon.
|
||||
:::
|
||||
|
||||
Ansible is an open-source IT automation tool that enables configuration management, deployment, and infrastructure orchestration. In a homelab context, Ansible has become essential for maintaining reproducible and documented infrastructure.
|
||||
|
||||
## What is Ansible?
|
||||
|
||||
Ansible is an **Infrastructure as Code (IaC)** tool that allows you to:
|
||||
- **Automate** repetitive system administration tasks
|
||||
- **Standardize** configurations across multiple machines
|
||||
- **Document** infrastructure in executable format (code is documentation)
|
||||
- **Reproduce** identical environments easily
|
||||
- **Version** infrastructure with Git
|
||||
|
||||
## Project structure
|
||||
|
||||
My Ansible infrastructure is available:
|
||||
- **Online repository**: [https://forgejo.tellserv.fr/Tellsanguis/Infra_ansible_dockercompose](https://forgejo.tellserv.fr/Tellsanguis/Infra_ansible_dockercompose)
|
||||
|
||||
## Ansible roles
|
||||
|
||||
The infrastructure uses several roles:
|
||||
- **common**: Base system configuration, dnsmasq, firewalld, MergerFS
|
||||
- **cockpit**: Web admin interface
|
||||
- **docker**: Docker Engine installation and configuration
|
||||
- **services**: Docker stack deployment
|
||||
|
||||
## Secrets management
|
||||
|
||||
Secrets are encrypted with Ansible Vault and injected via Jinja2 templates into `.env` files.
|
||||
|
||||
## Benefits of this approach
|
||||
|
||||
1. **Reproducibility**: Infrastructure can be recreated identically in minutes
|
||||
2. **Living documentation**: Ansible code documents the infrastructure precisely
|
||||
3. **Complete automation**: No need to SSH for deployment or updates
|
||||
4. **Security**: Secrets are encrypted and never committed in plain text
|
||||
|
||||
## Current Limitations
|
||||
|
||||
Despite its many advantages, this approach has limitations:
|
||||
|
||||
1. **Late versioning**: The Git repository [Infra_ansible_dockercompose](https://forgejo.tellserv.fr/Tellsanguis/Infra_ansible_dockercompose) was created **after the fact** to present the work. In the initial practice, Git, automated tests, and CI/CD were not used due to lack of knowledge at the time.
|
||||
2. **No automated tests**: No automatic playbook validation (Molecule, integration tests)
|
||||
3. **Single-machine infrastructure**: Ansible is designed to manage multiple servers, but I only manage one
|
||||
4. **No CI/CD integration**: Deployments are manual, no automated pipeline
|
||||
|
||||
These limitations will be addressed in the [Future Homelab](../homelab-futur/index.md) with the adoption of Kubernetes and GitOps.
|
||||
|
||||
:::note
|
||||
Detailed English translation of this page is in progress.
|
||||
:::
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
sidebar_position: 4
|
||||
---
|
||||
|
||||
# Traefik - Modern Reverse Proxy
|
||||
|
||||
:::info
|
||||
This page will be completed soon with detailed Traefik configuration.
|
||||
:::
|
||||
|
||||
## Coming soon
|
||||
|
||||
- Detailed configuration of two Traefik instances (public and private)
|
||||
- SSL certificate management with Let's Encrypt
|
||||
- CrowdSec integration for security
|
||||
- Middleware configuration
|
||||
- Routing and domain management
|
||||
Loading…
Add table
Add a link
Reference in a new issue