This repository is deprecated, please use https://github.com/xtruder/kubenix
Kubernetes deployment manager written in nix
Nix-kubernetes is deployment manager for kubernetes that users nixos module system to do declarative kubernetes configuration and deployment. By combining nix package manager and nix-kubernetes declarative cluster configuration it can do fully deterministic deployments from packages to configuration.
- nix (for installation instructions go to https://nixos.org/nix/)
$ nix-env -f https://github.com/xtruder/nix-kubernetes/archive/v0.25.1.tar.gz -iA package
Usage: bin/nix-kubernetes <command> [options]
Commands:
create <file> Create deployment
list List all known deployments
delete Delete deployment
describe Describes deployment
deploy Deploy configuration
config Manage deployment
run-job <name> Run distributed kubernetes job
gc Garbage collect resources (will only gc nix-kubernetes resources)
Options:
-c, --config path to configuration file [default: "~/.kube/nix-kubernetes.json"]
-h, --help Show help [boolean]
Examples:
bin/nix-kubernetes create -d name deploy.nix create deployment
bin/nix-kubernetes deploy -d name -n namespace --context my-cluster deploy resources
bin/nix-kubernetes deploy -d name --build-only only build
Deploy
nix-kubernetes deploy
Options:
-c, --config path to configuration file [default: "~/.kube/nix-kubernetes.json"]
-h, --help Show help [boolean]
-f, --file Use prebuild deployment file
-d, --deployment Deployment name
-n, --namespace Namespace to deploy
-i, --include Resources to include in deployment
-o, --output Output generated config to file
--context Kubernetes config context to use for deployment
--build-only only build
--dry-run dry run
--restart restart replication controllers
--rolling-update do a rolling update of a controller
--gc garbage collect resources (will only gc nix-kubernetes resources)
Examples:
nix-kubernetes deploy -d deployment -n namespace -i replicationcontrollers/gitlab --gc --context my-cluster
nix-kubernetes deploy -d deployment -n namespace -i services/mysql --dry-run
$ nix-kubernetes create -d gatehub deploy.nix
$ export NIX_PATH="services=/home/offlinehacker/projects/x-truder.net/services:$NIX_PATH"
$ nix-kubernetes deploy -d gatehub --build-only
$ nix-kubernetes deploy -d gatehub -n namespace --context my-cluster --gc
look into examples folder with example deployment configurations.
For a list of all options look into options.md
Repo with bundle of nix-kubernetes services is avalible on https://github.com/x-truder/services.
$ npm link
$ export PATH=~/.npm/bin:$PATH
$ nix-build -A staging --arg configuration deploy.nix
MIT © Jaka Hudoklin