Autoscale ๊ฐ๋ฅํ ์ํคํ
์ณ
๊ธฐ๋ณธ ํ๊ฒฝ์ AWS๋ฅผ ์ด์ฉํ๊ณ , ๊ด๋ จ ์๋ ์ฃผ์ ์๋น์ค๋ค์ ๋ค์ ํ์ ๊ฐ๋ค.
virtual network environment
2.1 ์ํ ๊ตฌ์กฐ
[์ถ์ฒ] https://bit.ly/2UwnZcD AutoScale์ ๊ฒฝ์ฐ Scale Out์ ํตํ ์๋ฒ ๋์๋ฅผ ๋๋ ค ์ฒ๋ฆฌ ๋ฅ๋ ฅ์ ํฅ์
AWS : EC2 Auto Scaling
Azure : Virtual Machine Scale Sets
3.1.1 ๊ตฌ์ฑ์์
Groups : ์ธ์คํด์ค ์ ์ง์
Configuration templates : AMI, ์ธ์คํด์ค ํ์
, ํคํ์ด, ๋ณด์๊ทธ๋ฃน ๋ฑ
Scaling options : ๋์ ์กฐ๊ฑด ์ค์
[์ถ์ฒ] https://craig.goddenpayne.co.uk/task-autoscaling-fargate/ AMI(Amazon Machine Image)๋ EC2๋ฅผ ์ฒ์ ๊ตฌ์ฑํ ๋ ์ง์ ํ๋ ์ํํธ์จ์ด๊ฐ ๊ตฌ์ฑ๋ ์ผ์ข
์ ํ
ํ๋ฆฟ
AMI ์ข
๋ฅ 1. AWS ๊ธฐ๋ณธ ์ด๋ฏธ์ง 2. AWS Marketplace ์ด๋ฏธ์ง 3. Custom ์ด๋ฏธ์ง
3.3 ํ๋ก๋น์ ๋(Provisioning)
์ฌ์ฉ์์ ์๊ตฌ์ ๋ง๊ฒ ์๋ฒ๋ฅผ ์ค์ ํด ๋์๋ค๊ฐ ํ์ ์ ์๋ฒ๋ฅผ ์ฆ์ ์ฌ์ฉํ ์ ์๋ ์ํ๋ก ๋ฏธ๋ฆฌ ์ค๋นํด ๋๋ ๊ฒ (feat. wikipedia)
ex) JDK๋ MySQL์ ๋ฏธ๋ฆฌ ์ค์นํ๊ฑฐ๋ ์ค์
3.3.1.1 Packer
Build Automated Machine Images 1. Builder : ์ด๋ฏธ์ง ์์ฑํ ํ๋ซํผ ์ง์ (AWS, Azure, Google, docker, vmware, Hyper-V, Naver...)
2. Provisioner : ์ด๋ฏธ์ง ์์ฑํ ๋ ์ฌ์ฉํ ๋น๋ ๋๊ตฌ (Shell, Ansible, Chef, Salt, Puppet..) 3. Template : Builder + Provisioner ์ค์ ํ์ผ (output:json)
3.3.1.2 Ansible
Configuration Management
Title Bar : Ansible is Simple IT Automation
Automation for everyone
Packer์์๋ ๋ฌผ๋ก shell script๋ฅผ ํตํด์ ๊ตฌ์ฑ ๊ด๋ฆฌ๊ฐ ๊ฐ๋ฅํ๋, script ๋๋น ansible์์๋ ํ์ผ๊ด๋ฆฌ, ํจํค์ง์ค์น, ์์คํ
๊ด๋ฆฌ์ ๋ํ ๋ชจ๋ ์ง์
3.3.1.3 terraform
Infarstructure Provisioning
Use Infrastructure as Code to provision and manage any cloud, infrastructure, or service
๊ณํ์ ํตํด ํด๋ผ์ฐ๋์ ๋ฐฐํฌ(์ค์ ์ ์ฉ)์ ๋ฆฌ์์ค์ ๋ณ๊ฒฝ๋๋ ๋ด์ฉ์ ์ฌ์ ํ์ธ ๊ฐ๋ฅ
Stamp Pattern
[์ถ์ฒ] https://read.acloud.guru/immutable-ami-with-packer-a71694529d60 [์ถ์ฒ] https://blog.gofynd.com/how-we-rebuilt-fynds-infrastructure-3238ec757281 3.4 ์ถ๊ฐ์ฌํญ
Blue/Green ๋ฐฐํฌ ํ์ฉ
Scale Out Pattern
[์ถ์ฒ] https://datacenterrookie.wordpress.com/2017/05/10/bluegreen-deployment-on-aws/ Weight Transition Pattern
[์ถ์ฒ] https://aws.amazon.com/blogs/startups/upgrades-without-tears-part-2-bluegreen-deployment-step-by-step-on-aws/