SlideShare a Scribd company logo
1 of 18
Download to read offline
kubespray 설치
onpremise 환경
kubespray 이해
 kubespray란?
▪ 매우 쉽고 빠르게 쿠버네티스 설치와 업그레이드
▪ ansible로 설치 스크립트 자동화
▪ CRI, CNI 등 사용자 입맛대로 설정가능
▪ 지원 환경: public cloud(aws, gce, azure ...), bare metal, vSphere ...
 kubespray 활용 용도
▪ 하이브리드 클라우드 운영 - public cloud managed 연동 onpremise 쿠버네티스 연동
AWS
onpremise EKS
kubespray
인프라구성
 인프라구성
▪ vagrant와 virtualbox로 kubespray를 설치할 인프라 구성
② vagrant up
Virtualbox
bootstrap
copntrolplane
worker
...
① 설정파일 생성
kubespray 컨트롤러
쿠버네티스 클러스터 노드
 인프라구성
▪ VM 구성
▪ bootstrap: kubespray설치 서버
▪ controlplane: 쿠버네티스 클러스터 controlpalne 노드
▪ worker: 쿠버네티스 클러스터 worker 노드
Virtualbox
bootstrap
copntrolplane1
worker1
kubespray 컨트롤러
쿠버네티스 클러스터 노드
copntrolplane2 copntrolplane3
worker2
 인프라구성
▪ vagrant VM 설정
▪ 하드웨어(cpu, memory)와 IP설정(bridge)
controlplanes:
- name: kubespray-controlpalne-1
box: generic/ubuntu1804
hostname: kubespray-controlpalne-1
ip: 192.168.25.41
memory: 4096
cpu: 4
①
②
③
 인프라구성
▪ 원격접속
▪ putty 등 ssh 원격접속
▪ 또는 vagrant ssh 사용
kubespray 설치
 설정
▪ 공통설정
▪ swap 메모리 비활성화
sudo systemctl stop ufw
sudo systemctl disable ufw
sudo swapoff -a
sudo sed -i '/swap/d' /etc/fstab
▪ 방화벽 비활성화
 설정
▪ bootstrap 설정
▪ python3설치
sudo apt install python3-pip python3-setuptools virtualenv -y
▪ 파이썬 가상환경 설치와 활성화
virtualenv --python=python3 venv
. venv/bin/activate
 설정
▪ bootstrap 설정
▪ kubespray 다운로드
sudo apt install git -y
git clone https://github.com/kubernetes-sigs/kubespray
▪ 파이썬 패키지 설치
(venv) cd kubespray
(venv) pip install -r requirements.txt
 설정
▪ ansible 실행 준비
▪ 쿠버네티스 클러스터 노드에 bootstrap ssh키 등록
Virtualbox
bootstrap
copntrolplane1
worker1
copntrolplane2 copntrolplane3
worker2
ansible
 설정
▪ ansible 실행 준비
▪ ssh키 생성
ssh-keygen -t rsa
▪ ssh키 복사
ssh-copy-id vagrant@[controlplane, worker IP]
 설정
▪ ansible 실행 준비
▪ ansible inventory.ini파일 설정
cp -rfp inventory/sample inventory/mycluster
vi inventory/mycluster/inventory.ini
 설정
▪ ansible 실행 준비
▪ CRI 변경: docker -> containerd
vi inventory/mycluster/group_vars/k8s_cluster/k8s-cluster.yml
container_manager: containerd
vi inventory/mycluster/group_vars/etcd.yml
etcd_deployment_type: host
 설치
▪ ansible 명령어로 설치
ansible-playbook -i inventory/mycluster/inventory.ini --become --become-user=root cluster.yml

More Related Content

What's hot

Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Simplilearn
 

What's hot (20)

Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)
 
K8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals TrainingK8s in 3h - Kubernetes Fundamentals Training
K8s in 3h - Kubernetes Fundamentals Training
 
