alertmanager/examples/ha/tls
Dustin Hooten ff85bec45b
Secure cluster traffic via mutual TLS (#2237)
* Add TLS option to gossip cluster

Co-authored-by: Sharad Gaur <sharadgaur@gmail.com>
Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* generate new certs that expire in 100 years

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Fix tls_connection attributes

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Improve error message

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Fix tls client config docs

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Add capacity arg to message buffer

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* fix formatting

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Update version; add version validation

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* use lru cache for connection pool

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* lock reading from the connection

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* when extracting net.Conn from tlsConn, lock and throw away wrapper

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* Add mutex to connection pool to protect cache

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

* fix linting

Signed-off-by: Dustin Hooten <dustinhooten@gmail.com>

Co-authored-by: Sharad Gaur <sharadgaur@gmail.com>
2021-08-09 14:58:06 -06:00
..
certs Secure cluster traffic via mutual TLS (#2237) 2021-08-09 14:58:06 -06:00
Makefile Secure cluster traffic via mutual TLS (#2237) 2021-08-09 14:58:06 -06:00
Procfile Secure cluster traffic via mutual TLS (#2237) 2021-08-09 14:58:06 -06:00
README.md Secure cluster traffic via mutual TLS (#2237) 2021-08-09 14:58:06 -06:00
tls_config_node1.yml Secure cluster traffic via mutual TLS (#2237) 2021-08-09 14:58:06 -06:00
tls_config_node2.yml Secure cluster traffic via mutual TLS (#2237) 2021-08-09 14:58:06 -06:00

README.md

TLS Transport Config Example

Usage

  1. Install dependencies:
    1. go install github.com/cloudflare/cfssl/cmd/cfssl
    2. go install github.com/mattn/goreman
  2. Build Alertmanager (root of repository):
    1. go mod download
    2. make build.
  3. make start (inside this directory).

Testing

  1. Start the cluster (as explained above)
  2. Navigate to one of the Alertmanager instances at localhost:9093.
  3. Create a silence.
  4. Navigate to the other Alertmanager instance at localhost:9094.
  5. Observe that the silence created in the other Alertmanager instance has been synchronized over to this instance.
  6. Repeat.