Community

Upgrade

Upgrade the ingress controller Jump to heading

When to use this procedure

You can use this procedure to upgrade HAProxy Kubernetes Ingress Controller anywhere you have installed it using Helm. This includes on-premises installations as well as installations in cloud providers.

If you installed the ingress controller using Helm, you can use the helm upgrade command to upgrade to the latest version. Helm will initiate a rolling update, waiting for the new ingress controller pods to start up before terminating the old ingress controller pods. That way, there is no interruption in service.

To perform the upgrade:

When calling helm upgrade, pass all arguments that you previously used when installing the ingress controller. Helm will install the latest version.

nix
helm upgrade haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \
--create-namespace \
--namespace haproxy-controller
nix
helm upgrade haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \
--create-namespace \
--namespace haproxy-controller
output
text
Release "haproxy-kubernetes-ingress" has been upgraded. Happy Helming!
NAME: haproxy-kubernetes-ingress
LAST DEPLOYED: Fri Jan 19 21:30:16 2024
NAMESPACE: haproxy-controller
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
HAProxy Kubernetes Ingress Controller has been successfully installed.
Controller image deployed is: "haproxytech/kubernetes-ingress:1.10.10".
[...]
output
text
Release "haproxy-kubernetes-ingress" has been upgraded. Happy Helming!
NAME: haproxy-kubernetes-ingress
LAST DEPLOYED: Fri Jan 19 21:30:16 2024
NAMESPACE: haproxy-controller
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
HAProxy Kubernetes Ingress Controller has been successfully installed.
Controller image deployed is: "haproxytech/kubernetes-ingress:1.10.10".
[...]

You can provide a specific version of the Helm chart you wish to use if you want to upgrade to a version that is not the latest version.

To see the list of available versions (and their corresonding Helm chart version) use the helm search repo command with the --versions flag to list all of the available versions of the Helm chart:

nix
helm search repo haproxytech/kubernetes-ingress --versions
nix
helm search repo haproxytech/kubernetes-ingress --versions
output
text
NAME CHART VERSION APP VERSION DESCRIPTION
haproxytech/kubernetes-ingress 1.36.1 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.36.0 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.5 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.4 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.3 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.2 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.1 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.0 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.34.1 1.10.9 A Helm chart for HAProxy Kubernetes Ingress Con...
[...]
output
text
NAME CHART VERSION APP VERSION DESCRIPTION
haproxytech/kubernetes-ingress 1.36.1 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.36.0 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.5 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.4 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.3 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.2 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.1 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.35.0 1.10.10 A Helm chart for HAProxy Kubernetes Ingress Con...
haproxytech/kubernetes-ingress 1.34.1 1.10.9 A Helm chart for HAProxy Kubernetes Ingress Con...
[...]

To upgrade to a specific version of the HAProxy Kubernetes Ingress Controller, use the --version parameter and provide the version of the Helm chart that corresponds to that version. For example, to install version 1.10.9, we will specify the Helm chart version as 1.34.1:

nix
helm upgrade haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \
--create-namespace \
--namespace haproxy-controller \
--version 1.34.1
nix
helm upgrade haproxy-kubernetes-ingress haproxytech/kubernetes-ingress \
--create-namespace \
--namespace haproxy-controller \
--version 1.34.1
output
text
Release "haproxy-kubernetes-ingress" has been upgraded. Happy Helming!
NAME: haproxy-kubernetes-ingress
LAST DEPLOYED: Fri Jan 19 21:32:28 2024
NAMESPACE: haproxy-controller
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
HAProxy Kubernetes Ingress Controller has been successfully installed.
Controller image deployed is: "haproxytech/kubernetes-ingress:1.10.9".
[...]
output
text
Release "haproxy-kubernetes-ingress" has been upgraded. Happy Helming!
NAME: haproxy-kubernetes-ingress
LAST DEPLOYED: Fri Jan 19 21:32:28 2024
NAMESPACE: haproxy-controller
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
HAProxy Kubernetes Ingress Controller has been successfully installed.
Controller image deployed is: "haproxytech/kubernetes-ingress:1.10.9".
[...]

Update CRDs Jump to heading

If you installed the ingress controller with Helm, updates to CRDs are applied automatically upon installation (helm install) and upgrade (helm upgrade). If you installed the ingress controller via kubectl, you will need to run a CRD update job using kubectl.

Prerequisites

This procedure does not install CRDs. Before updating them, you must make sure they are installed. See each CRD page under the Reference section for more information.

