Code Monkey home page Code Monkey logo

gitops's Introduction

GitOps

ℹ️ Overview

This repository is a centralized source for all my Kubernetes clusters. It serves as sort of monorepository, which allows for workload definition and configuration reusability between clusters and environments. The point of this setup is to provide a single source for many (if not all) clusters which can share workload configurations, scripts, and other provisioning tools.

The point of this setup is to simplify cluster creation, management, and increase re-usability between clusters. All clusters defined in this repository should never be directly modified (using kubectl). All changes are made through commits/PRs to this repository. Each cluster will watch for changes to this repository and update accordingly (via FluxCD).

✨ FluxCD

FluxCD is used as the continuous and progressive delivery solution for watching the repository for changes and applying those changes to the cluster. The structure and use of this repository requires a basic understanding of FluxCD concepts. The following resources are recommended to get started with Flux:

💿 Environment Setup

Each cluster makes use of different scripts/methods for bootstrapping and working with the cluster. View the README.md file in the root of each cluster folder to understand how to work with that cluster.

The idea is to have every cluster in this repository easily repeatable. The cluster should be able to be torn down, re-created, and restored through simple commands.

:light: Philosophy

The following ideas, patterns, and philosophies are applied for clusters in this repository:

  • Reusability of workload definitions and configurations across clusters (change once).
  • Individual cluster behavior can be changed through the encrypted settings file see SOPs files section.
  • All cluster dependencies are stored in this repository.
  • Clusters only get updated through GitOps.

📂 Structure

The structure and setup of this repository is designed to allow for testable and trackable changes to be made to each cluster (by using Git). Each cluster has a documented bootstrapping process to allow for repeatable cluster initializations along with teardown and restore procedures. See the README.md file located in the root of each cluster for specific documentation on each cluster.

The following structure/convention is used:

📦gitops # repo root
 ┣ 📂base # contains all re-usable cluster workloads
 ┃ ┗ 📂example-workload # projects are grouped by client or other grouping
 ┃
 ┗ 📂clusters # contains all cluster definitions
   ┗ 📂my-cluster # root folder for "my-cluster"
     ┗ 📜README.md # see this file for all info on this cluster
     ┗ 📂staging # the staging environment for this cluster
     ┗ 📂production # the production environment for this cluster
       ┗ 📂workloads # defines all workloads for this cluster/environment
       ┗ 📂settings
         ┗ cluster-settings.sops.yaml # unique settings for cluster (encrypted with SOPS)

💻 Clusters

The following clusters are managed in this repository.

TODO

🔑 SOPs files

Since the entire state of the cluster is stored in this repository, it is necessary to encrypt certain information for a cluster( such as, passwords, SSH keys, etc.). FluxCD has various decryption providers (see docs here). Clusters in this repository use Mozilla SOPs with the age encryption tool.

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.