Skip to content

Instantly share code, notes, and snippets.

View hermannolafs's full-sized avatar
☸️

Hermann Ólafsson hermannolafs

☸️
View GitHub Profile
@hermannolafs
hermannolafs / main.tf
Last active October 29, 2024 14:45
terraform cert manager crds and helm chart install
# It's recommended to install this before the chart
# This is part of bootstrapping a cluster,
# but you probably should not be doing it this way, dingus
data "http" "cm_crds" {
url = "https://github.com/cert-manager/cert-manager/releases/download/v${var.cert_manager_version}/cert-manager.crds.yaml"
}
locals {
crd_map = {
@hermannolafs
hermannolafs / helm.tf
Last active October 18, 2024 11:45
Terraform which bootstraps Cert Manager CRDs, Cert Manager helm chart and Traefik using the Kubernetes and Helm providers
##########################################
# Cert manager
##########################################
data "http" "cert_manager_crds" {
url = "https://github.com/cert-manager/cert-manager/releases/download/v${var.cert_manager_version}/cert-manager.crds.yaml"
}
locals {
cert_manager_crds = {
@hermannolafs
hermannolafs / release.yaml
Created October 29, 2024 12:28
GitHub action to build and push container and helm chart to ghcr.io
name: Example of building a container and it's relevant helm chart, and pushing to container registry
on:
release:
types: [ published ]
permissions:
contents: read
jobs:
@hermannolafs
hermannolafs / Makefile
Created November 27, 2024 13:00
AWK Makefile help message,
.DEFAULT_GOAL := help
.PHONY: help
help: ## This help message
@awk -F '[, ]+' '/^[a-zA-Z0-9_-]+:.*##/ { \
target = $$0; \
sub(/^[ \t]*/, "", target); \
sub(/:.*##/, "##", target); \
split(target, parts, "##"); \
gsub(/^[ \t]*|[ \t]*$$/, "", parts[1]); \
@hermannolafs
hermannolafs / Makefile
Created February 11, 2025 09:22
make command to convert .env to .env.fish (with --global)
convert-env-file-to-fish: ## take the existing .env and convert to fish format in .env.fish
@awk '{ split($$1, a, "="); printf "set -gx %s \"%s\"\n", a[1], a[2]; }' .env > .env.fish