HAProxy is an open-source proxy application. For more information, see HAProxy.
To install HAProxy with a metric exporter to test Container Insights Prometheus support
-
Enter the following command to add the Helm incubator repo:
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com -
Enter the following command to create a new namespace:
kubectl create namespace haproxy-ingress-sample -
Enter the following commands to install HAProxy:
helm install haproxy incubator/haproxy-ingress \ --namespace haproxy-ingress-sample \ --set controller.stats.enabled=true \ --set controller.metrics.enabled=true \ --set-string controller.metrics.service.annotations."prometheus\.io/port"="9101" \ --set-string controller.metrics.service.annotations."prometheus\.io/scrape"="true" -
Enter the following command to confirm the annotation of the service:
kubectl describe service haproxy-haproxy-ingress-controller-metrics -n haproxy-ingress-sampleYou should see the following annotations.
Annotations: prometheus.io/port: 9101 prometheus.io/scrape: true
To uninstall HAProxy
-
Enter the following commands:
helm uninstall haproxy --namespace haproxy-ingress-sample kubectl delete namespace haproxy-ingress-sample