-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30b3c42
commit b0cb7b8
Showing
1 changed file
with
67 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Usage Examples | ||
|
||
The following commands will process all the [template resources](https://github.com/kelseyhightower/confd/wiki/Template-Resources) found under `/etc/confd/conf.d`. | ||
|
||
### Poll the etcd cluster in 30 second intervals | ||
|
||
The "/production" string will be prefixed to keys when querying etcd at http://127.0.0.1:4001. | ||
|
||
```Bash | ||
confd -interval 30 -prefix '/production' -node 'http://127.0.0.1:4001' | ||
``` | ||
|
||
Note: the prefix will be stripped off key names before they are passed to source templates. | ||
|
||
### Same as above in noop mode | ||
|
||
```Bash | ||
confd -interval 30 -prefix '/production' -node 'http://127.0.0.1:4001' -noop | ||
``` | ||
|
||
See [Noop mode](noop-mode.md) | ||
|
||
### Single run without polling | ||
|
||
Using default settings run one time and exit. | ||
|
||
``` | ||
confd -onetime | ||
``` | ||
|
||
### Client authentication | ||
|
||
Same as above but authenticate with client certificates. | ||
|
||
``` | ||
confd -onetime -client-key /etc/confd/ssl/client.key -client-cert /etc/confd/ssl/client.crt | ||
``` | ||
|
||
### Lookup etcd nodes using SRV records | ||
|
||
``` | ||
dig SRV _etcd._tcp.confd.io | ||
... | ||
;; ANSWER SECTION: | ||
_etcd._tcp.confd.io. 300 IN SRV 1 50 4001 etcd0.confd.io. | ||
_etcd._tcp.confd.io. 300 IN SRV 2 50 4001 etcd1.confd.io. | ||
``` | ||
|
||
``` | ||
confd -srv-domain example.com -etcd-scheme https | ||
``` | ||
|
||
confd would connect to the nodes at `["https://etcd0.confd.io:4001", "https://etcd1.confd.io:4001"]` | ||
|
||
See [Using etcd SRV Records](dns-srv-records.md) | ||
|
||
### Enable verbose logging. | ||
|
||
Sometimes you need more details on what's going. Try running confd in verbose mode. | ||
|
||
```Bash | ||
confd -verbose | ||
``` | ||
|
||
You can get even more output with the `-debug` flag | ||
|
||
See [Logging Guide](logging.md) |