SDN입문 (Overlay and Underlay)
SDN입문 (Overlay and Underlay)SDN입문 (Overlay and Underlay)
SDN입문 (Overlay and Underlay)
 
OpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platformOpenShift 4, the smarter Kubernetes platform
OpenShift 4, the smarter Kubernetes platform
 
Ansible
AnsibleAnsible
Ansible
 
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model  20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
20190814 AWS Black Belt Online Seminar AWS Serverless Application Model
 
Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17Hands-On Introduction to Kubernetes at LISA17
Hands-On Introduction to Kubernetes at LISA17
 
[OpenInfra Days Korea 2018] (Track 2) Neutron LBaaS 어디까지 왔니? - Octavia 소개
[OpenInfra Days Korea 2018] (Track 2) Neutron LBaaS 어디까지 왔니? - Octavia 소개[OpenInfra Days Korea 2018] (Track 2) Neutron LBaaS 어디까지 왔니? - Octavia 소개
[OpenInfra Days Korea 2018] (Track 2) Neutron LBaaS 어디까지 왔니? - Octavia 소개
 
Linux on Power と x86 Linux との技術的な相違点
Linux on Power と x86 Linux との技術的な相違点Linux on Power と x86 Linux との技術的な相違点
Linux on Power と x86 Linux との技術的な相違点
 
Open shift 4 infra deep dive
Open shift 4    infra deep diveOpen shift 4    infra deep dive
Open shift 4 infra deep dive
 
Oracle DB를 AWS로 이관하는 방법들 - 서호석 클라우드 사업부/컨설팅팀 이사, 영우디지탈 :: AWS Summit Seoul 2021
Oracle DB를 AWS로 이관하는 방법들 - 서호석 클라우드 사업부/컨설팅팀 이사, 영우디지탈 :: AWS Summit Seoul 2021Oracle DB를 AWS로 이관하는 방법들 - 서호석 클라우드 사업부/컨설팅팀 이사, 영우디지탈 :: AWS Summit Seoul 2021
Oracle DB를 AWS로 이관하는 방법들 - 서호석 클라우드 사업부/컨설팅팀 이사, 영우디지탈 :: AWS Summit Seoul 2021
 
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
Chef vs Puppet vs Ansible vs Saltstack | Configuration Management Tools | Dev...
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Event driven autoscaling with KEDA
Event driven autoscaling with KEDAEvent driven autoscaling with KEDA
Event driven autoscaling with KEDA
 
Aurora
AuroraAurora
Aurora
 
Kubernetes #1 intro
Kubernetes #1   introKubernetes #1   intro
Kubernetes #1 intro
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
 
Kubernates vs Openshift: What is the difference and comparison between Opensh...
Kubernates vs Openshift: What is the difference and comparison between Opensh...Kubernates vs Openshift: What is the difference and comparison between Opensh...
Kubernates vs Openshift: What is the difference and comparison between Opensh...
 
Security on AWS :: 이경수 솔루션즈아키텍트
Security on AWS :: 이경수 솔루션즈아키텍트Security on AWS :: 이경수 솔루션즈아키텍트
Security on AWS :: 이경수 솔루션즈아키텍트
 

Similar to onpremise환경에서 kubespray설치

Amazon EKS로 웹 애플리케이션 구축하기-awskrug.pdf
Amazon EKS로 웹 애플리케이션 구축하기-awskrug.pdfAmazon EKS로 웹 애플리케이션 구축하기-awskrug.pdf
Amazon EKS로 웹 애플리케이션 구축하기-awskrug.pdf
Byungho Lee
 
Aws발표자료 final
Aws발표자료 finalAws발표자료 final
Aws발표자료 final
Gi Bong Kim
 

Similar to onpremise환경에서 kubespray설치 (20)

cbhoilab vagrant와 ansible 쿠버네티스 설치 v2
cbhoilab vagrant와 ansible 쿠버네티스 설치 v2cbhoilab vagrant와 ansible 쿠버네티스 설치 v2
cbhoilab vagrant와 ansible 쿠버네티스 설치 v2
 
