Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Container-based workloads on Graviton

AWS Graviton processors are ideal for container-based workloads.

Preparing for Graviton

The first step for leveraging the benefits of Graviton-based instances as container hosts is to ensure all production software dependencies support the arm64 architecture, as one cannot run images built for an x86_64 host on an arm64 host, and vice versa.

Most of the container ecosystem supports both architectures, and often does so transparently through multiple-architecture (multi-arch) images, where the correct image for the host architecture is deployed automatically.

The major container image repositories, including Dockerhub, Quay, and Amazon Elastic Container Registry (ECR) all support multi-arch images.

Creating Multi-arch container images

While most images already support multi-arch (i.e. arm64 and x86_64/amd64), we describe couple of ways for developers to to create a multi-arch image if needed.

  1. Docker Buildx
  2. Using a CI/CD Build Pipeline such as Amazon CodePipeline to coordinate native build and manifest generation.

Deploying to Graviton

Most container orchestration platforms support both arm64 and x86_64 hosts.

Both Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS) support Graviton-powered instances.

We have compiled a list of popular software within the container ecosystem that explicitly supports arm64:

Ecosystem Support

NameURLComment
Istiohttps://github.com/istio/istio/releases/Container images for arm64 available at Docker Hub starting with 1.15.0 release
Envoyhttps://www.envoyproxy.io/docs/envoy/v1.18.3/start/docker
TensorFlow with TensorFlow Serving763104351884.dkr.ecr.us-east-1.amazonaws.com/tensorflow-inference-graviton:2.13.0-cpu-py310-ubuntu20.04-ec2refer to Graviton TensorFlow user guide for how to use.
PyTorch with TorchServe763104351884.dkr.ecr.us-east-1.amazonaws.com/pytorch-inference-graviton:2.1.0-cpu-py310-ubuntu20.04-ec2refer to Graviton PyTorch user guide for how to use
Traefikhttps://github.com/containous/traefik/releases
Flannelhttps://github.com/coreos/flannel/releases
Helmhttps://github.com/helm/helm/releases/tag/v2.16.9
Jaegerhttps://github.com/jaegertracing/jaeger/pull/2176
Fluent-bithttps://github.com/fluent/fluent-bit/releases/compile from source
core-dnshttps://github.com/coredns/coredns/releases/
external-dnshttps://github.com/kubernetes-sigs/external-dns/blob/master/docs/faq.md#which-architectures-are-supportedsupport from 0.7.5+
Prometheushttps://prometheus.io/download/
containerdhttps://github.com/containerd/containerd/issues/3664nightly builds provided for arm64
kube-state-metricshttps://github.com/kubernetes/kube-state-metrics/issues/1037use k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.0.0-beta for arm64
cluster-autoscalerhttps://github.com/kubernetes/autoscaler/pull/3714arm64 support as of v1.20.0
gRPChttps://github.com/protocolbuffers/protobuf/releases/protoc/protobuf support
Natshttps://github.com/nats-io/nats-server/releases/
CNIhttps://github.com/containernetworking/plugins/releases/
Cri-ohttps://github.com/cri-o/cri-o/blob/master/README.md#installing-criotested on Ubuntu 18.04 and 20.04
Trivyhttps://github.com/aquasecurity/trivy/releases/
Argohttps://github.com/argoproj/argo-cd/releasesarm64 images published as of 2.3.0
Ciliumhttps://docs.cilium.io/en/stable/contributing/development/images/Multi arch supported from v 1.10.0
Calicohttps://hub.docker.com/r/calico/node/tags?page=1&ordering=last_updatedMulti arch supported on master
Tankahttps://github.com/grafana/tanka/releases
Consulhttps://www.consul.io/downloads
Nomadhttps://www.nomadproject.io/downloads
Packerhttps://www.packer.io/downloads
Vaulthttps://www.vaultproject.io/downloads
Terraformhttps://github.com/hashicorp/terraform/issues/14474arm64 support as of v0.14.0
Fluxhttps://github.com/fluxcd/flux/releases/
Pulumihttps://github.com/pulumi/pulumi/issues/4868arm64 support as of v2.23.0
New Relichttps://download.newrelic.com/infrastructure_agent/binaries/linux/arm64/
Datadog - EC2https://www.datadoghq.com/blog/datadog-arm-agent/
Datadog - Dockerhttps://hub.docker.com/r/datadog/agent-arm64
Dynatracehttps://www.dynatrace.com/news/blog/get-out-of-the-box-visibility-into-your-arm-platform-early-adopter/
Grafanahttps://grafana.com/grafana/download?platform=arm
Lokihttps://github.com/grafana/loki/releases
kube-benchhttps://github.com/aquasecurity/kube-bench/releases/tag/v0.3.1
metrics-serverhttps://github.com/kubernetes-sigs/metrics-server/releases/tag/v0.3.7docker image is multi-arch from v.0.3.7
AWS Copilothttps://github.com/aws/copilot-cli/releases/tag/v0.3.0arm64 support as of v0.3.0
AWS ecs-clihttps://github.com/aws/amazon-ecs-cli/pull/1110v1.20.0 binaries in us-west-2 s3
Amazon EC2 Instance Selectorhttps://github.com/aws/amazon-ec2-instance-selector/releases/also supports the -a cpu_architecture flag for discovering arm64-based instances in a particular region
AWS Node Termination Handlerhttps://github.com/aws/aws-node-termination-handler/releases/arm64 support under kubernetes (via helm)
AWS IAM Authenticatorhttps://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html
AWS ALB Ingress Controllerhttps://github.com/kubernetes-sigs/aws-alb-ingress-controller/releases/tag/v1.1.9multi-arch image as of v1.1.9
AWS EFS CSI Driverhttps://github.com/kubernetes-sigs/aws-efs-csi-driver/pull/241support merged 8/27/2020
AWS EBS CSI Driverhttps://github.com/kubernetes-sigs/aws-ebs-csi-driver/pull/527support merged 8/26/2020
Amazon Inspector Agenthttps://docs.aws.amazon.com/inspector/latest/userguide/inspector_installing-uninstalling-agents.html#install-linux
Amazon CloudWatch Agenthttps://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Install-CloudWatch-Agent.html
AWS Systems Manager SSM Agenthttps://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-manual-agent-install.html
AWS CLIhttps://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html#ARMv1 and v2 both supported
FireLens for Amazon ECShttps://github.com/aws/aws-for-fluent-bit/issues/44arm64 support as of v2.9.0
Flatcar Container Linuxhttps://www.flatcar.orgarm64 support in Stable channel as of 3033.2.0
Seqera Containershttps://www.seqera.io/containers/
Kublrhttps://kublr.com

