Add ssl options for etcd
Change-Id: I45afdf25d8d3ebc1ceab4a38d8cc61435fed1700
This commit is contained in:
parent
8642002cf8
commit
453e290495
2 changed files with 20 additions and 9 deletions
21
README.rst
21
README.rst
|
@ -38,15 +38,20 @@ Configure prometheus server
|
||||||
kubernetes:
|
kubernetes:
|
||||||
api_ip: ${_param:kubernetes_control_address}
|
api_ip: ${_param:kubernetes_control_address}
|
||||||
ssl_dir: /opt/prometheus/config
|
ssl_dir: /opt/prometheus/config
|
||||||
cert_name: kubelet-client.crt
|
cert_name: prometheus-server.crt
|
||||||
key_name: kubelet-client.key
|
key_name: prometheus-server.key
|
||||||
etcd:
|
etcd:
|
||||||
- host: ${_param:cluster_node01_address}
|
scheme: https
|
||||||
port: ${_param:cluster_node01_port}
|
ssl_dir: /opt/prometheus/config
|
||||||
- host: ${_param:cluster_node02_address}
|
cert_name: prometheus-server.crt
|
||||||
port: ${_param:cluster_node02_port}
|
key_name: prometheus-server.key
|
||||||
- host: ${_param:cluster_node03_address}
|
member:
|
||||||
port: ${_param:cluster_node03_port}
|
- host: ${_param:cluster_node01_address}
|
||||||
|
port: ${_param:cluster_node01_port}
|
||||||
|
- host: ${_param:cluster_node02_address}
|
||||||
|
port: ${_param:cluster_node02_port}
|
||||||
|
- host: ${_param:cluster_node03_address}
|
||||||
|
port: ${_param:cluster_node03_port}
|
||||||
recording:
|
recording:
|
||||||
- name: 'instance:fd_utilization'
|
- name: 'instance:fd_utilization'
|
||||||
query: >-
|
query: >-
|
||||||
|
|
|
@ -27,12 +27,18 @@ scrape_configs:
|
||||||
|
|
||||||
{% if server.get('target', {}).get('etcd') %}
|
{% if server.get('target', {}).get('etcd') %}
|
||||||
{%- set etcd_nodes = [] %}
|
{%- set etcd_nodes = [] %}
|
||||||
{%- for node in server.target.etcd %}
|
{%- set etcd_target = server.target.etcd %}
|
||||||
|
{%- for node in etcd_target.member %}
|
||||||
{%- set etcd_address = "'%s:%d'" | format(node.host, node.port) %}
|
{%- set etcd_address = "'%s:%d'" | format(node.host, node.port) %}
|
||||||
{%- do etcd_nodes.append(etcd_address) %}
|
{%- do etcd_nodes.append(etcd_address) %}
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- if etcd_nodes|length > 0 %}
|
{%- if etcd_nodes|length > 0 %}
|
||||||
- job_name: 'etcd'
|
- job_name: 'etcd'
|
||||||
|
{% if etcd_target.scheme %}scheme: {{ etcd_target.scheme }}{%- endif %}
|
||||||
|
tls_config:
|
||||||
|
insecure_skip_verify: true
|
||||||
|
{% if etcd_target.cert_name is defined %}cert_file: {{ etcd_target.ssl_dir }}/{{ etcd_target.cert_name }}{%- endif %}
|
||||||
|
{% if etcd_target.key_name is defined %}key_file: {{ etcd_target.ssl_dir }}/{{ etcd_target.key_name }}{%- endif %}
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: [{{ etcd_nodes | join(',') }}]
|
- targets: [{{ etcd_nodes | join(',') }}]
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
Loading…
Reference in a new issue