Skip to content

jsa4000/homelab-ops

Repository files navigation

Homelab

License Docs GitHub stars GitHub last commit OS Kubernetes Distribution Release pre-commit Schedule - Renovate Super-Linter


📖  Overview

A repository to create a cluster to be used as homelab.

🔧  Tools

Below are some of the tools I find useful.

Tool Purpose
ansible Configuration management tool and simple IT automation system
Renovate Automatically finds new releases for the applications and issues corresponding PR's
TaskFile Task runner/build tool that aims to be simpler and easier to use than GNU Make.
pre-commit A framework for managing and maintaining multi-language pre-commit hooks.
kubesearch Look for how other people manage their Self-hosted software on k8s-at-home community
mkdocs material Static website generator for all my docs in this repo
Age Simple, modern and secure file encryption tool, format, and Go library.
yamlfmt Extensible command line tool or library to format yaml files.
prettier Opinionated code formatter, that enforces a consistent style
markdownlint Static analysis tool to enforce standards and consistency for Markdown files.
super-linter A collection of linters and code analyzers, to help validate your source code.

Pre-Commit

Installation can be made using pip install or a package manager such as homebrew.

# Install via homebrew
brew install pre-commit

Install the git-hooks scripts, be sure .pre-commit-config.yaml configuration fle has been created in the root folder.

# Install
pre-commit install

Now pre-commit will run automatically on git commit.

MkDocs

Installation can be made using pip install or a package manager such as homebrew.

# Install via homebrew
brew install mkdocs

Initialize a project using mkdocs

# Create a mkdocs project
mkdocs new .

Install MkDocs plugin dependencies

# Install dependencies (use --break-system-packages or create python environment)
pip3 install -r .github/mkdocs/requirements.txt --break-system-packages

Serve the website content on a local server

mkdocs serve

# Serve using specific config file location
mkdocs serve -f .github/mkdocs/mkdocs.yml

Renovate

Go to Renovate install the app into the account.

TaskFile

Task offers many installation methods, so package manager such as homebrew can be used.

# Install via homebrew
brew install go-task

Get all current tasks

# List all available task to run
task -l

# 'task -l' can be set as default task tu run
task

 # Combination of task for initialization
task init

Setup pre-commit using TaskFile.

# Init pre-commit hooks
task precommit:init

# Update pre-commit dependencies
task precommit:update

Check linting and formatting before commit.

# Format and Lint
task format:all
task lint:all

Run following task to install dependencies using homebrew

# Run 'init' task within brew include file.
task brew:init
# Install ansible dependencies
task ansible:init

# Check the inventory server statuses (staging)
task ansible:ping ANSIBLE_INVENTORY_ENV=staging

# Install kubernetes (staging)
task ansible:install ANSIBLE_INVENTORY_ENV=staging

# Merge Kube config
task ansible:config ANSIBLE_INVENTORY_ENV=staging

# Uninstall Kubernetes (staging)
task ansible:uninstall ANSIBLE_INVENTORY_ENV=staging

Super-Lint

You can run super-linter outside GitHub Actions.

# Run docker image using linux/amd64, since there is no arm64 support.
docker run \
  -e DEFAULT_WORKSPACE=/tmp/lint \
  -e LOG_LEVEL=DEBUG \
  -e RUN_LOCAL=true \
  -e SHELL=/bin/bash \
  -e DEFAULT_BRANCH=main \
  -e ANSIBLE_DIRECTORY=infrastructure/ansible \
  -e VALIDATE_ALL_CODEBASE=true \
  -e VALIDATE_YAML=true \
  -e VALIDATE_MARKDOWN=true \
  -e VALIDATE_JSON=true \
  -e VALIDATE_TERRAFORM_TFLINT=true \
  -e VALIDATE_RENOVATE=true \
  -e YAML_CONFIG_FILE=.yamllint.yaml \
  -v $PWD:/tmp/lint \
  --platform linux/amd64 \
  ghcr.io/super-linter/super-linter:slim-v6.3.0

Star History

Star History Chart