blog_tech/docs/homelab-futur/exemple.md
Tellsanguis aba46f671c Amélioration configuration Docusaurus et implémentation i18n
- Add language switcher to navbar for bilingual site (FR/EN)
- Remove intro page, use presentation as entry point
- Add example pages to all documentation categories
- Configure categories with generated-index for page listings
- Update footer and homepage links to reference presentation
- Enhance configuration with best practices:
  - Add metadata and SEO keywords
  - Enable RSS/Atom feeds for blog
  - Configure sitemap generation
  - Add syntax highlighting for YAML, HCL, Docker
  - Enable Mermaid diagram support
  - Configure table of contents settings
  - Respect user color scheme preferences
  - Add last update metadata to docs
- Fix deprecated onBrokenMarkdownLinks configuration
- Create bilingual example pages with practical code examples
- Update all i18n translations for consistency

This update brings the site in line with Docusaurus 3.x best practices
and provides a solid foundation for documentation growth.
2025-11-15 15:00:45 +01:00

2.6 KiB

sidebar_position
2

Exemple

Ceci est une page d'exemple dans la catégorie Futur Homelab.

Description

Cette page démontre comment documenter les configurations et déploiements Kubernetes du futur homelab.

Déploiement Kubernetes

Exemple de manifeste pour un déploiement :

apiVersion: apps/v1
kind: Deployment
metadata:
  name: exemple-app
  namespace: production
spec:
  replicas: 3
  selector:
    matchLabels:
      app: exemple
  template:
    metadata:
      labels:
        app: exemple
    spec:
      containers:
      - name: app
        image: nginx:latest
        ports:
        - containerPort: 80
        resources:
          limits:
            cpu: 100m
            memory: 128Mi
          requests:
            cpu: 50m
            memory: 64Mi
---
apiVersion: v1
kind: Service
metadata:
  name: exemple-service
  namespace: production
spec:
  selector:
    app: exemple
  ports:
  - port: 80
    targetPort: 80
  type: ClusterIP

Configuration OpenTofu

Exemple de ressource infrastructure :

resource "kubernetes_namespace" "production" {
  metadata {
    name = "production"
    labels = {
      environment = "production"
      managed-by  = "opentofu"
    }
  }
}

resource "kubernetes_deployment" "exemple" {
  metadata {
    name      = "exemple-app"
    namespace = kubernetes_namespace.production.metadata[0].name
  }

  spec {
    replicas = 3

    selector {
      match_labels = {
        app = "exemple"
      }
    }

    template {
      metadata {
        labels = {
          app = "exemple"
        }
      }

      spec {
        container {
          image = "nginx:latest"
          name  = "app"

          resources {
            limits = {
              cpu    = "100m"
              memory = "128Mi"
            }
            requests = {
              cpu    = "50m"
              memory = "64Mi"
            }
          }
        }
      }
    }
  }
}

GitOps avec ArgoCD

Configuration ArgoCD Application :

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: exemple-app
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://forgejo.tellserv.fr/Tellsanguis/k8s-manifests.git
    targetRevision: HEAD
    path: apps/exemple
  destination:
    server: https://kubernetes.default.svc
    namespace: production
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
    - CreateNamespace=true

Observabilité

Points de surveillance pour ce service :

  • Métriques Prometheus exposées sur /metrics
  • Logs agrégés dans Loki
  • Traces distribuées avec Tempo
  • Alertes configurées dans Prometheus AlertManager