BRK3738 - Azure Container Instance로 시작하는 간편한 서버리스 컨테이너 개발
BRK3738 - Azure Container Instance로 시작하는 간편한 서버리스 컨테이너 개발BRK3738 - Azure Container Instance로 시작하는 간편한 서버리스 컨테이너 개발
BRK3738 - Azure Container Instance로 시작하는 간편한 서버리스 컨테이너 개발
 
세션3_데보션테크데이_gitopsinfra_v1.1.pdf
세션3_데보션테크데이_gitopsinfra_v1.1.pdf세션3_데보션테크데이_gitopsinfra_v1.1.pdf
세션3_데보션테크데이_gitopsinfra_v1.1.pdf
 
Cloud-Barista 제6차 오픈 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
Cloud-Barista 제6차 오픈 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)Cloud-Barista 제6차 오픈 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
Cloud-Barista 제6차 오픈 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
 
[네이버클라우드플랫폼 온라인 교육 시리즈] 네이버클라우드플랫폼 쿠버네티스 소개(정낙수 클라우드 솔루션 아키텍트)
[네이버클라우드플랫폼 온라인 교육 시리즈] 네이버클라우드플랫폼 쿠버네티스 소개(정낙수 클라우드 솔루션 아키텍트)[네이버클라우드플랫폼 온라인 교육 시리즈] 네이버클라우드플랫폼 쿠버네티스 소개(정낙수 클라우드 솔루션 아키텍트)
[네이버클라우드플랫폼 온라인 교육 시리즈] 네이버클라우드플랫폼 쿠버네티스 소개(정낙수 클라우드 솔루션 아키텍트)
 
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
쿠버네티스 오픈 소스와 클라우드 매니지드 서비스 접점 소개
 
[제3회 스포카콘] Kubernetes in Spoqa
[제3회 스포카콘] Kubernetes in Spoqa[제3회 스포카콘] Kubernetes in Spoqa
[제3회 스포카콘] Kubernetes in Spoqa
 
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 애플리케이션 실행환경 통합 관리 (CB-Ladybug)
 
[온라인교육시리즈] NKS에서 Cluster & Pods Autoscaling 적용
[온라인교육시리즈] NKS에서 Cluster & Pods Autoscaling 적용[온라인교육시리즈] NKS에서 Cluster & Pods Autoscaling 적용
[온라인교육시리즈] NKS에서 Cluster & Pods Autoscaling 적용
 
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
 
[넥슨] kubernetes 소개 (2018)
[넥슨] kubernetes 소개 (2018)[넥슨] kubernetes 소개 (2018)
[넥슨] kubernetes 소개 (2018)
 
Cloud-Barista 제6차 오픈 컨퍼런스 : 멀티클라우드 인프라 서비스 연동 (CB-Spider)
Cloud-Barista 제6차 오픈 컨퍼런스 : 멀티클라우드 인프라 서비스 연동 (CB-Spider)Cloud-Barista 제6차 오픈 컨퍼런스 : 멀티클라우드 인프라 서비스 연동 (CB-Spider)
Cloud-Barista 제6차 오픈 컨퍼런스 : 멀티클라우드 인프라 서비스 연동 (CB-Spider)
 
Amazon EKS로 웹 애플리케이션 구축하기-awskrug.pdf
Amazon EKS로 웹 애플리케이션 구축하기-awskrug.pdfAmazon EKS로 웹 애플리케이션 구축하기-awskrug.pdf
Amazon EKS로 웹 애플리케이션 구축하기-awskrug.pdf
 
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 인프라 서비스 연동 (CB-Spider)
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 인프라 서비스 연동 (CB-Spider)Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 인프라 서비스 연동 (CB-Spider)
Cloud-Barista 제7차 컨퍼런스 : 멀티클라우드 인프라 서비스 연동 (CB-Spider)
 
jbug-vagrant
jbug-vagrantjbug-vagrant
jbug-vagrant
 
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Ladybug - 멀티 클라우드 애플리케이션 운용 관리(Multi-Cloud App...
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Ladybug - 멀티 클라우드 애플리케이션 운용 관리(Multi-Cloud App...Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Ladybug - 멀티 클라우드 애플리케이션 운용 관리(Multi-Cloud App...
Cloud-Barista 제3차 오픈 컨퍼런스 : CB-Ladybug - 멀티 클라우드 애플리케이션 운용 관리(Multi-Cloud App...
 
EKS workshop 살펴보기
EKS workshop 살펴보기EKS workshop 살펴보기
EKS workshop 살펴보기
 
Aws발표자료 final
Aws발표자료 finalAws발표자료 final
Aws발표자료 final
 
Aws개념 EC2로 API서버 구축
Aws개념 EC2로 API서버 구축Aws개념 EC2로 API서버 구축
Aws개념 EC2로 API서버 구축
 
Source To URL Without Dockerfile
Source To URL Without DockerfileSource To URL Without Dockerfile
Source To URL Without Dockerfile
 

More from choi sungwook

More from choi sungwook (20)

테라폼스터디5주차 1편
테라폼스터디5주차 1편테라폼스터디5주차 1편
테라폼스터디5주차 1편
 
컨테이너와 도커 이해
컨테이너와 도커 이해컨테이너와 도커 이해
컨테이너와 도커 이해
 
kustomize 빠르게 시작하기
kustomize 빠르게 시작하기kustomize 빠르게 시작하기
kustomize 빠르게 시작하기
 
entrypoint 오버라이딩
entrypoint 오버라이딩entrypoint 오버라이딩
entrypoint 오버라이딩
 
젠킨스 컨셉
젠킨스 컨셉젠킨스 컨셉
젠킨스 컨셉
 
System Manager를 이용한 EC2 원격쉘 접속
System Manager를 이용한 EC2 원격쉘 접속System Manager를 이용한 EC2 원격쉘 접속
System Manager를 이용한 EC2 원격쉘 접속
 
aws profile관리
aws profile관리aws profile관리
aws profile관리
 
nginx 입문 공부자료
nginx 입문 공부자료nginx 입문 공부자료
nginx 입문 공부자료
 
nginx 504 timeout오류 해결
nginx 504 timeout오류 해결nginx 504 timeout오류 해결
nginx 504 timeout오류 해결
 
AWS 다른계정 리소스 사용방법
AWS 다른계정 리소스 사용방법AWS 다른계정 리소스 사용방법
AWS 다른계정 리소스 사용방법
 
docker build cache
docker build cachedocker build cache
docker build cache
 
Dockerfile과 도커 이미지 레이어 관계
Dockerfile과 도커 이미지 레이어 관계Dockerfile과 도커 이미지 레이어 관계
Dockerfile과 도커 이미지 레이어 관계
 
도커 이미지 레이어 구조
도커 이미지 레이어 구조도커 이미지 레이어 구조
도커 이미지 레이어 구조
 
helm 입문
helm 입문helm 입문
helm 입문
 
Prometheus 원리와 예제
Prometheus 원리와 예제Prometheus 원리와 예제
Prometheus 원리와 예제
 
쿠버네티스 멀티 클러스터 관리
쿠버네티스 멀티 클러스터 관리쿠버네티스 멀티 클러스터 관리
쿠버네티스 멀티 클러스터 관리
 
EC2 기타비용
EC2 기타비용EC2 기타비용
EC2 기타비용
 
스프링부트 JPA와 mariadb 도커 컨테이너 연동
스프링부트 JPA와 mariadb 도커 컨테이너 연동스프링부트 JPA와 mariadb 도커 컨테이너 연동
스프링부트 JPA와 mariadb 도커 컨테이너 연동
 
윈도우에서 도커 설치
윈도우에서 도커 설치윈도우에서 도커 설치
윈도우에서 도커 설치
 
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
[개인 프로젝트] 쿠버네티스를 이용한 개발환경 자동화 구축시스템 - 프로토타입
 

onpremise환경에서 kubespray설치

  • 3.  kubespray란? ▪ 매우 쉽고 빠르게 쿠버네티스 설치와 업그레이드 ▪ ansible로 설치 스크립트 자동화 ▪ CRI, CNI 등 사용자 입맛대로 설정가능 ▪ 지원 환경: public cloud(aws, gce, azure ...), bare metal, vSphere ...
  • 4.  kubespray 활용 용도 ▪ 하이브리드 클라우드 운영 - public cloud managed 연동 onpremise 쿠버네티스 연동 AWS onpremise EKS kubespray
  • 6.  인프라구성 ▪ vagrant와 virtualbox로 kubespray를 설치할 인프라 구성 ② vagrant up Virtualbox bootstrap copntrolplane worker ... ① 설정파일 생성 kubespray 컨트롤러 쿠버네티스 클러스터 노드
  • 7.  인프라구성 ▪ VM 구성 ▪ bootstrap: kubespray설치 서버 ▪ controlplane: 쿠버네티스 클러스터 controlpalne 노드 ▪ worker: 쿠버네티스 클러스터 worker 노드 Virtualbox bootstrap copntrolplane1 worker1 kubespray 컨트롤러 쿠버네티스 클러스터 노드 copntrolplane2 copntrolplane3 worker2
  • 8.  인프라구성 ▪ vagrant VM 설정 ▪ 하드웨어(cpu, memory)와 IP설정(bridge) controlplanes: - name: kubespray-controlpalne-1 box: generic/ubuntu1804 hostname: kubespray-controlpalne-1 ip: 192.168.25.41 memory: 4096 cpu: 4 ① ② ③
  • 9.  인프라구성 ▪ 원격접속 ▪ putty 등 ssh 원격접속 ▪ 또는 vagrant ssh 사용
  • 11.  설정 ▪ 공통설정 ▪ swap 메모리 비활성화 sudo systemctl stop ufw sudo systemctl disable ufw sudo swapoff -a sudo sed -i '/swap/d' /etc/fstab ▪ 방화벽 비활성화
  • 12.  설정 ▪ bootstrap 설정 ▪ python3설치 sudo apt install python3-pip python3-setuptools virtualenv -y ▪ 파이썬 가상환경 설치와 활성화 virtualenv --python=python3 venv . venv/bin/activate
  • 13.  설정 ▪ bootstrap 설정 ▪ kubespray 다운로드 sudo apt install git -y git clone https://github.com/kubernetes-sigs/kubespray ▪ 파이썬 패키지 설치 (venv) cd kubespray (venv) pip install -r requirements.txt
  • 14.  설정 ▪ ansible 실행 준비 ▪ 쿠버네티스 클러스터 노드에 bootstrap ssh키 등록 Virtualbox bootstrap copntrolplane1 worker1 copntrolplane2 copntrolplane3 worker2 ansible
  • 15.  설정 ▪ ansible 실행 준비 ▪ ssh키 생성 ssh-keygen -t rsa ▪ ssh키 복사 ssh-copy-id vagrant@[controlplane, worker IP]
  • 16.  설정 ▪ ansible 실행 준비 ▪ ansible inventory.ini파일 설정 cp -rfp inventory/sample inventory/mycluster vi inventory/mycluster/inventory.ini
  • 17.  설정 ▪ ansible 실행 준비 ▪ CRI 변경: docker -> containerd vi inventory/mycluster/group_vars/k8s_cluster/k8s-cluster.yml container_manager: containerd vi inventory/mycluster/group_vars/etcd.yml etcd_deployment_type: host
  • 18.  설치 ▪ ansible 명령어로 설치 ansible-playbook -i inventory/mycluster/inventory.ini --become --become-user=root cluster.yml