Commit 260a0b94 authored by Julius Volz's avatar Julius Volz

Fix formatting of k8s-SD config docs

The redcarpet markdown renderer interprets the newlines within bulleted
lists in a different way than GitHub, so the layout is currently broken.
parent 11a40df2
...@@ -518,69 +518,81 @@ Kubernetes SD configurations allow retrieving scrape targets from ...@@ -518,69 +518,81 @@ Kubernetes SD configurations allow retrieving scrape targets from
[Kubernetes'](http://kubernetes.io/) REST API and always staying synchronized with [Kubernetes'](http://kubernetes.io/) REST API and always staying synchronized with
the cluster state. the cluster state.
One of the following `role`s can be configured to discover targets: One of the following `role` types can be configured to discover targets:
* **node**: Discovers one target per cluster node with the address defaulting #### `node`
to the Kubelet's HTTP port.
The target address defaults to the first existing address of the Kubernetes The `node` role discovers one target per cluster node with the address defaulting
node object in the address type order of `NodeInternalIP`, `NodeExternalIP`, to the Kubelet's HTTP port.
`NodeLegacyHostIP`, and `NodeHostName`. The target address defaults to the first existing address of the Kubernetes
node object in the address type order of `NodeInternalIP`, `NodeExternalIP`,
Available meta labels: `NodeLegacyHostIP`, and `NodeHostName`.
* `__meta_kubernetes_node_name`: The name of the node object.
* `__meta_kubernetes_node_label_<labelname>`: Each label from the node object. Available meta labels:
* `__meta_kubernetes_node_annotation_<annotationname>`: Each annotation from the node object.
* `__meta_kubernetes_node_address_<address_type>`: The first address for each node address type, if it exists. * `__meta_kubernetes_node_name`: The name of the node object.
* `__meta_kubernetes_node_label_<labelname>`: Each label from the node object.
In addition, the `instance` label for the node will be set to the node name * `__meta_kubernetes_node_annotation_<annotationname>`: Each annotation from the node object.
as retrieved from the API server. * `__meta_kubernetes_node_address_<address_type>`: The first address for each node address type, if it exists.
* **service**: Discovers a target for each service port for each service. In addition, the `instance` label for the node will be set to the node name
This is generally useful for blackbox monitoring of a service. as retrieved from the API server.
The address will be set to the Kubernetes DNS name of the service and respective
service port. #### `service`
Available meta labels: The `service` role discovers a target for each service port for each service.
* `__meta_kubernetes_namespace`: The namespace of the service object. This is generally useful for blackbox monitoring of a service.
* `__meta_kubernetes_service_name`: The name of the service object. The address will be set to the Kubernetes DNS name of the service and respective
* `__meta_kubernetes_service_label_<labelname>`: The label of the service object. service port.
* `__meta_kubernetes_service_annotation_<annotationname>`: The annotation of the service object.
* `__meta_kubernetes_service_port_name`: Name of the service port for the target. Available meta labels:
* `__meta_kubernetes_service_port_number`: Number of the service port for the target.
* `__meta_kubernetes_service_port_portocol`: Protocol of the service port for the target. * `__meta_kubernetes_namespace`: The namespace of the service object.
* `__meta_kubernetes_service_name`: The name of the service object.
* **pod**: Discovers all pods and exposes their containers as targets. For each declared * `__meta_kubernetes_service_label_<labelname>`: The label of the service object.
port of a container, a single target is generated. If a container has no specified ports, * `__meta_kubernetes_service_annotation_<annotationname>`: The annotation of the service object.
a port-free target per container is created for manually adding a port via relabeling. * `__meta_kubernetes_service_port_name`: Name of the service port for the target.
* `__meta_kubernetes_service_port_number`: Number of the service port for the target.
Available meta labels: * `__meta_kubernetes_service_port_portocol`: Protocol of the service port for the target.
* `__meta_kubernetes_namespace`: The namespace of the pod object.
* `__meta_kubernetes_pod_name`: The name of the pod object. #### `pod`
* `__meta_kubernetes_pod_ip`: The pod IP of the pod object.
* `__meta_kubernetes_pod_label_<labelname>`: The label of the pod object. The `pod` role discovers all pods and exposes their containers as targets. For each declared
* `__meta_kubernetes_pod_annotation_<annotationname>`: The annotation of the pod object. port of a container, a single target is generated. If a container has no specified ports,
* `__meta_kubernetes_pod_container_name`: Name of the container the target address points to. a port-free target per container is created for manually adding a port via relabeling.
* `__meta_kubernetes_pod_container_port_name`: Name of the container port.
* `__meta_kubernetes_pod_container_port_number`: Number of the container port. Available meta labels:
* `__meta_kubernetes_pod_container_port_protocol`: Protocol of the container port.
* `__meta_kubernetes_pod_ready`: Set to `true` or `false` for the pod's ready state. * `__meta_kubernetes_namespace`: The namespace of the pod object.
* `__meta_kubernetes_pod_node_name`: The name of the node the pod is scheduled onto. * `__meta_kubernetes_pod_name`: The name of the pod object.
* `__meta_kubernetes_pod_host_ip`: The current host IP of the pod object. * `__meta_kubernetes_pod_ip`: The pod IP of the pod object.
* `__meta_kubernetes_pod_label_<labelname>`: The label of the pod object.
* **endpoints**: Discovers targets from listed endpoints of a service. For each endpoint * `__meta_kubernetes_pod_annotation_<annotationname>`: The annotation of the pod object.
address one target is discovered per port. If the endpoint is backed by a pod, all * `__meta_kubernetes_pod_container_name`: Name of the container the target address points to.
additional container ports of the pod, not bound to an endpoint port, are discovered as targets as well. * `__meta_kubernetes_pod_container_port_name`: Name of the container port.
* `__meta_kubernetes_pod_container_port_number`: Number of the container port.
Available meta labels: * `__meta_kubernetes_pod_container_port_protocol`: Protocol of the container port.
* `__meta_kubernetes_namespace`: The namespace of the endpoints object. * `__meta_kubernetes_pod_ready`: Set to `true` or `false` for the pod's ready state.
* `__meta_kubernetes_endpoints_name`: The names of the endpoints object. * `__meta_kubernetes_pod_node_name`: The name of the node the pod is scheduled onto.
* For all targets discovered directly from the endpoints list (those not additionally inferred * `__meta_kubernetes_pod_host_ip`: The current host IP of the pod object.
from underlying pods), the following labels are attached:
* `__meta_kubernetes_endpoint_ready`: Set to `true` or `false` for the endpoint's ready state. #### `endpoints`
* `__meta_kubernetes_endpoint_port_name`: Name of the endpoint port.
* `__meta_kubernetes_endpoint_port_protocol`: Protocol of the endpoint port. The `endpoints` role discovers targets from listed endpoints of a service. For each endpoint
* If the endpoints belong to a service, all labels of the `role: service` discovery are attached. address one target is discovered per port. If the endpoint is backed by a pod, all
* For all targets backed by a pod, all labels of the `role: pod` discovery are attached. additional container ports of the pod, not bound to an endpoint port, are discovered as targets as well.
Available meta labels:
* `__meta_kubernetes_namespace`: The namespace of the endpoints object.
* `__meta_kubernetes_endpoints_name`: The names of the endpoints object.
* For all targets discovered directly from the endpoints list (those not additionally inferred
from underlying pods), the following labels are attached:
* `__meta_kubernetes_endpoint_ready`: Set to `true` or `false` for the endpoint's ready state.
* `__meta_kubernetes_endpoint_port_name`: Name of the endpoint port.
* `__meta_kubernetes_endpoint_port_protocol`: Protocol of the endpoint port.
* If the endpoints belong to a service, all labels of the `role: service` discovery are attached.
* For all targets backed by a pod, all labels of the `role: pod` discovery are attached.
See below for the configuration options for Kubernetes discovery: See below for the configuration options for Kubernetes discovery:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment