Skip to main content

AWS ingress

On AWS, the AWS Load Balancer Controller creates an Application Load Balancer (ALB) for the site's Ingress.

Set up the load balancer​

  1. Install the controller in your cluster, as described in the AWS user guide.

  2. Request an AWS Certificate Manager (ACM) certificate for your site's hostname, in the same Region as your cluster.

  3. Add the ALB annotations to your values file with your certificate's ARN, and upgrade the release:

    # Primary Site values.yaml
    ingress:
    annotations:
    kubernetes.io/ingress.class: "alb"
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/backend-protocol: HTTP
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-1:xxxxxxxxxxxx:certificate/EXAMPLE-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  4. Point your site's DNS record at the ALB's DNS name:

    kubectl get ingress site -n foxglove -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'

By default, the ALB closes connections that send no data for 60 seconds, so long searches can fail. To raise this limit, see Increase the ingress timeout.

Global Accelerator​

Clients far from your site's region can stream data slowly. AWS Global Accelerator connects each client to a nearby AWS edge location and carries traffic to the ALB over the AWS network. HTTPS still ends at the ALB, so its certificate stays the same.

The AWS Load Balancer Controller creates the accelerator for the site's Ingress, and moves it to the new ALB if the Ingress is recreated.

note

Global Accelerator closes connections that send no data for 340 seconds. A search that sends no data for longer than that fails, even if you raised the ALB idle timeout. Global Accelerator also charges an hourly fee plus a per-GB fee on top of normal data transfer.

Requirements​

  • Primary Site v0.0.111 or later.
  • AWS Load Balancer Controller v2.17.0 or later. helm list -n kube-system shows its version under APP VERSION.
  • The chart's Ingress (ingress.enabled: true) with an internet-facing ALB (alb.ingress.kubernetes.io/scheme: internet-facing).
  • An AWS commercial Region. Global Accelerator isn't available in AWS GovCloud (US) or China Regions.

Turn on Global Accelerator​

Follow the steps in order. The controller needs its IAM policy and the GlobalAccelerator custom resource definition before you turn on its feature gates. Otherwise, it can't update any load balancer in the cluster, or it never creates the accelerator.

  1. Attach the controller's Global Accelerator AWS Identity and Access Management (IAM) policy to the controller's IAM role.

  2. Check that the GlobalAccelerator custom resource definition is installed:

    kubectl get crd globalaccelerators.aga.k8s.aws

    If it's missing, apply it as described in the controller's installation guide. helm upgrade doesn't install new custom resource definitions, so a controller first installed before v2.17.0 doesn't have it.

  3. Turn on the controller's GlobalAcceleratorController and EnableRGTAPI feature gates in its Helm values. Set them wherever you manage the controller's installation, such as a values file or Terraform, so a later deploy doesn't turn them off. Changing them restarts the controller.

    # AWS Load Balancer Controller Helm values
    controllerConfig:
    featureGates:
    GlobalAcceleratorController: true
    EnableRGTAPI: true
  4. Turn on the accelerator in your Primary Site values file, and upgrade the release:

    # Primary Site values.yaml
    ingress:
    globalAccelerator:
    enabled: true

    To name the accelerator in AWS, set ingress.globalAccelerator.name to up to 64 letters, digits, hyphens, or underscores. Otherwise, the controller generates a name. Until the controller creates the ALB, the GlobalAccelerator resource reports FailedBuildModel events, which stop once the ALB exists.

  5. Point your site's DNS record at the accelerator's DNS name:

    kubectl get globalaccelerator site -n foxglove -o jsonpath='{.status.dnsName}'

    A domain apex can't be a CNAME record. For an apex, create A records for the accelerator's two static IP addresses instead:

    kubectl get globalaccelerator site -n foxglove -o jsonpath='{.status.ipSets[0].ipAddresses}'

Turn off Global Accelerator​

warning

Turning off the accelerator or uninstalling the release deletes the accelerator and its static IP addresses. If your DNS record still points at the accelerator, clients can't reach the site.

  1. Point your site's DNS record back at the ALB, as in Set up the load balancer, and wait for the old record's time to live (TTL) to pass.

  2. Set ingress.globalAccelerator.enabled to false, and upgrade the release.

If you turn the accelerator back on or reinstall the release, the new accelerator has a new DNS name and new static IP addresses, so update your DNS record again.