The default helm chart installation we used in part 2 of my IaC series was not set up with High Availability. In this post we will modify our deployment to be higly available by increasing the numbers of replicas of the controller we require.

Multiple replicas of Ingress-Nginx

Helm charts can be customised using a values file. Overrides can be set which are then applied on install/upgrade. To see the default values and to get an idea what can be overridden, see here.

In order to increase the number of replicas we will create a new file - ingress-nginx-values.yaml

In that file, copy the following:

controller:
  replicaCount: 2

This tells kubernetes that we want two replicas of Ingress-Nginx to be deployed in to the cluster.

Tell terraform to use the values file by modifying the ingress_nginx resource:

resource "helm_release" "ingress_nginx" {
  name             = "ingress-nginx"
  namespace        = "ingress-nginx"
  create_namespace = true
  repository       = "https://kubernetes.github.io/ingress-nginx"
  chart            = "ingress-nginx"

  values = [
    "${file("ingress-nginx-values.yaml")}"
  ]
}

Save and run the pipeline. Once the deployment completes you should see two replicas of Ingress-Nginx in your kubernetes dashboard via the DigitalOcean portal.