Deploy Cluster with an Amazon ECR Provider Registry
Amazon Elastic Container Registry (ECR) is a managed AWS service for storing and distributing container images. This guide describes how to configure an Edge cluster to pull provider images from a private Amazon ECR repository with token-based authentication.
You add your ECR registry to Palette as an OCI registry with the Image provider type (an image registry), and then select that image registry for the cluster. Palette issues short-lived ECR tokens to the Edge hosts, which use them to pull the provider image when the cluster is created and when it is upgraded. The Edge hosts fetch a fresh token at each pull, so a cluster that you upgrade months after you create it needs no extra steps. You do not need to store static AWS credentials on the Edge hosts.
Limitations
-
Token-based authentication is supported only for centrally managed Edge Native clusters in appliance mode. Locally managed clusters ignore the image registry selected for the cluster.
-
Token-based authentication is not specific to a Kubernetes distribution. Spectro Cloud tested it with the PXK-E (kubeadm) distribution on Ubuntu 22.04 and also created a K3s cluster with it. If your PXK-E cluster cannot use token-based authentication, refer to Configure Amazon ECR Authentication Manually.
-
The image registry supplies credentials only for images on its own endpoint. Set the
system.urioption in the OS layer of your cluster profile to a provider image on the registry's endpoint. Otherwise, the Edge host pulls the image without credentials, and the pull fails for a private repository. -
The image registry covers provider images only. It does not supply credentials for application workload images.
-
ECR image registries support only AWS Security Token Service (STS) authentication.
-
You cannot change the provider type of an image registry, and you cannot convert a registry of another provider type to an image registry. To use an ECR registry that is already in Palette as a Helm or Packs OCI registry, add the same endpoint again with the Image provider type and a new name.
-
You cannot delete a registry while a cluster uses it.
-
Spectro Cloud has not tested token-based authentication and the manual configuration together on the same cluster.
Prerequisites
-
Tenant administrator access to Palette.
-
A private Amazon ECR repository that contains a provider image you built during the EdgeForge process. For more information, refer to Build Artifacts.
-
A centrally managed Edge Native cluster in appliance mode, or the Edge hosts for a new one. Every Edge host of the cluster must run Palette agent version 4.10.14 or later. An older agent ignores the selected image registry and does not report an error.
-
An IAM role in the AWS account that owns the repository. The role needs a trust relationship that allows Palette to assume it through STS, and the following permissions.
ecr:GetAuthorizationTokenecr:DescribeRepositories(Palette uses this permission to validate the registry)ecr:BatchCheckLayerAvailability,ecr:GetDownloadUrlForLayer, andecr:BatchGetImageon the repository
When you add the registry, the side drawer next to the ARN field lists the trust relationship to add.
-
A cluster profile whose OS layer sets
system.urito the provider image in your ECR repository.
Add Amazon ECR as an Image Registry
-
Log in to Palette as a tenant administrator.
-
From the left main menu, select Tenant Settings.
-
From the Tenant Settings Menu, select Registries.
-
On the OCI Registries tab, select Add New OCI Registry.
-
Enter a Name for the registry. For Provider, select Image.
-
For OCI Authentication type, select ECR.
Palette turns on Enable Authentication and sets AWS authentication method to STS. You cannot change these settings for an ECR image registry. Synchronization is not supported for image registries.
-
In the Endpoint field, enter the ECR registry URL, for example
123456789012.dkr.ecr.us-east-1.amazonaws.com. Exclude thehttps://prefix and the repository name. -
In the ARN field, enter the Amazon Resource Name (ARN) of the IAM role for Palette to assume.
warningYou must add a trust relationship to the IAM role. The side drawer next to the ARN field lists the permissions and the trust relationship to add. If the trust relationship is missing, Palette cannot validate the registry.
-
Keep the default TLS Configuration settings. Amazon ECR uses certificates signed by well-known certificate authorities.
-
Select Confirm to add the registry.
Select the Image Registry for the Cluster
You can select the image registry when you create the cluster. You can also add or change the image registry on an existing cluster.
The image registry selected for the cluster takes precedence over providerCredentials in the Edge host user data and
the OS pack, including static credentials. A registry mirror still receives the credentials.
Select the Image Registry for a New Cluster
When you create an Edge Native cluster, select your registry from the Image registry drop-down menu on the cluster configuration page, where you provide the Virtual IP (VIP) address. The field is optional.
Select the Image Registry for an Existing Cluster
You can change the image registry in any cluster state. The change does not repave the nodes.
-
Log in to Palette.
-
From the left main menu, select Clusters, and then select your Edge Native cluster.
-
From the cluster details page, select Settings > Cluster Settings.
-
Select Cluster Configuration.
-
From the Image registry drop-down menu, select your registry.
-
Select Save Changes.
Validate
-
Log in to Palette.
-
From the left main menu, select Clusters, and then select your Edge Native cluster.
-
On the Overview tab, confirm that the Cluster Status field displays Running.
For a new cluster, the Running status confirms that the Edge hosts pulled the provider image from your ECR registry.
For an existing cluster, Palette uses the image registry at the next upgrade, and there is no earlier check. After the
upgrade, the Edge host logs display uses the credentials of Palette registry.
Next Steps
To upgrade the cluster to a new provider image, push the image to the same ECR registry, update system.uri in the
cluster profile, and apply the change. For more information, refer to
Update a Cluster.