m9sweeper / kube-splat

Ansible playbook for installing and configuring kubernetes system components

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


πŸ“” Table of Contents

🌟 About the Project

kube-splat is responsible for installing infrastructure tools using ansible. It comes with an ansible role with a number of configurable tasks - just add your kubernetes cluster details and run a one-line command to install a suite of useful tools.

🎯 Features

kube-splat makes life very easy for organisations with:

  • Monitoring Solution
  • Logging Solution
  • Kubernetes Security Platform
  • Management and Issuance of TLS certificates
  • Metrics Server
  • Ingress-Nginx Controller
  • Descheduler

🧰 Toolbox

kube-splat makes it easy to orchestrate the implementation of a number of free security tools:

m9sweeper: Kubernetes Security Platform

kube-prometheus-stack: Monitoring Solution

loki-stack: Logging Solution

Cert Manager: Management and Issuance of TLS certificates

Metric Server: Metrics Server

Nginx Ingress: Ingress-Nginx Controller

Descheduler: Descheduler

‼️ Prerequisites

This project requires a Kubernetes Cluster and uses ansible-playbook as package manager

If you don't have a Kubernetes Cluster running, you can install one locally with Minikube using the following directions

Installing Kubernetes Locally with Minikube

Mac Installation

Install on Mac from the terminal using curl

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64
sudo install minikube-darwin-amd64 /usr/local/bin/minikube
Windows Installation

Install on Windows using chocolatey

choco install minikube
choco install git

Once Minikube is installed, run the following command to start up a local cluster

minikube start --cni calico --kubernetes-version=v1.23.16

You can check that the cluster was successfully created and is running using kubectl get pods --all-namespaces to see if default pods were created. For more information, check out the official minikube docs.

βš™οΈ Quick Installation

To install, first edit the following files to match the details of your Kubernetes cluster. If running a local Minikube cluster, the default values should suffice

Add/Modify common variables in all.yml

File path: group_vars/all.yml

Add/Modify cluster base variable in host_vars.

cat host_vars/minikube.yml
---
kube_context: minikube
k8s_cluster_name: minikube

Manage your cluster related details in inventories.

cat inventories/dev.yml
all:
  vars:
    kube_context: minikube
  hosts:
    localhost

Deploy on minikube

Once the details for your cluster have been filled in, just run the following command to set up everything

ansible-playbook deploy.yml -i inventories/dev.yml

Notes

Local Installation

When running against a local minikube cluster, some steps (m9sweeper, metrics-server, and nginx) may fail on a first time installation. This is expected, and they should run without issue after rerunning the playbook

Upgrading

kube-prometheus-stack

Many times upgrades will require updating the CRD's first. In the future it we plan to break CRD's into their own helm chart to alleviate this issue, but for now you will typically have to run commands such as these below (with the updated version number)

kubectl apply --server-side --force-conflicts -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml
kubectl apply --server-side --force-conflicts -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml
kubectl apply --server-side --force-conflicts -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml
kubectl apply --server-side --force-conflicts -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml
kubectl apply --server-side --force-conflicts -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml
kubectl apply --server-side --force-conflicts -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
kubectl apply --server-side --force-conflicts -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml
kubectl apply --server-side --force-conflicts -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.61.1/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml

πŸ‘‹ Contributing

The initial project was created by team members at Intelletive Consulting, but we hope others will contribute as well. Thanks goes to these wonderful people (emoji key):

Jacob Beasley
Jacob Beasley

πŸ’» πŸ“– πŸ”¬ πŸ“† πŸš‡
jasonWoodman
jasonWoodman

πŸ’» πŸ“– πŸ”¬ πŸ“† πŸš‡
charisprose
charisprose

πŸ’» ⚠️
Grant Keiner
Grant Keiner

πŸ’»
Sahil Narang
Sahil Narang
πŸ’» πŸš‡

This project follows the all-contributors specification. Contributions of any kind welcome!

⚠️ License

Distributed under the Apache License v2. See LICENSE.txt for more information.

🀝 Contact

Project Link: https://github.com/m9sweeper/kube-splat

About

Ansible playbook for installing and configuring kubernetes system components

License:Apache License 2.0


Languages

Language:Jinja 94.3%Language:Shell 5.7%