Check https://github.com/anduintransaction/rivendell/releases
rivendell generate project.yml
to generate a project file. SeeConfiguration
section for more detail about how to configure a project.- Add your own kubernetes configuration files.
- Run
rivendell up project.yml
to create all resources. - Run
rivendell down project.yml
to destroy all resources. - Run
rivendell update project.yml
to update all resources other thanpod
orjob
. - Run
rivendell upgrade project.yml
to upgrade all resources, includingpod
andjob
. Thepods
andjobs
must be stopped before upgrading
The configuration format is YAML
Environment variables referenced with the $(...) notation within the configuration file will be replaced with the value of the environment variable, for instance:
namespace: $(KUBERNETES_NAMESPACE)
The configuration file also supports go-template
:
namespace: {{.namespace}}
Variables can be passed to the configuration file by command line flags:
rivendell up project.yml --variable namespace=my-namespace
Or using variable file:
rivendell up project.yml --variableFile varFile
Sample varFile
content:
namespace=my-namespace
If a variable key is specified more than once, the order of important is --variable
> variable file
> configuration file
> default value
rivendellVarNamespace
: Current kubernetes namespacerivendellVarContext
: Current kubernetes contextrivendellVarKubeConfig
: Current kubernetes config filerivendellVarRootDir
: Root directory of project
root_dir: .
namespace: coruscant
variables:
postgresTag: {{.postgresImageTag}}
redisTag: 4-alpine
postgresSidecarImage: postgres-sidecar:{{.appTag}}
redisSidecarImage: redis-sidecar:{{.appTag}}
resource_groups:
- name: configs
resources:
- ./configs/*.yml
excludes:
- ./configs/*ignore*
- name: secrets
resources:
- ./secrets/*.yml
- name: databases
resources:
- ./databases/*.yml
depend:
- configs
- secrets
- name: init-jobs
resources:
- ./jobs/*.yml
depend:
- databases
- name: services
resources:
- ./services/*.yml
depend:
- init-jobs
wait:
- name: init-postgres
kind: job
- name: init-redis
kind: job
delete_namespace: true
Key | Type | Description |
---|---|---|
root_dir | string | Root dir, relative to the configuration file. All kubernetes configuration files will be relative to this directory |
namespace | string | Kubernetes namespace, value from command line flag will override this value |
variables | map | Variables map, value from command line flags will override these values |
resource_groups | array | See Resource groups |
delete_namespace | string | Delete the namespace in down command or not |
Rivendell manages a graph of resource groups, with each group contains multiple resource files, and can depend on each others. If group A depends on group B, rivendell wait for all resources in group B to become ready before creating resources in group A. A resource is defined as ready when its kubernetes life cycle status is Active.
A resource group can also be configured to wait for some jobs or pods to complete.
Key | Type | Description |
---|---|---|
name | string | Name of the group |
resources | string array | List of resource files. See Resource files glob |
excludes | string array | List of excluded resources file |
depend | string array | List of groups this group depends on |
wait | array | See Waiting for pods or jobs |
A list of glob-based files can be add to resource group. Supported glob patterns are:
path/to/*.yml
matches allyml
files underpath/to
path/*/*.yml
matches allyml
files under subfolder ofpath
path/**/*.yml
matches allyml
files under any level of subfolder ofpath
A resource can be configured to wait for some pods or jobs to complete with:
wait:
- name: job1
kind: job
timeout: 300
- name: pod1
kind: pod