Installation

Install on Azure AKS

This section shows you how to install HAProxy Enterprise Kubernetes Ingress Controller in Azure Kubernetes Service.

Pre-installation checklist Jump to heading

  • A running AKS Kubernetes cluster
  • The Azure CLI
  • The helm command-line tool
  • The kubectl command-line tool

Connect to your AKS cluster Jump to heading

  1. Connect to your cluster using the Azure CLI:

    nix
    az account set --subscription [Your Azure subscription ID]
    az aks get-credentials --resource-group [Your resource group] --name [Your AKS cluster name]
    nix
    az account set --subscription [Your Azure subscription ID]
    az aks get-credentials --resource-group [Your resource group] --name [Your AKS cluster name]
  2. Check that you can access the cluster by calling kubectl get pods:

    nix
    kubectl get pods
    nix
    kubectl get pods

    If your cluster is new it may not have any resources:

    output
    text
    No resources found in default namespace.
    output
    text
    No resources found in default namespace.

Install Jump to heading

Choose one of the following installation methods:

Install with Helm Jump to heading

Helm values file

The following example uses --set invocations to configure the ingress controller. When installing with Helm, you can instead use a Helm values file to provide your configuration values. Using a Helm values file can provide for better traceability of configuration changes and reduce the complexity of Helm installation commands.

  1. Add the HAProxy Technologies Helm repository:

    nix
    helm repo add haproxytech https://haproxytech.github.io/helm-charts
    nix
    helm repo add haproxytech https://haproxytech.github.io/helm-charts
  2. Update your list of charts:

    nix
    helm repo update
    nix
    helm repo update
  3. Install the ingress controller, replacing [KEY] with your HAProxy Enterprise license key:

    nix
    helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \
    --create-namespace \
    --namespace haproxy-controller \
    --set controller.imageCredentials.registry=kubernetes-registry.haproxy.com \
    --set controller.imageCredentials.username=[KEY] \
    --set controller.imageCredentials.password=[KEY] \
    --set controller.image.repository=kubernetes-registry.haproxy.com/hapee-ingress \
    --set controller.image.tag=v1.11 \
    --set controller.service.type=LoadBalancer \
    --set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"="/healthz"
    nix
    helm install haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \
    --create-namespace \
    --namespace haproxy-controller \
    --set controller.imageCredentials.registry=kubernetes-registry.haproxy.com \
    --set controller.imageCredentials.username=[KEY] \
    --set controller.imageCredentials.password=[KEY] \
    --set controller.image.repository=kubernetes-registry.haproxy.com/hapee-ingress \
    --set controller.image.tag=v1.11 \
    --set controller.service.type=LoadBalancer \
    --set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"="/healthz"

    This will create an Azure Load Balancer that routes traffic to the ingress controller service. You can map the load balancer’s IP address to your public DNS domain name.

    By default, the Helm chart adds --ingress.class=haproxy to the ingress controller. That means that it will use Ingress resources only if they specify an annotation of kubernetes.io/ingress.class: haproxy. You can disable this by setting --set controller.ingressClass=null when calling helm install.

Install with kubectl Jump to heading

  1. Download the deployment YAML file (v1.11).

    Other versions
  2. Edit the haproxy-ingress Service object in the YAML file, setting its type field to LoadBalancer:

    haproxy-ingress.hapee.yaml
    yaml
    apiVersion: v1
    kind: Service
    metadata:
    labels:
    run: haproxy-ingress
    name: haproxy-ingress
    namespace: haproxy-controller
    spec:
    selector:
    run: haproxy-ingress
    type: LoadBalancer
    haproxy-ingress.hapee.yaml
    yaml
    apiVersion: v1
    kind: Service
    metadata:
    labels:
    run: haproxy-ingress
    name: haproxy-ingress
    namespace: haproxy-controller
    spec:
    selector:
    run: haproxy-ingress
    type: LoadBalancer
  3. Use the kubectl apply command to deploy the controller:

    nix
    kubectl apply -f haproxy-ingress.hapee.yaml
    nix
    kubectl apply -f haproxy-ingress.hapee.yaml

    This will create an Azure Load Balancer that routes traffic to the ingress controller service. You can map the load balancer’s IP address to your public DNS domain name.

  4. Use kubectl create secret to store your credentials for the private HAProxy Docker registry, replacing KEY with your HAProxy Enterprise license key:

    nix
    kubectl create secret docker-registry regcred --namespace=haproxy-controller --docker-server=kubernetes-registry.haproxy.com --docker-username=<KEY> --docker-password=<KEY>
    nix
    kubectl create secret docker-registry regcred --namespace=haproxy-controller --docker-server=kubernetes-registry.haproxy.com --docker-username=<KEY> --docker-password=<KEY>
    output
    text
    secret/regcred created
    output
    text
    secret/regcred created

Check your installation Jump to heading

Verify that the controller is installed into your Kubernetes cluster by using the command kubectl get pods:

nix
kubectl get pods --namespace haproxy-controller
nix
kubectl get pods --namespace haproxy-controller
output
text
NAME READY STATUS RESTARTS AGE
haproxy-kubernetes-ingress-7dd4cc4b-x5fkv 1/1 Running 0 1m
output
text
NAME READY STATUS RESTARTS AGE
haproxy-kubernetes-ingress-7dd4cc4b-x5fkv 1/1 Running 0 1m

Get the External IP, which you can use to access your cluster:

nix
kubectl get services --namespace haproxy-controller
nix
kubectl get services --namespace haproxy-controller
output
text
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
haproxy-kubernetes-ingress LoadBalancer 10.0.40.8 20.62.154.138 80:31669/TCP,443:30449/TCP,1024:31713/TCP 2m43s
output
text
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
haproxy-kubernetes-ingress LoadBalancer 10.0.40.8 20.62.154.138 80:31669/TCP,443:30449/TCP,1024:31713/TCP 2m43s

Do you have any suggestions on how we can improve the content of this page?