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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
280
Glacierだからってコストあきらめてない? / JAWS Meet Glacier Cost
taishin
1
440
スケールするプロダクトと膨らむ組織 SREの挑戦と解決策 / Findy Job LT SRE
taishin
0
180
組織の変化とSREの役割進化 責務拡大にどう応えるか / globis_sre
taishin
0
400
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
410
Other Decks in Technology
See All in Technology
公式ドキュメントの歩き方etc
coco_se
1
120
はじめてのWDM
miyukichi_ospf
1
150
【Claude Code】鹿野さんに聞く 私の推しの並行開発環境 大公開 / claude-code-parallel-2026-07-15
tonkotsuboy_com
12
8.6k
最適な自走を最小限の支援で — M&Aで拡大する組織で少人数SREが挑んだ1年 / SRE NEXT 2026
genda
0
1.5k
アップデートで何が変わった?デモで学んで使いこなすIBM Bob2.0
muehara
0
110
シンガポールで登壇してきます
yama3133
0
240
[2026-07-15] AI Ready なはずだったアーキテクチャと、見えてきた課題・次に目指す状態
wxyzzz
9
4k
CSに"SLO"は要らない、経営層に"99.9%"は伝わらない - SREを全社に"翻訳"する3原則
cscengineer
PRO
1
5k
SRE本の知られざる名シーン / The Hidden Gems of Google SRE Book
nari_ex
1
420
「AIに依存している」と 「AIを使いこなしている」の違い
k8yasuma
0
110
AIが実装を自走する時代の認知負債との戦い
lycorptech_jp
PRO
0
140
世界、断片、モデル。そして理解
ardbeg1958
1
130
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Making Projects Easy
brettharned
120
6.7k
sira's awesome portfolio website redesign presentation
elsirapls
0
300
Facilitating Awesome Meetings
lara
57
7k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
260
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
340
GitHub's CSS Performance
jonrohan
1033
470k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
370
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