To update your CRDs:

  1. Find the ingress controller pod using kubectl get pods:

    nix
    kubectl get pods -n haproxy-controller
    nix
    kubectl get pods -n haproxy-controller
    example output
    text
    NAME READY STATUS RESTARTS AGE
    haproxy-kubernetes-ingress-59f7587966-9kjtv 1/1 Running 0 11m
    example output
    text
    NAME READY STATUS RESTARTS AGE
    haproxy-kubernetes-ingress-59f7587966-9kjtv 1/1 Running 0 11m
  2. Using the name of the haproxy-kubernetes-ingress pod (or one of the pods if you have more than one), call kubectl exec with the command /haproxy-ingress-controller --job-check-crd to update the CRDs. Note that this does not actually run an instance of the ingress controller, but rather, runs the ingress controller in a special mode that updates CRDs only.

    nix
    kubectl exec -it -n haproxy-controller haproxy-kubernetes-ingress-59f7587966-9kjtv -- /haproxy-ingress-controller --job-check-crd
    nix
    kubectl exec -it -n haproxy-controller haproxy-kubernetes-ingress-59f7587966-9kjtv -- /haproxy-ingress-controller --job-check-crd
    example output
    text
    2024/05/24 18:35:41 maxprocs: Leaving GOMAXPROCS=2: CPU quota undefined
    2024/05/24 18:35:41 /src/main.go:83
    _ _ _ ____
    | | | | / \ | _ \ _ __ _____ ___ _
    | |_| | / _ \ | |_) | '__/ _ \ \/ / | | |
    | _ |/ ___ \| __/| | | (_) > <| |_| |
    |_| |_/_/ \_\_| |_| \___/_/\_\\__, |
    _ __ _ |___/ ___ ____
    | |/ / _| |__ ___ _ __ _ __ ___| |_ ___ ___ |_ _/ ___|
    | ' / | | | '_ \ / _ \ '__| '_ \ / _ \ __/ _ \/ __| | | |
    | . \ |_| | |_) | __/ | | | | | __/ || __/\__ \ | | |___
    |_|\_\__,_|_.__/ \___|_| |_| |_|\___|\__\___||___/ |___\____|
    2024/05/24 18:35:41 /src/main.go:84
    ____ ____ ____ _ _ _ _
    / ___| _ \| _ \ | | | |_ __ __| | __ _| |_ ___ _ __
    | | | |_) | | | | | | | | '_ \ / _` |/ _` | __/ _ \ '__|
    | |___| _ <| |_| | | |_| | |_) | (_| | (_| | || __/ |
    \____|_| \_\____/ \___/| .__/ \__,_|\__,_|\__\___|_|
    |_|
    2024/05/24 18:35:41 INFO /src/main.go:85 HAProxy Ingress Controller CRD Updater v1.11.4 c336dcf2.dirty
    2024/05/24 18:35:41 INFO /src/main.go:86 Build from: github.com/haproxytech/kubernetes-ingress
    2024/05/24 18:35:41 INFO /src/main.go:87 Build date: 2024-05-03T08:58:19Z
    2024/05/24 18:35:41 INFO job/crd-check.go:31 checking CRDs
    2024/05/24 18:35:41 INFO job/crd-check.go:49
    2024/05/24 18:35:41 INFO job/crd-check.go:50 checking CRD defaults.ingress.v1.haproxy.org
    2024/05/24 18:35:41 INFO job/crd-check.go:66 CRD defaults.ingress.v1.haproxy.org exists
    2024/05/24 18:35:41 INFO job/crd-check.go:92 CRD defaults.ingress.v1.haproxy.org exists as v1, CN[v5.1.4]
    2024/05/24 18:35:41 INFO job/crd-check.go:49
    2024/05/24 18:35:41 INFO job/crd-check.go:50 checking CRD globals.ingress.v1.haproxy.org
    2024/05/24 18:35:41 INFO job/crd-check.go:66 CRD globals.ingress.v1.haproxy.org exists
    2024/05/24 18:35:41 INFO job/crd-check.go:92 CRD globals.ingress.v1.haproxy.org exists as v1, CN[v5.1.4]
    2024/05/24 18:35:41 INFO job/crd-check.go:49
    2024/05/24 18:35:41 INFO job/crd-check.go:50 checking CRD backends.ingress.v1.haproxy.org
    2024/05/24 18:35:41 INFO job/crd-check.go:66 CRD backends.ingress.v1.haproxy.org exists
    2024/05/24 18:35:41 INFO job/crd-check.go:92 CRD backends.ingress.v1.haproxy.org exists as v1, CN[v5.1.4]
    2024/05/24 18:35:41 INFO job/crd-check.go:111
    2024/05/24 18:35:41 INFO job/crd-check.go:112 CRD update done
    example output
    text
    2024/05/24 18:35:41 maxprocs: Leaving GOMAXPROCS=2: CPU quota undefined
    2024/05/24 18:35:41 /src/main.go:83
    _ _ _ ____
    | | | | / \ | _ \ _ __ _____ ___ _
    | |_| | / _ \ | |_) | '__/ _ \ \/ / | | |
    | _ |/ ___ \| __/| | | (_) > <| |_| |
    |_| |_/_/ \_\_| |_| \___/_/\_\\__, |
    _ __ _ |___/ ___ ____
    | |/ / _| |__ ___ _ __ _ __ ___| |_ ___ ___ |_ _/ ___|
    | ' / | | | '_ \ / _ \ '__| '_ \ / _ \ __/ _ \/ __| | | |
    | . \ |_| | |_) | __/ | | | | | __/ || __/\__ \ | | |___
    |_|\_\__,_|_.__/ \___|_| |_| |_|\___|\__\___||___/ |___\____|
    2024/05/24 18:35:41 /src/main.go:84
    ____ ____ ____ _ _ _ _
    / ___| _ \| _ \ | | | |_ __ __| | __ _| |_ ___ _ __
    | | | |_) | | | | | | | | '_ \ / _` |/ _` | __/ _ \ '__|
    | |___| _ <| |_| | | |_| | |_) | (_| | (_| | || __/ |
    \____|_| \_\____/ \___/| .__/ \__,_|\__,_|\__\___|_|
    |_|
    2024/05/24 18:35:41 INFO /src/main.go:85 HAProxy Ingress Controller CRD Updater v1.11.4 c336dcf2.dirty
    2024/05/24 18:35:41 INFO /src/main.go:86 Build from: github.com/haproxytech/kubernetes-ingress
    2024/05/24 18:35:41 INFO /src/main.go:87 Build date: 2024-05-03T08:58:19Z
    2024/05/24 18:35:41 INFO job/crd-check.go:31 checking CRDs
    2024/05/24 18:35:41 INFO job/crd-check.go:49
    2024/05/24 18:35:41 INFO job/crd-check.go:50 checking CRD defaults.ingress.v1.haproxy.org
    2024/05/24 18:35:41 INFO job/crd-check.go:66 CRD defaults.ingress.v1.haproxy.org exists
    2024/05/24 18:35:41 INFO job/crd-check.go:92 CRD defaults.ingress.v1.haproxy.org exists as v1, CN[v5.1.4]
    2024/05/24 18:35:41 INFO job/crd-check.go:49
    2024/05/24 18:35:41 INFO job/crd-check.go:50 checking CRD globals.ingress.v1.haproxy.org
    2024/05/24 18:35:41 INFO job/crd-check.go:66 CRD globals.ingress.v1.haproxy.org exists
    2024/05/24 18:35:41 INFO job/crd-check.go:92 CRD globals.ingress.v1.haproxy.org exists as v1, CN[v5.1.4]
    2024/05/24 18:35:41 INFO job/crd-check.go:49
    2024/05/24 18:35:41 INFO job/crd-check.go:50 checking CRD backends.ingress.v1.haproxy.org
    2024/05/24 18:35:41 INFO job/crd-check.go:66 CRD backends.ingress.v1.haproxy.org exists
    2024/05/24 18:35:41 INFO job/crd-check.go:92 CRD backends.ingress.v1.haproxy.org exists as v1, CN[v5.1.4]
    2024/05/24 18:35:41 INFO job/crd-check.go:111
    2024/05/24 18:35:41 INFO job/crd-check.go:112 CRD update done

    You should see in the output the text CRD update done, which means that the update was successful. If you receive an error like the following:

    text
    2024/05/24 18:41:05 INFO job/crd-check.go:57 CRD defaults.ingress.v1.haproxy.org does not exist
    2024/05/24 18:41:05 ERROR /src/main.go:91 customresourcedefinitions.apiextensions.k8s.io is forbidden: User "system:serviceaccount:haproxy-controller:haproxy-kubernetes-ingress" cannot create resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope
    text
    2024/05/24 18:41:05 INFO job/crd-check.go:57 CRD defaults.ingress.v1.haproxy.org does not exist
    2024/05/24 18:41:05 ERROR /src/main.go:91 customresourcedefinitions.apiextensions.k8s.io is forbidden: User "system:serviceaccount:haproxy-controller:haproxy-kubernetes-ingress" cannot create resource "customresourcedefinitions" in API group "apiextensions.k8s.io" at the cluster scope

    This means that the CRD is not installed. Install any missing CRDs and run the kubectl exec command again.

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