์ด ํ๋ก์ ํธ๋ ๋์ด์ ๊ด๋ฆฌ ๋์ง ์๊ธฐ์ ์ถ์ฒ๋์ง ์์ต๋๋ค. ๋์ Vansinetes ํ๋ก์ ํธ๋ฅผ ์ฌ์ฉํ์๊ธฐ ๋ฐ๋๋๋ค.(21.06.23)
This project is not recommended as it is no longer maintained. Use the Vansinetes project instead.(21.06.23)
์ฝ๊ณ ๋น ๋ฅธ Docker+Kubernetes ๊ฐ๋ฐ, ํ์ต ๋ฐ ๊ฐ์ ํ๊ฒฝ ๊ตฌ์ถ์ ์ํด ์ค๊ณ๋
Vagrant, Ansible, Kubespray๋ฅผ ์ฌ์ฉํ IaC(Infra as Code) ๋๊ตฌ
์ฌ์ฉ์์ ํ๊ฒฝ์ Vagrant์ VirtualBox๊ฐ ๋ฏธ๋ฆฌ ์ค์น๋์์ด์ผ ํ๋ค.
1. .env ํ์ผ์ ๊ตฌ์ฑํ๋ค.
2. kubespray๋ฅผ ์๋์ผ๋ก ๊ตฌ์ฑํ๊ณ ์ถ๋ค๋ฉด, CLUSTER_STRUCTURE_AUTO_CREATE=no์ผ๋ก ์ต์ ์ ์ค์ ํ๊ณ , cluster folder ๋ฅผ ๋ชฉ์ ์ ๋ง๊ฒ ๊ตฌ์ฑํ๋ค.
3. Vagrantfile์ด ์์นํ ๊ฒฝ๋ก์์ ํ๋จ์ ๋ช ๋ น์ด๋ฅผ bash ์์ ์ ๋ ฅํ๋ค.
$ vagrant plugin install vagrant-env
$ vagrant up --color
$ vagrant ssh $(vagrant status | tail -5 | sed -n '1p' | awk '{ print $1}') // ๊ธฐ๋ณธ ์ค์ $ vagrant ssh m1
๋ช ๊ฐ์ง alias๊ฐ ์๋ ๋ฑ๋ก๋๋ค.
alias ans='ansible'
alias anp='ansible-playbook'
alias k='kubectl'
1. ํ๋ก๋น์ ์ด ์คํจํ ๊ฒฝ์ฐ vagrant provision ๋ช ๋ น์ด๋ก ์ด๋ฅผ ๋ค์ ์๋ํ๋ค.
2. vagrant destroy --force && vagrant up ์ ๊ฐ์ด ๊ฐ์๋จธ์ ์ ์ญ์ ํ๊ณ ๋ค์ ์์ฑํ ๋,
๊ฐํน ์ ์์ ์ผ๋ก ์ญ์ ๋ ๊ฒ์ผ๋ก ๋ณด์ด์ง๋ง ์ค์ ๋ก๋ ์ญ์ ๋์ง ์์์ ์คํจํ๋ ๊ฒฝ์ฐ๊ฐ ์์ผ๋ฏ๋ก ๋ฒ์ถ์ผ ๋จธ์ ํ๊ฒฝ์ค์ ์ ๊ฐ์๋จธ์ ํ์ผ ์ ์ฅ ๊ฒฝ๋ก์์ ์ด๋ฅผ ์ง์ ํ์ธํด์ ์ญ์ ํ ๋ค์ ์๋ํ๋ค.
3. kubernetes ํ๋ก๋น์ ์ด ๊ณ์ ์คํจํ๋ ๊ฒฝ์ฐ, ๋ค์์ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํ์ฌ ๋ค์ ์๋ํ๋ค.
// host machine
$ vagrant ssh $(vagrant status | tail -5 | sed -n '1p' | awk '{ print $1}') // ๊ธฐ๋ณธ ์ค์ , $ vagrant ssh m1
// guest machine
$ cd environment/kubernetes && ansible-playbook -i inventory.ini kubespray/reset.yml -v --become --become-user=root
$ yes
$ exit
// host machine
$ vagrant provision $(vagrant status | tail -5 | sed -n '1p' | awk '{ print $1}') // ๊ธฐ๋ณธ ์ค์ , $ vagrant provision m1
IaC (Infra as Code) tool designed for easy and fast Docker + Kubernetes development, learning, and lecture environment construction
with using Vagrant, Ansible, Kubespray.
Vagrant and VirtualBox must be installed in the user's environment in advance.
1. Configure the .env file.
2. If you want to configure kubespray with manually, set CLUSTER_STRUCTURE_AUTO_CREATE=no then configure the cluster folder.
3. Type the following command into the bash shell in the path where the Vagrantfile is located.
$ vagrant plugin install vagrant-env
$ vagrant up --color
$ vagrant ssh $(vagrant status | tail -5 | sed -n '1p' | awk '{ print $1}') // By default, $ vagrant ssh m1
Several aliases are automatically registered.
alias ans='ansible'
alias anp='ansible-playbook'
alias k='kubectl'
1. If provisioning fails, try again with the vagrant provision command.
2. When deleting and recreating a virtual machine like vagrant destroy --force && vagrant up,
it appears to have been deleted normally, but it is not actually deleted once at a time. Check it yourself, delete it, and try again.
3. If kubernetes provisioning continues to fail, try again by entering the following command.
// host machine
$ vagrant ssh $(vagrant status | tail -5 | sed -n '1p' | awk '{ print $1}') // By default, $ vagrant ssh m1
// guest machine
$ cd environment/kubernetes && ansible-playbook -i inventory.ini kubespray/reset.yml -v --become --become-user=root
$ yes
$ exit
// host machine
$ vagrant provision $(vagrant status | tail -5 | sed -n '1p' | awk '{ print $1}') // By default, $ vagrant provision m1
์นด์๋ฌด๋ผ ์ธ์ด๊ณ ,๊ธฐํ๋
ธ ํ๋ก์ค,๋์นด์ผ๋ง ํ์นดํ๋ก,๊ตฌ์ฌ์นด๋ฒ ํ์นด์ํค,๋ฆฌ์ฟ ๋ฅดํธ ํ
ํฌ๋๋ก์ง
๋ฒ์ญ ์์ฑ๊ฑด,์์ง๋ท์ปด(2020),IT ์ด์ฉ ์ฒด์ ๋ณํ๋ฅผ ์ํ ๋ฐ๋ธ์ต์ค
์ ์์ฒ,๊ณต์ฉ์ค,ํ์์ฉ,์ ๊ฒฝ๋ก,๋์๋ถ์ค(2020),์ฟ ๋ฒ๋คํฐ์ค ์ ๋ฌธ
ํธ๋์ค๋ฒ,์ผ์ ๋ฉ๋ชจ์ฅ
์ํ์ฐ๊ฐ ๋ง๋๋ ์ธ์
์กฐ๋ฌตํ,Ruby ์ฒ์ ๋ฐฐ์ฐ๊ธฐ:๋ฐ์ดํฐํ์
yundream,Joinc
asdf,๋
ธ๋ ฅ ์ด๊ธฐ๋ ์ฌ๋ฅ ์๊ณ ๋
ธ๋ ฅ ์ธ๋ฉดํ๋ ๊ฒฐ๊ณผ๋ ์๋ค
YOUNG.K
์ธ๋ชจ๋ฐ
Sentimental Programmer
๋ถ๋ค์์ ์ด๊ฒ์ ๊ฒ
mydailytutorials,Working with Environmentโ Variables in Ansible
How to create a file in ansible
๋ธ๋๋ ์ ๋ธ๋ก๊ทธ
alice_k106๋์ ๋ธ๋ก๊ทธ
teamsmiley ๋ธ๋ก๊ทธ
Tunelinux home
Daegwon Nacyot Kim,44BITS
์กฐํ,๋ค์ํ ํ๊ฒฝ์ ์ค์๋ธ(Ansible)๋ก ๊ด๋ฆฌํ๊ธฐ with ๋ฒ ์ด๊ทธ๋ฐํธ(Vagrant)
kairen/kubeadm-ansible
kubernetes-sigs/kubespray
junegunn/vim-plug
pearofducks/ansible-vim
tpope/vim-pathogen
chase/vim-ansible-yaml
telus/ansible-motd