Skip to content

Commit eb6f78f

Browse files
Merge pull request #230108 from johnmarco/jm-aro-acr-update
Update ACR article to link secret to service account
2 parents 3ab8f65 + 32dc6ee commit eb6f78f

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

articles/openshift/howto-use-acr-with-aro.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ author: johnmarco
55
ms.author: johnmarc
66
ms.service: azure-redhat-openshift
77
ms.topic: conceptual
8-
ms.date: 01/10/2021
8+
ms.date: 03/09/2023
99
---
1010

1111
# Use Azure Container Registry with Azure Red Hat OpenShift (ARO)
1212

13-
Azure Container Registry (ACR) is a managed container registry service that you can use to store private Docker container images with enterprise capabilities such as geo-replication. To access the ACR from an ARO cluster, the cluster can authenticate with ACR by storing Docker login credentials in a Kubernetes secret. Likewise, an ARO cluster can use an imagePullSecret in the pod spec to authenticate against the registry when pulling the image. In this article, you'll learn how to set up an Azure Container Registry with an Azure Red Hat OpenShift cluster to store and pull private Docker container images.
13+
Azure Container Registry (ACR) is a managed container registry service that you can use to store private Docker container images with enterprise capabilities such as geo-replication. To access the ACR from an ARO cluster, the cluster can authenticate with ACR by storing Docker login credentials in a Kubernetes secret. Likewise, an ARO cluster can use an imagePullSecret in the pod spec to authenticate against the registry when pulling the image. In this article, you'll learn how to set up an Azure Container Registry with an Azure Red Hat OpenShift cluster to store and pull private Docker container images.
1414

1515
## Prerequisites
1616

@@ -32,7 +32,6 @@ Instead, you can use the Azure CLI to get these credentials:
3232
```azurecli
3333
az acr credential show -n <your registry name>
3434
```
35-
3635
## Create the Kubernetes secret
3736

3837
Now, we'll use these credentials to create a Kubernetes secret. Execute the following command with your ACR credentials:
@@ -49,6 +48,14 @@ oc create secret docker-registry \
4948
>[!NOTE]
5049
>This secret will be stored in the current OpenShift Project (Kubernetes Namespace) and will only be referenceable by pods created in that Project. See this [document](https://docs.openshift.com/container-platform/4.4/openshift_images/managing_images/using-image-pull-secrets.html) for further instructions on creating a cluster wide pull secret.
5150
51+
## Link the secret to the service account
52+
53+
Next, link the secret to the service account that will be used by the pod, so the pod can reach the container registry. The name of the service account should match the name of the service account used by the pod. `default` is the default service account:
54+
55+
```
56+
oc secrets link default <pull_secret_name> --for=pull
57+
```
58+
5259
## Create a pod using a private registry image
5360

5461
Now that we've connected your ARO cluster to your ACR, let's pull an image from your ACR to create a pod.

0 commit comments

Comments
 (0)