Skip to content

Commit

Permalink
Update README to reflect new interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmycuadra committed Feb 24, 2016
1 parent 1d73c10 commit 9df3887
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 9df3887

Please sign in to comment.