Skip to content

Commit

Permalink
Change flag name to metrics-address
Browse files Browse the repository at this point in the history
  • Loading branch information
bakins committed Jul 29, 2018
1 parent f8a7761 commit 3889705
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If you want to increase or decrease the amount of chaos change the interval betw

Remember that `chaoskube` by default kills any pod in all your namespaces, including system pods and itself.

`chaoskube` provides a simple HTTP endpoint that can be used to check that it is running. This can be used for [Kubernetes liveness and readiness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/). By default, this listens on port 8080. To disable, pass `--address=""` to `chaoskube`.
`chaoskube` provides a simple HTTP endpoint that can be used to check that it is running. This can be used for [Kubernetes liveness and readiness probes](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/). By default, this listens on port 8080. To disable, pass `--metrics-address=""` to `chaoskube`.

## Filtering targets

Expand Down
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var (
interval time.Duration
dryRun bool
debug bool
address string
metricsAddress string
)

func init() {
Expand All @@ -54,7 +54,7 @@ func init() {
kingpin.Flag("interval", "Interval between Pod terminations").Default("10m").DurationVar(&interval)
kingpin.Flag("dry-run", "If true, don't actually do anything.").Default("true").BoolVar(&dryRun)
kingpin.Flag("debug", "Enable debug logging.").BoolVar(&debug)
kingpin.Flag("address", "Listening address for health check handler").Default(":8080").StringVar(&address)
kingpin.Flag("metrics-address", "Listening address for metrics handler").Default(":8080").StringVar(&metricsAddress)
}

func main() {
Expand Down Expand Up @@ -153,13 +153,13 @@ func main() {
dryRun,
)

if address != "" {
if metricsAddress != "" {
http.HandleFunc("/healthz",
func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "OK")
})
go func() {
if err := http.ListenAndServe(address, nil); err != nil {
if err := http.ListenAndServe(metricsAddress, nil); err != nil {
log.WithFields(log.Fields{
"err": err,
}).Fatal("failed to start HTTP server")
Expand Down

0 comments on commit 3889705

Please sign in to comment.