You are looking at the documentation of a prior release. To read the documentation of the latest release, please visit here.

Exposing HAProxy Stats

To expose HAProxy stats, please use the following annotations:

Stats annotations

KeysValueDefaultDescription
ingress.appscode.com/statsbool"false"Optional. If set, HAProxy stats will be exposed
ingress.appscode.com/stats-portinteger"56789"Optional. Port used to expose HAProxy stats
ingress.appscode.com/stats-secret-namestringxOptional. Secret used to provide username & password to secure HAProxy stats endpoint. Secret must contain keys username and password
ingress.appscode.com/stats-service-namestringvoyager-<ingress-name>-statsClusterIP type service used to expose HAproxy stats. This allows to avoid exposing stats to internet.

Please note that stats port is not exposed to the internet via the service running in front of HAProxy pods.

Using Prometheus

Voyager operator exposes Prometheus ready metrics via the following endpoints on port :56790:

  • /metrics: Scrape this to monitor operator.
  • /extensions/v1beta1/namespaces/:ns/ingresses/:name/metrics?pod=<pod_ip> : Scrape this endpoint to monitor HAProxy running for a Kubernetes ingress
  • /voyager.appscode.com/v1beta1/namespaces/:ns/ingresses/:name/metrics?pod=<pod_ip>: Scrape this endpoint to monitor HAProxy running for an AppsCode extended ingress

To change the port, use --address flag on Voyager opreator.

Using CoreOS Prometheus Operator

Voyager operator can create service monitors for HAProxy pods. If enabled, a side-car exporter pod is run with HAProxy to expose Prometheus ready metrics via the following endpoints on port :56790:

  • /extensions/v1beta1/namespaces/:ns/ingresses/:name/metrics : Scrape this endpoint to monitor HAProxy running for a Kubernetes ingress
  • /voyager.appscode.com/v1beta1/namespaces/:ns/ingresses/:name/metrics: Scrape this endpoint to monitor HAProxy running for an AppsCode extended ingress

First deploy Prometheus operator so that Prometheus CRD groups are registered. Then, to enable this feature, please use the following annotations:

KeysValueDefaultDescription
ingress.appscode.com/monitoring-agentstringRequired. Indicates the monitoring agent used. Only valid value currently is coreos-prometheus-operator
ingress.appscode.com/service-monitor-labelsmapRequired. Indicates labels applied to service monitor.
ingress.appscode.com/service-monitor-namespacestringRequired. Indicates namespace where service monitors are created. This must be the same namespace of the Prometheus instance.
ingress.appscode.com/service-monitor-endpoint-portinteger56790Optional. Indicates the port used by exporter side-car to expose Prometheus metrics endpoint. If the default port 56790 is used to expose traffic, change it to an unused port.
ingress.appscode.com/service-monitor-endpoint-scrape-intervalstringOptional. Indicates the srace interval for HAProxy exporter endpoint

Known Limitations: If the HAProxy stats password is updated, exporter must be restarted to use the new credentials. This issue is tracked here.