Skip to main content

Kompos - k8s cloud automation

Project description

kompos

Build Status Docker pull License PyPI pyversions

kompos

Kompos is a configuration driven tool for provisioning and managing Kubernetes infrastructure across AWS and Azure. It uses a hierarchical folder structure and yaml files to store and generate configurations, with pluggable compositions that encapsulates the infrastructure code and state. Terraform and helmfile are supported as provisioners.

Below is a graphical representation of the data flow.

kompos-data-flow

Installation

NOTE: Only Python 3 is supported.

PyPI

pip install kompos

Locally for development

Using virtualenv

pip install virtualenv
virtualenv .env
source .env/bin/activate
(env) cd kompos/
(env) pip install --editable .

Hierarchical configuration

Kompos leverages himl to provide a hiera-like configuration structure.

Checkout the examples for more information.

Nix integration

With kompos you can leverage nix to pin your infrastructure code (i.e terraform & helmfile releases) on a specific version. This enables you to finely control your deployments and use different infrastructure versions per environment, cluster etc.

Prerequisites

Install nix and nix-prefetch-git.

$ curl -L https://nixos.org/nix/install | bash

$ nix-env -f '<nixpkgs>' -iA nix-prefetch-git

Configuration

The integration can be globally enabled or diabled with the flag nix: [true|false] and a disable overwrite with --no-nix argument. Below are the necessary parts of komposconfig regarding nix & versioning:

terraform:
  # This is the place to look for the terraform repo locally.
  # Used as the default if nix is not enabled.
  local_path: '/home/user/terraform-stack'

  # This is needed in case the modules are not in the root of the repo.
  root_path: 'src/terraform'

  repo:
    # This will be the name of the nix derivation for terraform.
    name: 'terraform-stack'

    # The repo we would like to version.
    url:  "git@github.com:my-org/terraform-stack.git"

# Likewise for helmfile.
helmfile:
  local_path: '/home/user/helmfile-releases'
  root_path: 'src/helmfiles'

  repo:
    name: 'helmfile-releases'
    url:  "git@github.com:my-org/helmfile-releases.git"

nix: true

And in the hierarchical configuration you'll need the following keys:

infrastructure:
  terraform:
    version: "0.1.0" # A git tag or a commit sha.

    # This is an optional field.
    # The sha256 hash of the repo provides data integrity and ensures that we
    # always get the same input.
    #
    # It can be omitted when you're using a tag that is periodically updated.
    # (e.g in a dev/nightly environment). Since this is a mandatory field for nix,
    # nix-prefetch-git will be used as a fallback to caclulate it.
    sha256: "ab9190b0ecc8060a54f1fac7de606e6b2c4757c227f2ce529668eb145d9a9516"

  # Likewise for helmfile.
  helmfile:
    version: "0.1.0"
    sha256: "139cd5119d398d06f6535f42d775986a683a90e16ce129a5fb7f48870613a1a5"

Docker Image

License

Apache License 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kompos-0.4.0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kompos-0.4.0-py3-none-any.whl (27.0 kB view details)

Uploaded Python 3

File details

Details for the file kompos-0.4.0.tar.gz.

File metadata

  • Download URL: kompos-0.4.0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for kompos-0.4.0.tar.gz
Algorithm Hash digest
SHA256 dddc4c4de866f25c9baefc54e28e5b2ae134d2feec87dfe64a24b40910e832ab
MD5 25c8df0370d194844e4984d8b65261ae
BLAKE2b-256 263a8bc13b4cb2f47263378b5e51347d1d5c30d74631d340720ac2ab8cd0519a

See more details on using hashes here.

File details

Details for the file kompos-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: kompos-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 27.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for kompos-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac99508eb15560f03dafe75b62d15eb9521f696521ff991557d8b85f3701494c
MD5 daef1eb1bac10047328179ad2d561ed6
BLAKE2b-256 e99caab45ce0b58b51d2b78764a6c6c0cf4a2f66f85c53e18ade0d428ac199a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page