blob: 0972dcb237128669ed6a1a1501b65952c154b79b [file] [log] [blame]
{%- from "kubernetes/map.jinja" import master with context %}
{%- from "kubernetes/map.jinja" import common with context -%}
{%- from "kubernetes/map.jinja" import pool with context %}
{%- if pool.get('enabled', False) %}
{% set network = pool.get('network', {}) %}
{%- else %}
{%- if master.get('enabled', False) %}
{% set network = master.get('network', {}) %}
{% endif %}
{% endif %}
{%- if master.get('enabled', False) or pool.get('enabled', False) %}
local_plugin:
{%- if network is defined and network.get('calico', {}).get('enabled', False) %}
collectd_calico_felix:
plugin: python
template: kubernetes/files/collectd_calico_felix.conf
url: http://localhost:9091/metrics
collectd_calico_bird:
plugin: python
template: kubernetes/files/collectd_calico_bird.conf
endpoints:
ipv4_socket: /var/run/calico/bird.ctl
ipv6_socket: /var/run/calico/bird6.ctl
{%- endif %}
collectd_http_check:
interval: 30
url:
{%- if master.get('enabled', False) %}
apiserver:
expected_code: 200
expected_content: ok
url: http://{{ master.apiserver.insecure_address }}:{{ master.apiserver.insecure_port }}/healthz
metric_name: k8s_service_health
scheduler:
expected_code: 200
expected_content: ok
url: http://127.0.0.1:10251/healthz
metric_name: k8s_service_health
controller-manager:
expected_code: 200
expected_content: ok
url: http://127.0.0.1:10252/healthz
metric_name: k8s_service_health
{%- endif %}
{%- if pool.get('enabled', False) %}
kubelet:
expected_code: 200
expected_content: ok
url: http://127.0.0.1:10248/healthz
metric_name: k8s_service_health
proxy:
expected_code: 200
expected_content: ok
url: http://127.0.0.1:10249/healthz
metric_name: k8s_service_health
{%- endif %}
collectd_processes:
process:
{%- if master.get('enabled', False) %}
k8s-apiserver:
match: hyperkube.*apiserver
k8s-scheduler:
match: hyperkube.*scheduler
k8s-controller-manager:
match: hyperkube.*controller-manager
{%- endif %}
{%- if pool.get('enabled', False) %}
k8s-kubelet:
match: hyperkube.*kubelet
k8s-proxy:
match: hyperkube.*proxy
{%- endif %}
{%- if network is defined and network.get('calico', {}).get('enabled', False) %}
calico-docker:
match: docker run .*projectcalico/calico/node
calico-felix:
match: calico-felix$
calico-bird:
match: bird .*/etc/calico/.*/bird.cfg
calico-bird6:
match: bird6 .*/etc/calico/.*/bird6.cfg
calico-confd:
match: confd .*/etc/calico/confd
{%- endif %}
{%- endif %}
{%- if pool.get('enabled', False) %}
remote_plugin:
collectd_http_check:
polling_interval: 30
url:
apiserver:
expected_code: 200
expected_content: ok
# Do not verify the certificate because urllib3 doesn't check for IP addresses in
# alternative names DNS entries.
# https://github.com/shazow/urllib3/issues/258
verify: false
{%- if common.get('cloudprovider', {}).get('enabled') and common.get('cloudprovider', {}).get('provider') == 'openstack' %}
client_cert: /etc/kubernetes/ssl/kubelet-client-fqdn.crt
client_key: /etc/kubernetes/ssl/kubelet-client-fqdn.key
{%- else %}
client_cert: /etc/kubernetes/ssl/kubelet-client.crt
client_key: /etc/kubernetes/ssl/kubelet-client.key
{%- endif %}
url: https://{{ pool.apiserver.host }}:{{ pool.apiserver.secure_port }}/healthz
metric_name: k8s_service_health_vip
collectd_k8s_get:
plugin: python
template: kubernetes/files/collectd_k8s_get.conf
polling_interval: 60
interval: 30
verify: false
{%- if common.get('cloudprovider', {}).get('enabled') and common.get('cloudprovider', {}).get('provider') == 'openstack' %}
client_cert: /etc/kubernetes/ssl/kubelet-client-fqdn.crt
client_key: /etc/kubernetes/ssl/kubelet-client-fqdn.key
{%- else %}
client_cert: /etc/kubernetes/ssl/kubelet-client.crt
client_key: /etc/kubernetes/ssl/kubelet-client.key
{%- endif %}
endpoint: https://{{ pool.apiserver.host }}:{{ pool.apiserver.secure_port }}
{%- endif %}