{%- set telegraf_address = "'%s:%d'" | format(node_ip, node_port) %}
{%- do telegraf_nodes.append(telegraf_address) %}
{%- endif %}
{%- endfor %}
{%- if telegraf_nodes|length > 0 %}
- job_name:'telegraf'
static_configs:
- targets:[{{telegraf_nodes | join(',') }}]
{%- endif %}
{% if server.get('target', {}).etcd is defined %}
{%- set etcd_nodes = [] %}
{%- for node in server.target.etcd %}
{%- 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'
static_configs:
- targets:[{{etcd_nodes | join(',') }}]
{%- endif %}
{%- endif %}
{% if server.get('target', {}).kubernetes is defined %}
- job_name:'kubernetes-api'
scheme:https
tls_config:
insecure_skip_verify:true
{% if server.target.kubernetes.cert_name is defined %}cert_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.cert_name }}{%- endif %}
{% if server.target.kubernetes.key_name is defined %}key_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.key_name }}{%- endif %}
kubernetes_sd_configs:
- api_server:{{server.target.kubernetes.api_ip }}
role:endpoints
tls_config:
insecure_skip_verify:true
{% if server.target.kubernetes.cert_name is defined %}cert_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.cert_name }}{%- endif %}
{% if server.target.kubernetes.key_name is defined %}key_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.key_name }}{%- endif %}
{% if server.target.kubernetes.cert_name is defined %}cert_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.cert_name }}{%- endif %}
{% if server.target.kubernetes.key_name is defined %}key_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.key_name }}{%- endif %}
kubernetes_sd_configs:
- api_server:{{server.target.kubernetes.api_ip }}
role:node
tls_config:
insecure_skip_verify:true
{% if server.target.kubernetes.cert_name is defined %}cert_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.cert_name }}{%- endif %}
{% if server.target.kubernetes.key_name is defined %}key_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.key_name }}{%- endif %}
relabel_configs:
- action:labelmap
regex:__meta_kubernetes_node_label_(.+)
- job_name:'kubernetes-service-endpoint'
scheme:https
tls_config:
insecure_skip_verify:true
{% if server.target.kubernetes.cert_name is defined %}cert_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.cert_name }}{%- endif %}
{% if server.target.kubernetes.key_name is defined %}key_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.key_name }}{%- endif %}
kubernetes_sd_configs:
- api_server:{{server.target.kubernetes.api_ip }}
role:endpoints
tls_config:
insecure_skip_verify:true
{% if server.target.kubernetes.cert_name is defined %}cert_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.cert_name }}{%- endif %}
{% if server.target.kubernetes.key_name is defined %}key_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.key_name }}{%- endif %}
{% if server.target.kubernetes.cert_name is defined %}cert_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.cert_name }}{%- endif %}
{% if server.target.kubernetes.key_name is defined %}key_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.key_name }}{%- endif %}
kubernetes_sd_configs:
- api_server:{{server.target.kubernetes.api_ip }}
role:pod
tls_config:
insecure_skip_verify:true
{% if server.target.kubernetes.cert_name is defined %}cert_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.cert_name }}{%- endif %}
{% if server.target.kubernetes.key_name is defined %}key_file:{{server.target.kubernetes.ssl_dir }}/{{ server.target.kubernetes.key_name }}{%- endif %}