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

New to Voyager? Please start here.

Exposing HAProxy Stats

To expose HAProxy stats, please use the following annotations:

KeysValueDefaultDescription"false"Required. If set, HAProxy stats will be exposed"56789"Optional. Port used to expose HAProxy stats Secret used to provide username & password to secure HAProxy stats endpoint. Secret must contain keys username and password

If "true" annotation is set, a ClusterIP service voyager-<ingress-name>-stats will be created by Voyager operator. ClusterIP type service used to expose HAproxy stats. This ensures stats endpoint is not exposed to the internet.

Accessing HAProxy Stats

To access the HAPRoxy stats webpage, you can use port forwarding feature in kubectl. This article shows you the relevant stepos using a minikube cluster.

Before You Begin

At first, you need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using Minikube.

Now, deploy Voyager operator following instructions here.

Note that the yaml files that are used in this tutorial, stored in docs/examples folder in GitHub repository appscode/voyager.

To keep things isolated, this tutorial uses a separate namespace called demo throughout this tutorial. Run the following command to prepare your cluster for this tutorial:

$ kubectl create namespace demo
namespace "demo" created

$ kubectl get ns
NAME          STATUS    AGE
default       Active    45m
demo          Active    10s
kube-public   Active    45m
kube-system   Active    45m

Create Ingress

We are going to use a nginx server as the backend. To deploy nginx server, run the following commands:

kubectl run nginx --image=nginx -n demo
kubectl expose deployment nginx --name=web --port=80 --target-port=80 -n demo

Now create Ingress ing.yaml

$ kubectl apply -f
ingress "stats-ing" created

$ kubectl get pods,svc -n demo
NAME                                    READY     STATUS    RESTARTS   AGE
po/nginx-8586cf59-6hbx8                 1/1       Running   0          4m
po/voyager-stats-ing-6cb494cc6d-q2rnn   1/1       Running   0          39s

NAME                          TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
svc/voyager-stats-ing         NodePort    <none>        80:31019/TCP   39s
svc/voyager-stats-ing-stats   ClusterIP     <none>        56789/TCP      39s
svc/web                       ClusterIP   <none>        80/TCP         4m

$ minikube ip

$ curl -H "Host:voyager.appscode.test"
<!DOCTYPE html>
<title>Welcome to nginx!</title>
    body {
        width: 35em;
        margin: 0 auto;
        font-family: Tahoma, Verdana, Arial, sans-serif;
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>

<p>For online documentation and support please refer to
<a href=""></a>.<br/>
Commercial support is available at
<a href=""></a>.</p>

<p><em>Thank you for using nginx.</em></p>

$ kubectl port-forward voyager-stats-ing-6cb494cc6d-q2rnn -n demo 56789:56789
Forwarding from -> 56789
Handling connection for 56789


Cleaning up

To cleanup the Kubernetes resources created by this tutorial, run:

$ kubectl delete ns demo
namespace "demo" deleted

Next Steps