Giter Site home page Giter Site logo

k8s-gitops-3's Introduction

k8s-gitops - Home Cloud via Flux v2 | GitOps Toolkit

GitOps state for my cluster using flux v2

Discord test renovate update-flux

K3S multi-arch highly available cluster installed via Ansible on Proxmox VMs.

The cluster is designed to allow tearing it completely without any data lost.

Stack is ordered in multiple layers (Flux kustomizations) depending on the lower one (example apps depend on infrasteructure).

HW setup

  • 3x Intel NUC 11 vPro (NUC11TNHv5) with:
    • 11th Gen Intel® Core™ i5-1145G7 @ 2.60GHz
    • 32 GB DDR4
    • 250 GB Sata SSD for local disks - 2x Samsung SSD 850 EVO, 1x CT240BX500SSD1
    • 500 GB NVME for Ceph - WDC WDS500G1B0C-00S6U0
    • 2 Thunderbolt 4/3 connected as network mesh for ceph:
      • Node 1, Port 1 <-> Node 2, Port 1
      • Node 1, Port 2 <-> Node 3, Port 1
      • Node 2, Port 2 <-> Node 2, Port 2

Installation

Install / Update / Uninstall

Installed via Ansible. It creates the VMs for the 3 nodes

The cluster is designed to allow tearing the cluster completly without any data lost.

Secret Management

Master secret is stored in Ansible Vault.

Kubernetes passwords and secrets encrypted with mozilla SOPS which it is supported out of the box in Flux2.

GPG key is deployed via Ansible. Its hash must be kept in sync with .sops.yaml.

Based on Vaskozl I use a pre-commit hook to ensure that secrets are never pushed unencrypted. The hook is deployed by running cd scripts; ./install_git_hooks.sh

To encrypt files with secrets use:

sops -e -i my-secret.yaml # Initial encrypt
sops my-secret.yaml # To edit it directly in you $EDITOR

Useful commands

  • Delete stuck objects (PVs, PVCs)

    kubectl patch <object type> <object name> -p '{"metadata":{"finalizers": []}}' --type=merge
    
  • Delete stuck NSs

    NAMESPACE=your-rogue-namespace
    kubectl proxy &
    kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >/tmp/patch.json
    curl -k -H "Content-Type: application/json" -X PUT --data-binary @/tmp/patch.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize
    

🤝  Community

This cluster in inspired by the work of others shared at awesome-home-kubernetes, specially billimek´s setup.

There is also an active k8s@home Discord for this community.

k8s-gitops-3's People

Contributors

angelnu avatar nlamirault avatar raphapr avatar renovate-bot avatar renovate[bot] avatar stefanprodan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.