Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit 5794e26

Browse files
authored
Merge pull request #213 from triggermesh/readme-update
ECR example added to the readme
2 parents 556c544 + 302637b commit 5794e26

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,29 @@ tm deploy -f python --registry-secret gcr --wait
217217

218218
As a result, Knative service image will be pushed to `eu.gcr.io/my-org/my-project` registry
219219

220+
#### AWS ECR
221+
222+
ECR is a specific case of the custom registry destination with an additional requirement - a repository must be created before pushing the image. Thus, service deployment steps should be slightly altered:
223+
224+
1. Create ECR repository in `<project>/<service>` format where "project" is an arbitrary identifier for the service (e.g. namespace) and "service" is the name of the service that is being deployed (in the example below it is `python-test`).
225+
1. Retrieve ECR token:
226+
```
227+
TOKEN=$(aws ecr get-login-password --region <region>)
228+
```
229+
1. Create the registry auth secret by running following command:
230+
```
231+
tm set registry-auth ecr --registry <registry host> --project <project> --username AWS --password $TOKEN
232+
```
233+
234+
1. Deploy the service. For example Python KLR:
235+
```
236+
tm deploy service python-test -f https://github.com/serverless/examples \
237+
--runtime https://raw.githubusercontent.com/triggermesh/knative-lambda-runtime/master/python37/runtime.yaml \
238+
--registry-secret ecr \
239+
--build-argument DIRECTORY=aws-python-simple-http-endpoint \
240+
--build-argument HANDLER=handler.endpoint \
241+
--wait
242+
```
220243
221244
#### Unauthenticated registry
222245

0 commit comments

Comments
 (0)