Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9f6fc2c

Browse files
committed
Update ECR integration topic
1 parent620e45f commit9f6fc2c

File tree

3 files changed

+93
-84
lines changed

3 files changed

+93
-84
lines changed

‎_data/nav.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@
238238
url:"/docker-hub"
239239
-title:Azure Docker Registry
240240
url:"/azure-docker-registry"
241-
-title:AmazonEC2 Container Registry
241+
-title:AmazonECR Container Registry
242242
url:"/amazon-ec2-container-registry"
243243
-title:Google Container Registry
244244
url:"/google-container-registry"

‎_docs/integrations/docker-registries/amazon-ec2-container-registry.md‎

Lines changed: 92 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -9,54 +9,35 @@ redirect_from:
99
toc:true
1010
---
1111

12-
##Set upECRintegration forIAM user
12+
Configure[AmazonECRregistries](https://docs.aws.amazon.com/ecr/){:target=\_blank"} forpipeline integrations.
1313

14-
1. In the Codefresh UI, on the toolbar, click the**Settings** icon, and then from the sidebar, select[**Pipeline Integrations**](https://g.codefresh.io/account-admin/account-conf/integration){:target="\_blank"}.
15-
1. Select**Docker Registries** and then click**Configure**.
16-
1. From the**Add Registry Provider** dropdown, select**Amazon ECR**.
17-
1. Define the following:
18-
***Registry name**: A unique name for this configuration.
19-
***Region**: AWS region.
20-
***Access Key ID**: Your AWS accessKeyId.
21-
***Secret Access Key**: Your AWS accessKeyId.
14+
ECR integrations can be set up for IAM (Identity and Access Management) users and for service accounts. Each type of integration has different prerequisities and requirements.
2215

23-
{% include image.html
24-
lightbox="true"
25-
file="/images/integrations/docker-registries/add-amazon-ecr-registry.png"
26-
url="/images/integrations/docker-registries/add-amazon-ecr-registry.png"
27-
alt="Amazon EC2 Container Registry settings"
28-
caption="Amazon EC2 Container Registry settings"
29-
max-width="60%" %}
30-
{:start="5"}
31-
1. To verify the connection details, click**Test Connection**.
32-
1. To apply the changes, click**Save**.
16+
##IAM ECR integration for pipelines
3317

34-
Codefresh makes sure to automatically refresh the AWS token for you.
18+
Amazon ECR integration with IAM roles for push/pull operations are supported with two types of permissions: identity-based and resource-based.
3519

36-
For more information on how to obtain the needed tokens, read the[AWS documentation](http://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys){:target="_blank"}.
3720

38-
>**NOTE**
39-
>You must have an active registry set up in AWS.
40-
>
41-
>Amazon ECR push/pull operations are supported with two permission options: user-based and resource-based.
21+
***Identity-based policies**
22+
User account must apply`AmazonEC2ContainerRegistryPowerUser` policy, or a custom policy based on that policy.
23+
For more information and examples, see[Amazon ECR identity-based policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies){:target="_blank"}.
4224

43-
* Identity-based policies
44-
User account must apply`AmazonEC2ContainerRegistryPowerUser` policy (or custom based on that policy).
45-
For more information and examples, click[here](http://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr_managed_policies.html){:target="_blank"}.
46-
* Resource-based policy
47-
Users with resource-based policies must be allowed to call`ecr:GetAuthorizationToken` before they can authenticate to a registry, and push or pull any images from any Amazon ECR repository, than you need provide push/pull permissions to specific registry.
48-
For more information and examples, click[here](http://docs.aws.amazon.com/AmazonECR/latest/userguide/RepositoryPolicies.html){:target="_blank"}.
25+
***Resource-based policy**
26+
Users with resource-based policies must be allowed to call`ecr:GetAuthorizationToken` before they can authenticate to a registry.
27+
To push or pull any images from any Amazon ECR repository, you must provide push/pull permissions to the specific registry.
28+
For more information and examples, click[Amazon ECR resource-based policies](https://docs.aws.amazon.com/AmazonECR/latest/userguide/security_iam_service-with-iam.html#security_iam_service-with-iam-resource-based-policies){:target="_blank"}.
4929

50-
##Set up ECR integration for service account
5130

52-
Setting up ECR integration for a service account applies to accounts with the Codefresh Runner installation.
31+
##Service account for authentication
32+
Setting up ECR integration using service account credentials instead of access keys applies to accounts with the Codefresh Runner installed.
5333

54-
###Kubernetes service account setup
34+
#####Kubernetes service account setup
5535

5636
To use an IAM role, you must set up a Kubernetes service account, as described in the[AWS Documentation](https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html){:target="\_blank"}.
57-
You can define the service account at four different levels, based on the required priority. The levels are listed below in ascending order of priority:
37+
You can define the service account at four different levels, based on the required priority.
38+
The levels are listed below in ascending order of priority:
5839

59-
* Runtime
40+
***Runtime**
6041
The runtime level has the lowest priority. Define it in the Runtime Specification under`runtimeScheduler > Cluster` (same level as`namespace`), and specify the service account. The key is`serviceAccount`. Use the default, and make sure you have the correct annotation added to the service account. Another option is to create a new service account with the proper permissions and annotations.
6142

6243
```yaml
@@ -70,86 +51,114 @@ runtimeScheduler:
7051

7152
```
7253

73-
* Account
74-
The Account-level service account has higher priority than the runtime-level service account. To define the service account at the account level, turn on the setting as part of the integration as described below.
54+
***Account**
55+
The account-level service account has higher priority than the runtime-level service account.
56+
To define the service account at the account level, turn on the setting as part of the integration.
7557

76-
* Pipeline
77-
The Pipeline-level service account has higher priority than the account-level service account. Define the service account as part of the pipeline's runtime settings (Pipeline > Settings > Runtime).
58+
***Pipeline** (need to verify with Vadim)
59+
The pipeline-level service account has higher priority than the account-level service account.
60+
Define the service account as part of the pipeline's runtime settings (Pipeline > Settings > Runtime).
7861

79-
* Trigger
62+
***Trigger** ((need to verify with Vadim))
8063
The Trigger-level service account has the highest priority. Define the service account as part of the trigger settings for the specific pipeline (Workflow > Triggers (modify or add) > Advanced Options).
8164

82-
###How to
8365

84-
####Before you begin
66+
##Set up ECR integration for IAM user/service account
67+
Set up ECR integration using access key or service account credentials to authenticate to the registry. This is an integration to a private ECR registry.
68+
If needed, define a[fallback registry]({{site.baseurl}}/docs/integrations/docker-registries/#define-fallback-registry), and a[global prefix]({{site.baseurl}}/docs/integrations/docker-registries/#using-an-optional-repository-prefix) for all Docker images, instead of defining it per pipeline.
8569

86-
* Define a Kubernetes service account for the runtime, account, pipeline, or pipeline-trigger
70+
#####Before you begin
71+
* Make sure you have an active registry set up in AWS
8772

88-
####Steps
73+
74+
#####How to
8975

9076
1. In the Codefresh UI, on the toolbar, click the**Settings** icon, and then from the sidebar, select[**Pipeline Integrations**](https://g.codefresh.io/account-admin/account-conf/integration){:target="\_blank"}.
9177
1. Select**Docker Registries** and then click**Configure**.
9278
1. From the**Add Registry Provider** dropdown, select**Amazon ECR**.
93-
1. Do the following:
94-
***Registry name**: Enter a unique name for this configuration.
95-
***Region**: Select the AWS region.
96-
* Select**Resolve credentials from servce account**.
97-
* The Access Key ID and Secret Access Key fields are disabled.
98-
99-
{% include image.html
100-
lightbox="true"
101-
file="/images/integrations/docker-registries/add-amazon-ecr-registry.png"
102-
url="/images/integrations/docker-registries/add-amazon-ecr-registry.png"
103-
alt="Amazon EC2 Container Registry settings"
104-
caption="Amazon EC2 Container Registry settings"
105-
max-width="60%" %}
79+
1. Define the following:
80+
***Registry name**: A unique name for this integration.
81+
***Region**: AWS region.
82+
***Access Key ID** and**Secret Access Key**:
83+
Disabled when service account credentials are used.
84+
The public identifier (Access Key ID), and the private, secret component (Secret Access Key), for access to the registry. The Access Key ID is paired with the Secret Access Key to ensure the authenticity of the access request to the registry.
85+
***Resolve credentials from service account**:
86+
Disabled when access keys are used.
87+
Authenticate to the registry using the service account[configured for the pipeline]({{site.baseurl}}/docs/pipelines/configuration/pipeline-settings/#advanced-options-for-pipelines) in account-level settings.
88+
89+
90+
{% include image.html
91+
lightbox="true"
92+
file="/images/integrations/docker-registries/add-amazon-ecr-registry.png"
93+
url="/images/integrations/docker-registries/add-amazon-ecr-registry.png"
94+
alt="Amazon ECR Container Registry settings"
95+
caption="Amazon ECR Container Registry settings"
96+
max-width="60%" %}
97+
10698
{:start="5"}
99+
1. If required, define the Advanced Options:
100+
***Repository prefix**: The prefix, such as the name of the organization or repository, to use globally for your Docker images.
101+
***Fallback registry**: The alternate registry to use if the pull operation from the default registry fails.
107102
1. To verify the connection details, click**Test Connection**.
108103
1. To apply the changes, click**Save**.
109104

105+
Codefresh makes sure to automatically refresh the AWS token for you.
106+
For more information on how to obtain the needed tokens, read the[AWS documentation](http://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys){:target="_blank"}.
107+
108+
109+
110110
##Public ECR registry integration
111111

112-
You can use**Other Registries** option in the Docker integration page to add a Public ECR integration.
112+
Add a Public ECR integration through the**Other Registries** option for Docker registry providers.
113+
114+
###Step 1: Get username & password from AWS
115+
Before creating a public ECR integration in Codefresh, get the AWS username and password from the AWS console.
116+
117+
1. Navigate to**Amazon ECR/Repositories/Public/$REPO**.
118+
1. Click**View push commands** at the upper right.
119+
1. In the next window note the first command that will print out the password.
113120

114-
1. You will need to pass username and password to create the integration. You can get these values from the AWS console:
115-
1. Navigate to "Amazon ECR/Repositories/Public/$REPO".
116-
1. Click the "View push commands" button at the upper right.
117-
1. In the next window note the first command that will print out the password.
118121
{% include image.html
119122
lightbox="true"
120123
file="/images/integrations/docker-registries/public-ecr-repo.png"
121124
url="/images/integrations/docker-registries/public-ecr-repo.png"
122125
alt="Public Amazon EC2 Container Registry Command"
123126
caption=""
124127
max-width="60%" %}
125-
{:start="2"}
126-
1. In the Codefresh[integration page](https://g.codefresh.io/account-admin/account-conf/integration/registryNew) select 'Add Registry Provider > Other Registries'
127-
1. Enter any Registry name
128-
1. Put "AWS" in the Username field
129-
1. Run the following command from the AWS Console:
128+
129+
OR
130+
Run the following command from the AWS Console:
130131

131132
```shell
132133
aws ecr-public get-login-password --region us-east-1
133134
```
135+
1. Note down the password.
136+
137+
138+
139+
### Step 2: Set up public ECR integration in Codefresh
140+
1. In the Codefresh UI, on the toolbar, click the**Settings** icon, andthen from the sidebar,select[**Pipeline Integrations**](https://g.codefresh.io/account-admin/account-conf/integration){:target="\_blank"}.
141+
1. Select**Docker Registries** andthen click**Configure**.
142+
1. From the**Add Registry Provider** dropdown,select**Other Registries**.
143+
1. Define the following:
144+
***Registry name**: A unique namefor this integration.
145+
***Username**: Enter`AWS`.
146+
***Password**: Enter the password you noted downin _step 1_.
147+
***Domain**: The registry address,for example,`mydomain.com`.
148+
1. If required, define the Advanced Options:
149+
***Repository prefix**: The prefix, such as the name of the organization or repository, to use globallyfor your Docker images.
150+
***Fallback registry**: The alternate registry to useif the pull operation from the default registry fails.
151+
1. If the registry is behind a firewall, toggle**Installed behind a firewall** to ON. (to verify with Vadim)
152+
1. To verify the connection details, click**Test Connection**.
153+
1. To apply the changes, click**Save**.
134154

135-
1. Put the outputin the Password field
136-
1. Fillin the prefix fieldin advanced options too.
137-
{% include image.html
138-
lightbox="true"
139-
file="/images/integrations/docker-registries/public-ecr-repo2.png"
140-
url="/images/integrations/docker-registries/public-ecr-repo2.png"
141-
alt="Codefresh Other Docker Registry Form"
142-
caption=""
143-
max-width="60%" %}
144-
{:start="3"}
145-
1. Test the connectionif needed and save the changes.
146155

147156
## Pushing Docker images to Amazon ECR
148157

149158
There are two ways to push images:
150159

151-
1. (Recommended)Using the YAML [push step]({{site.baseurl}}/docs/pipelines/steps/push/).
152-
1. Manually promotingmanually an image (described below)
160+
1. (Recommended)Automatically through the YAML [push step]({{site.baseurl}}/docs/pipelines/steps/push/).
161+
1. Manuallybypromotingthe image (described below)
153162

154163
For more details on how to push a Docker imagein a pipeline see the [build and push example]({{site.baseurl}}/docs/example-catalog/ci-examples/build-and-push-an-image/).
155164

@@ -202,12 +211,12 @@ max-width="40%"
202211

203212
1. Click**Promote**.
204213

205-
>**NOTE**
214+
>**NOTE**
206215
You can change the image nameif you want, but make sure that the new name exists as a repositoryin ECR.
207216

208217
## Related articles
209-
210218
[Docker registriesfor pipeline integrations]({{site.baseurl}}/docs/integrations/docker-registries/)
211219
[Working with Docker Registries]({{site.baseurl}}/docs/ci-cd-guides/working-with-docker-registries/)
220+
[Integrating with other Docker registries]({{site.baseurl}}/docs/integrations/docker-registries/other-registries/)
212221
[Push step]({{site.baseurl}}/docs/pipelines/steps/push/)
213222
[Building and pushing an image]({{site.baseurl}}/docs/example-catalog/ci-examples/build-and-push-an-image/)
68.4 KB
Loading

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp