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
|
@ -38,9 +38,14 @@ Configure prometheus server
|
|||
kubernetes:
|
||||
api_ip: ${_param:kubernetes_control_address}
|
||||
ssl_dir: /opt/prometheus/config
|
||||
cert_name: kubelet-client.crt
|
||||
key_name: kubelet-client.key
|
||||
cert_name: prometheus-server.crt
|
||||
key_name: prometheus-server.key
|
||||
etcd:
|
||||
scheme: https
|
||||
ssl_dir: /opt/prometheus/config
|
||||
cert_name: prometheus-server.crt
|
||||
key_name: prometheus-server.key
|
||||
member:
|
||||
- host: ${_param:cluster_node01_address}
|
||||
port: ${_param:cluster_node01_port}
|
||||
- host: ${_param:cluster_node02_address}
|
||||
|
|
|
@ -27,12 +27,18 @@ scrape_configs:
|
|||
|
||||
{% if server.get('target', {}).get('etcd') %}
|
||||
{%- 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) %}
|
||||
{%- do etcd_nodes.append(etcd_address) %}
|
||||
{%- endfor %}
|
||||
{%- if etcd_nodes|length > 0 %}
|
||||
- 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:
|
||||
- targets: [{{ etcd_nodes | join(',') }}]
|
||||
{%- endif %}
|
||||
|
|
Loading…
Reference in a new issue