-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update README to reflect new interface.
- Loading branch information
1 parent
1d73c10
commit 9df3887
Showing
1 changed file
with
11 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,34 +10,37 @@ ktmpl 0.1.0 | |
Produces a Kubernetes manifest from a parameterized template | ||
USAGE: | ||
ktmpl [FLAGS] <template> | ||
ktmpl [FLAGS] [OPTIONS] <template> [--] | ||
FLAGS: | ||
-h, --help Prints help information | ||
-V, --version Prints version information | ||
OPTIONS: | ||
-p, --parameter <parameter>... Key-value pair used to fill in the template's parameters in the format key=value | ||
ARGS: | ||
<template> Path to the template file to be processed | ||
``` | ||
|
||
## Usage | ||
|
||
Simply run `ktmpl TEMPLATE` where TEMPLATE is a path to a Kubernetes manifest template in YAML format. | ||
Run `ktmpl TEMPLATE` where TEMPLATE is a path to a Kubernetes manifest template in YAML format. | ||
The included [example.yml](example.yml) is a working example template. | ||
|
||
To provide values for template parameters, simply execute the program with matching environment variables set. | ||
To provide values for template parameters, use the `--parameter` option to supply key-value pairs. | ||
Using the provided example.yml, this would mean: | ||
|
||
``` bash | ||
MONGODB_PASSWORD=password ktmpl example.yml | ||
ktmpl example.yml --parameter MONGODB_PASSWORD=password | ||
``` | ||
|
||
Template parameters that have default values can be overridden with the same mechanism. | ||
|
||
The processed template will be output to stdout, suitable for piping into a `kubectl` command: | ||
|
||
``` bash | ||
MONGODB_PASSWORD=password ktmpl example.yml | kubectl create -f - | ||
ktmpl example.yml --parameter MONGODB_PASSWORD=password | kubectl create -f - | ||
``` | ||
|
||
## Installing ktmpl | ||
|
@@ -46,8 +49,9 @@ MONGODB_PASSWORD=password ktmpl example.yml | kubectl create -f - | |
|
||
1. Install the appropriate version of [Rust](https://www.rust-lang.org/) for your system. | ||
2. Run `git clone [email protected]:InQuicker/ktmpl.git`. | ||
3. Inside the freshly cloned repository, run `cargo build --release`. | ||
4. Copy the binary from `target/release/ktmpl` to a directory in your PATH, such as `/usr/local/bin`. | ||
3. Inside the freshly cloned repository, run `cargo install --path .`. | ||
|
||
Make sure Cargo's bin directory is added to your PATH environment variable. | ||
|
||
## Legal | ||
|
||
|