Skip to content

jsonnet libraries to generate kubernetes manifests

Notifications You must be signed in to change notification settings

5pi/jsonnet-libs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonnet-lib

jsonnet libraries to generate Kubernetes manifests and Dockerfiles.

The focus here is more personal and homelab infrastructure but it should be adoptable to production environments.

Status

  • Experimental, everything is subject to change
  • Don't expect this to work for your setup out the box..
  • ..but the experiment is to see if it's possible to make this work for your personal setup as well so...
  • PRs to make it work for your use cases are very welcome!

Usage

Conventions

  • _config is used for configuration

Stack

  • set of applications fullfilling a single purpose
  • yields a map with application name and application

Examples:

  • Monitoring: ./stacks/monitoring.jsonnet
  • Home Automation: ./stacks/home-automation.jsonnet
  • Minecraft

Application

  • a service / application and all dependencies like database setup, ingress configuration, configmaps

Examples:

  • Prometheus: ./apps/prometheus
  • home-assistant: ./apps/home_assistant

Example hierarchy

<5pi-home> +--[zfs]---(zfs-local-pv)
           |    +---- (zfs-storage-classes)
           +--[monitoring]--(prometheus)
           |       +--------(grafana)
           |       +--------(node-exporter)
           |       +--------(blackbox-exporter)
           +--[home-automation]--(home-assistant)
                   +-------------(zwave2mqtt)
  • <> site
  • [] stack
  • () app

El cheapo tests

Running ./test will use test/*.jsonnet to generate manifests in test/*/ and fail if there is a diff to what is committed. If you're happy with the changes, commit them to make the test pass.

Open Questions

  • Use mixins or functions for lib
  • Do these abstractions make sense?
  • Is it okay best practice wise to use 'half a stack' by hiding apps?
  • Name of this lib causes: WARN: cannot link 'github.com/5pi/jsonnet-libs' to '/Users/johannes_ziemke/private/home/vendor/jsonnet-libs', because package 'github.com/grafana/jsonnet-libs' already uses that name. The absolute import still works

About

jsonnet libraries to generate kubernetes manifests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published