TritonDataCenter / node-triton

Triton client tool and node.js library
57 stars 39 forks source link

node-triton#316 cmon-certgen should generate an example prometheus.yml #317

Closed arekinath closed 3 years ago

arekinath commented 3 years ago

Testing done:

$ ./bin/triton profile cmon-certgen
Note: CMON uses authentication via client TLS certiificates.

This action will create a fresh private key which is written unencrypted to
disk in the current working directory. Copy these files to your cmon client
(whether Prometheus, or something else).

This key will be usable only for CMON. If your SSH key is removed from your
account, this CMON key will no longer work.

If you do not specifically want to use CMON, or want to set this up later,
you can answer "no" here.

Continue? [y/n] y

Generating CMON certificates for profile "env".

CMON authentication certificate and key have been placed in files
"cmon-xlex-cert.pem" and "cmon-xlex-key.pem".

An example Prometheus configuration file has also been written into
"cmon-xlex-prometheus.yml".

It can be used as-is for testing by running
  "prometheus --config.file=cmon-xlex-prometheus.yml"

The example config file:

global:
    scrape_interval: 15s
    scrape_timeout: 10s
    evaluation_interval: 15s
scrape_configs:
    - job_name: triton-xlex
      scheme: https
      tls_config:
          cert_file: cmon-xlex-cert.pem
          key_file: cmon-xlex-key.pem
      relabel_configs:
          - source_labels: [__meta_triton_machine_alias]
            target_label: alias
          - source_labels: [__meta_triton_machine_id]
            target_label: instance
      triton_sd_configs:
          - account: xlex
            dns_suffix: cmon.uqcloud.net
            endpoint: cmon.uqcloud.net
            version: 1
            tls_config:
                cert_file: cmon-xlex-cert.pem
                key_file: cmon-xlex-key.pem
bahamat commented 3 years ago

For this and for #315, put these in the changelog file and then bump the version in prep for publishing, then when it's merged I can publish a new version.

arekinath commented 3 years ago

Since #314 causes conflicts for this one in CHANGES.md (they both target the same blank line), I've rebased this one on top of it and added the release changes to this commit (for #316)

arekinath commented 3 years ago

I've also based #318 on top of this one