Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Amazon ECRをAWSの外から使う / Docker Meetup Kansai #5 ...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
sasaki
November 22, 2019
Technology
240
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Amazon ECRをAWSの外から使う / Docker Meetup Kansai #5 AmazonECR
sasaki
November 22, 2019
More Decks by sasaki
See All by sasaki
FinOpsとタグ付け防止対策 / CCoE Osaka FinOps Tags
taishin
1
290
Glacierだからってコストあきらめてない? / JAWS Meet Glacier Cost
taishin
1
450
スケールするプロダクトと膨らむ組織 SREの挑戦と解決策 / Findy Job LT SRE
taishin
0
180
組織の変化とSREの役割進化 責務拡大にどう応えるか / globis_sre
taishin
0
430
Lambdaの運用についてのなにか / lambda_unyo
taishin
0
220
おすすめAWSコスト対策 / AWS Startup Meetup Osaka AWS Cost
taishin
1
530
プラットフォームってつくることより計測することが重要なんじゃないかという話 / Platform Engineering Meetup #8
taishin
1
1.6k
ECS Runtime Monitoring で コンテナランタイムセキュリティに入門 / nakanoshima-dev-ecs-runtime-monitoring
taishin
0
380
JAWS-UG-Osaka-guardrail
taishin
0
420
Other Decks in Technology
See All in Technology
MIRU 2026 チュートリアル
keisuke198619
0
870
『三匹の子ぶた』から学ぶネットワークセキュリティの昔と今 / Network Security: Then and Now Through the Lens of The Three Little Pigs
nttcom
1
1.8k
Digitization部 紹介資料
sansan33
PRO
2
7.7k
AIは実装を速くする。では、私たちは何を今作るべきか?-立場を越えてリリースに向き合ったチーム開発の実践 / 20260801 Hiromi Nakaya and Naoki Takahashi
shift_evolve
PRO
3
450
【CEDEC2026】『ウマ娘 プリティーダービー』 英語版のキャラクターの方言や口調をローカライズするための創造的アプローチ
cygames
PRO
1
200
Flutterをカメラで動かしたかった話
sony
1
130
Software Supply Chain Attackからクラウド環境を守るためにできること
lhazy
2
220
Agent 時代の Kaggle 展望 / kaggle-in-the-agentic-era
upura
1
670
DatadogのBits Chatが開発組織にもたらしたもの / What Bits Chat Has Brought Us
sms_tech
0
110
【CEDEC2026】『GRANBLUE FANTASY: Relink - Endless Ragnarok』のバトル制作事例 ~最高のキャラゲーを目指して~
cygames
PRO
0
230
SO-101×VLAによる3色キューブのピック&プレース
abeja
0
160
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
4.9k
Featured
See All Featured
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
210
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
410
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.7k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
540
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
240
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.4k
Leo the Paperboy
mayatellez
8
2.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
Transcript
%PDLFS.FFUVQ,BOTBJ "NB[PO&$3Λ"84ͷ֎͔Β͏ ࠤʑਅ
8IP Shinya Sasaki Head of Infrastructure Engineering at AlpacaJapan Co.,
Ltd. Osaka, Japan
"NB[PO&MBTUJD$POUBJOFS3FHJTUSZ "NB[PO&$3 w "84͕ఏڙ͢ΔϓϥΠϕʔτίϯςφϨδετϦ w
&$3ྉۚ w ετϨʔδ w 64%(# w σʔλసૹ *O w
ແྉ w σʔλసૹ 0VU w ˠ w ಉҰϦʔδϣϯͷ&$ͱͷσʔλసૹແྉ ౦ژϦʔδϣϯɺݱࡏ https://aws.amazon.com/jp/ecr/pricing/
ࢀߟ %PDLFS)VCͷྉۚ ݱࡏ https://hub.docker.com/pricing
ࢀߟ %PDLFSVCͷྉۚ https://aws.amazon.com/jp/about-aws/whats-new/2019/10/announcing-image-scanning-for-amazon-ecr/
Ұൠతͳ
ύϒϦοΫϨδετϦ͔Βͷ1VMM Public Repository docker pull (Image) Download
ϓϥΠϕʔτϨδετϦ͔Βͷ1VMM Private Repository docker pull (Image) Download docker login -u
(User) -p (Pass) (URL) Login Succeeded
"NB[PO&$3͔Βͷ1VMM
"84αʔϏε͔Β&$3Πϝʔδͷ1VMM ECR AWS Account docker pull (Image) Download EKS ECS
IAM Role IAM Role ECR͔ΒͷPull͕ڐՄ͞ΕͨϙϦγʔ
"84αʔϏε͔Βͷ1VMM ΫϩεΞΧϯτ ECR AWS Account A docker pull (Image) Download
EKS ECS IAM Role IAM Role ECR͔ΒͷPull͕ڐՄ͞ΕͨϙϦγʔ AWS Account B ผΞΧϯτΛڐՄ͢ΔϙϦγʔ
"84֎͔Βͷ&$3Πϝʔδͷ1VMM ECR AWS Account GetAuthorizationToken (aws ecr get-login) Token docker
login -u AWS -p (Token) (ECR URL) Login Succeeded docker pull (Image) Download ECR͔ΒͷPull͕ڐՄ͞ΕͨϙϦγʔ
"84֎ͷLT͔Βͷ1VMM ECR AWS Account aws ecr get-login Other k8s cluster
"NB[PO&$3%PDLFS$SFEFOUJBM)FMQFS w BXTFDSHFUMPHJO͕ෆཁʹͳΔ w EPDLFSͷDSFEFOUJBMIFMQFSΛ͏ w શϊʔυʹΫϨσϯγϟϧΛஔ͘ʁ https://github.com/awslabs/amazon-ecr-credential-helper
*NBHF1VMM4FDSFUTΛ͍͍͑Β͍͠ kubectl create secret docker-registry <name> \ --docker-server=DOCKER_REGISTRY_SERVER \ --docker-username=DOCKER_USER
\ --docker-password=DOCKER_PASSWORD \ --docker-email=DOCKER_EMAIL
https://docs.aws.amazon.com/ja_jp/AmazonECR/latest/userguide/ECR_AWSCLI.html This command provides an authorization token that is valid
for the specified registry for 12 hours.
https://medium.com/@damitj07/how-to-configure-and-use-aws-ecr-with-kubernetes-rancher2-0-6144c626d42c
https://medium.com/@damitj07/how-to-configure-and-use-aws-ecr-with-kubernetes-rancher2-0-6144c626d42c aws ecr get-login ͯ͠ɺ imagePullSecret Λ࡞Γ͢jobΛ ͓͖̒࣌ؒʹ࣮ߦ(cronjob)ͤ͞Δ
https://medium.com/@damitj07/how-to-configure-and-use-aws-ecr-with-kubernetes-rancher2-0-6144c626d42c - /bin/sh - -c - |- ACCOUNT=1234567890 REGION=my-region-1 SECRET_NAME=${REGION}-ecr-registry
[email protected]
TOKEN=`aws ecr get-login --region ${REGION} --registry-ids ${ACCOUNT} | cut -d' ' -f6` kubectl delete secret --ignore-not-found $SECRET_NAME kubectl create secret docker-registry $SECRET_NAME \ --docker-server=https://${ACCOUNT}.dkr.ecr.${REGION}.amazonaws.com \ --docker-username=AWS \ --docker-password="${TOKEN}" \ --docker-email="${EMAIL}" echo "Secret created by name. $SECRET_NAME" kubectl patch serviceaccount default -p '{"imagePullSecrets":[{"name":"'$SECRET_NAME'"}]}'
·ͱΊ w &$3ʹϩάΠϯ͢ΔͨΊʹ5PLFOͷऔಘ͕ඞཁ w 5PLFOͷ༗ޮظݶ࣌ؒͳͷͰ"84Ҏ֎ͷLT͔Β͏ ߹ߋ৽͢ΔΈ͕ඞཁ w ͬͱ͍͍ํ๏͕͋Εڭ͑ͯԼ͍͞
5IBOLZPV