If your software isn't listed above, it doesn't mean it won't work!

Many products work on arm64 but don't explicitly distribute arm64 binaries or build multi-arch images (yet). AWS, Arm, and many developers in the community are working with maintainers and contributing expertise and code to enable full binary or multi-arch support.

Kubernetes

Kubernetes (and EKS) supports arm64, and thus Graviton instances. If all of your containerized workloads support arm64, then you can run your cluster with Graviton nodes exclusively. However, if you have some workloads that can only run on amd64 (x86) instances, or if you just want to be able to run both amd64 (x86) and arm64 nodes in the same cluster, then there are a couple of ways to accomplish that:

Multiarch Images

If you are able to use multiarch images (see above) for all containers in your cluster, then you can simply run a mix of amd64 and arm64 nodes without any further action. The multiarch image manifest will ensure that the correct image layers are pulled for a given node's architecture.

Built-in labels

You can schedule pods on nodes according to the kubernetes.io/arch label. This label is automatically added to nodes by Kubernetes and allows you to schedule pods accordingly with a node selector like this:

nodeSelector:
  kubernetes.io/arch: amd64

Using taints

Taints are especially helpful if adding Graviton nodes to an existing cluster with mostly amd64-only (x86-only) containers. While using the built-in kubernetes.io/arch label requires you to explicitly use a node selector to place amd64-only containers on the right instances, tainting Graviton instances prevents Kubernetes from scheduling incompatible containers on them without requiring you to change any existing configuration. For example, you can do this with a managed node group using eksctl by adding --kubelet-extra-args '--register-with-taints=arm=true:NoSchedule' to the kubelet startup arguments as documented here. (Note that if you only taint arm64 instances and don't specify any node selectors, then you will need to ensure that the images you build for Graviton instances are multiarch images that can also run on x86 instance types. Alternatively, you can build arm64-only images and ensure that they are only scheduled onto arm64 images using node selectors.)

Cluster Autoscaler considerations

If using the Kubernetes Cluster Autoscaler in a cluster with both x86-based and Graviton instance types, note that you should tag each Auto Scaling group with k8s.io/cluster-autoscaler/node-template/label/* or k8s.io/cluster-autoscaler/node-template/taint/* tags as documented here to ensure that the Autoscaler can tell which pods can be placed in which ASG. (Note that this does not actually apply any labels or taints to nodes, but serves only to give scheduling hints to the Cluster Autoscaler.)


Further reading