common
by krakazyabra
Function library for krakazyabra's microservices
About this chart
common
Function library for krakazyabra's microservices
Since a lot of charts follow the same pattern this library was built to reduce maintenance cost between the charts that use it and try achieve a goal of being DRY.
TL;DR
$ helm repo add krakazyabra https://krakazyabra.github.io/microservices/
$ helm repo update
$ helm install common krakazyabra/common
Creating a new chart
First be sure to checkout the many charts that already use this like MariaDB, PostgreSQL or the many others in this repository.
Include this chart as a dependency in your Chart.yaml e.g.
# Chart.yaml
dependencies:
- name: common
version: 0.1.13
repository: https://krakazyabra.github.io/microservices/
Write a values.yaml with some basic defaults you want to present to the user e.g.
# Default values for node-red.
image:
repository: ghcr.io/linuxserver/mariadb
pullPolicy: IfNotPresent
tag: version-110.4.20mariabionic
strategy:
type: Recreate
# See more environment varaibles in the node-red documentation
# https://nodered.org/docs/getting-started/docker
env: {}
# TZ:
# NODE_OPTIONS:
# NODE_RED_ENABLE_PROJECTS:
# NODE_RED_ENABLE_SAFE_MODE:
# FLOWS:
service:
port:
port: 3306
persistence:
data:
enabled: false
emptyDir: false
mountPath: /config
If not using a service, set the service.enabled to false.
...
service:
enabled: false
...
Add files to the templates folder.
# templates/common.yaml
{{ include "common.all . }}
# templates/NOTES.txt
{{ include "common.notes.defaultNotes" . }}
If testing locally make sure you update the dependencies with:
helm dependency update
Deploy common with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has common on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcommon is pinned at v0.1.13 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply