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
270
Glacierだからってコストあきらめてない? / JAWS Meet Glacier Cost
taishin
1
410
スケールするプロダクトと膨らむ組織 SREの挑戦と解決策 / Findy Job LT SRE
taishin
0
170
組織の変化とSREの役割進化 責務拡大にどう応えるか / globis_sre
taishin
0
390
Lambdaの運用についてのなにか / lambda_unyo
taishin
0
210
おすすめAWSコスト対策 / AWS Startup Meetup Osaka AWS Cost
taishin
1
520
プラットフォームってつくることより計測することが重要なんじゃないかという話 / Platform Engineering Meetup #8
taishin
1
1.5k
ECS Runtime Monitoring で コンテナランタイムセキュリティに入門 / nakanoshima-dev-ecs-runtime-monitoring
taishin
0
370
JAWS-UG-Osaka-guardrail
taishin
0
400
Other Decks in Technology
See All in Technology
AIAU_UMEMOGU_ninomiya_slide
ninomiya_ii
0
260
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
2k
AI時代のコスト管理を考えよう〜明日から使える実践AWSノウハウ~
yoshimi0227
0
800
AIネイティブな開発のサプライチェーンリスク対策 〜激動の開発現場でリスクに立ち向かう〜【ZennFes】
cscengineer
PRO
2
150
コミットの「なぜ」を読む
ota1022
0
110
SONiC Scale-Up Working Group から探る Scale-UpやUltraEthernet機能の実装方法
ebiken
PRO
2
470
自宅LLMの話
jacopen
1
710
LayerX コーポレートエンジニアリング室におけるサプライチェーンセキュリティへの取り組み / Supply Chain Security at LayerX Corporate Engineering
yuyatakeyama
3
810
[AWS Summit Japan 2026]迷っているあなたへ_小さな一歩が、やがて自分を助けてくれる
sh_fk2
1
370
2026年6月23日 Syncable Tech + Start Python Club にて
hamukazu
0
140
【セミナー資料】Claude Code をセキュアに使うための考え方と設定の勘どころ / Claude Code Webinar 20260616
masahirokawahara
2
450
作る力から、見極める力へ — AI時代に広がるエンジニアの価値と役割
rince
0
300
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
270
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
200
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
320
Crafting Experiences
bethany
1
190
YesSQL, Process and Tooling at Scale
rocio
174
15k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
590
Skip the Path - Find Your Career Trail
mkilby
1
150
Bash Introduction
62gerente
615
220k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
780
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
140
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