Giter Site home page Giter Site logo

hivenetes / k8s-bootstrapper Goto Github PK

View Code? Open in Web Editor NEW
247.0 7.0 52.0 23.87 MB

Bootstrapping a Production-Ready DigitalOcean Kubernetes Cluster Using Terraform and Argo CD

License: MIT License

HCL 100.00%
digitalocean kubernetes terraform argocd k8s devops infrastructure-as-code gitops-framework grafana loki

k8s-bootstrapper's Introduction

Kubernetes Bootstrapper: An Extendable Framework to Set Up Production-Grade Clusters

Introduction

"Production-grade" is a loaded term. What constitutes production readiness will vary according to your use case. While a Kubernetes cluster is production-ready the moment it is ready to serve traffic, there is a commonly agreed set of minimum requirements, as shown in the infographic below.

k8s-prod

With many cloud-native solutions popping up daily, it can be pretty daunting for engineers and organizations to choose the "right" tools to build their tech. Integrating them to get to day-2 operations ready in Kubernetes becomes all the more challenging.

Kubernetes Bootstrapper

The k8s-bootstrapper project is a customizable and extendable framework that aims to solve this problem by leveraging

  • Terraform: Compose a production-ready infrastructure on DigitalOcean
  • Argo CD: Application configuration management and delivery using GitOps

This project integrates popular battle-tested open-source software and solutions that provide a production-grade out-of-box Kubernetes experience.

 Target Audience

  • Kubernetes adopters
  • Startups/SMBs who are looking to speed up the Kubernetes adoption
  • Builders and curious souls

k8s-bootstrapper


 Overview

.
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md 
├── argocd # Argo CD configurations (optional)
├── bootstrap # cluster bootstrapping using Argo CD
├── docs # documents and assets
├── infrastructure # infrastructure automation using Terraform
└── observability # set up observability stack 

 Bootstrap the Kubernetes Cluster

Follow the guide in the order stated below:

  1. DigitalOcean Infrastructure Automation via Terraform
  2. Bootstrapping using Argo CD
  3. Set up Observability using Robusta

Here is the overview of the architecture that we will set up:

boot-overview

 Note: Intended for experimentation/evaluation only. You will be responsible for all infrastructure costs incurred by the used resources.

 Tear down the Bootstrapped Cluster

Had fun trying out the k8s-bootstrapper? Time to say goodbye!

# Run
cd infrastructure/terraform
terraform destroy --var-file=bootstrapper.tfvars --auto-approve
# Bye Bye!

Demos

k8s-bootstrapper in action

 Media

 Shout-out

This project takes inspiration from the fantastic work done by Alex Jones of Cloud Native Skunkworks.

k8s-bootstrapper's People

Contributors

diabhey avatar duskow4do avatar shivamkj avatar xllauca avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

k8s-bootstrapper's Issues

If ArgoCD is disabled, the outputs will fail

Error:

│ Error: Invalid index
│
│   on outputs.tf line 39, in output "argocd_helm_chart_values":
│   39:   value = helm_release.argocd[0].values
│     ├────────────────
│     │ helm_release.argocd is empty tuple
│
│ The given key does not identify an element in this collection value: the collection has no elements.
╵
╷
│ Error: Invalid index
│
│   on outputs.tf line 43, in output "argocd_helm_chart_manifest":
│   43:   value = helm_release.argocd[0].manifest
│     ├────────────────
│     │ helm_release.argocd is empty tuple
│
│ The given key does not identify an element in this collection value: the collection has no elements.

Also the comment saying that ArgoCD is disabled by default since the chart doesn't work isn't true.

Use `ServerSideApply` instead of `Replace` for Kyverno

I am guessing that one of the Kyverno CRDs was too big to fit into kubectl.kubernetes.io/last-applied-configuration annotation that is added by kubectl apply, causing the Application sync to fail, leading to the use of Replace: true. This sync option has the potential to be destructive and might lead to resources having to be recreated, which could cause an outage.

There's support for ServerSideApply now, which addresses the original issue and removes the potentially destructive syncs. Try using this instead:

apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
  ...
  syncPolicy:
    syncOptions:
    - ServerSideApply=true

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.