Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.
/ konfigadm Public archive

konfigadm is a declarative configuration management tool and image builder focused on bootstrapping nodes for container-based environments.

License

Notifications You must be signed in to change notification settings

flanksource/konfigadm

Repository files navigation

InstallationKubernetesKey FeaturesCompatibilityDesignPrebuilt Images Full Documentation

konfigadm is a declarative configuration management tool and image builder focused on bootstrapping nodes for container based environments.

Usage

Usage:
  konfigadm [command]

Available Commands:
  apply       Apply the configuration to the local machine
  build-image Build a new image using the specified image and konfig
  cloud-init  Exports the configuration in cloud-init format
  help        Help about any command
  minify      Resolve all lookups and dependencies and export a single config file
  verify      Verify that the configuration has been applied and is in a healthy state
  version     Print the version of konfigadm

Flags:
  -c, --config strings   Config files in YAML or JSON format
  -d, --detect           Detect tags to use
  -h, --help             help for konfigadm
  -v, --loglevel count   Increase logging level
  -t, --tag strings      Runtime tags to use, valid tags: debian,ubuntu,redhat,rhel,fedora,redhat-like,debian-like,centos,aws,vmware
  -e, --var strings      Extra Variables to in key=value format

Installation

Binary

wget -O /usr/bin/konfigadm https://github.com/flanksource/konfigadm/releases/latest/download/konfigadm && chmod +x /usr/bin/konfigadm

Getting Started

Installing Kubernetes on the local machine

sudo konfigadm apply -c - <<-EOF
kubernetes:
  version: 1.21.2
container_runtime:
  type: docker
commands:
  - kubeadm init
EOF

asciicast

Building a kubernetes image

sudo konfigadm images build --image ubuntu1804 -c - <<-EOF
kubernetes:
  version: 1.21.2
container_runtime:
  type: docker
cleanup: true
EOF

Cloud Images are downloaded and then configured with --build-driver 2 drivers are supported:

  1. qemu (default) - Launches the image with KVM and attaches a cloud-init ISO to configure on boot
  2. libguestfs - Uses virt-customize to launch an appliance and chroot into the disk, does not require cloud-init in the image, but also cannot test/verify systemd based services due to the chroot.

asciicast

Features

  • Dependency Free and easily embeddable into an image builder.
  • Declarative, The order of operations cannot be changed, there are no implicit or explicit dependencies between items, no conditionals (besides for os/cloud tags) or control flows
  • Typed, can validate the configuration (e.g. docker image name is valid, systemd.unit file only includes valid keys, and the values are typed correctly)
  • Has built-in higher-order abstractions for kubernetes, containers, cri, cni, etc.
  • Supports multiple operating systems and package managers
  • Abstractions and many of the built-in elements are easily unit-testable due to the use of virtual filesystem and command execution list.
  • Automatic testing / verification based on intent, not just command success code
  • Generate cloud-init or shell scripts to be used by other systems

Compatibility

Compatibility is tested via the docker systemd images created by jrei, All example fixtures are first verified as false, applied, and then verified as true.

To run integration tests:

make ubuntu

TODO

  • Incremental mode
  • Merge duplicate command dependencies (e.g. installing curl)
  • Support templating everywhere (currently only supported in files)
  • Packer/QEMU/VirtualBox/Fusion drivers for building images
  • AMI/OVA Image upload
  • Multi-OS cleanup scripts for building images