# 이 명령어를 통해 클러스터 명 확인
kubectl config get-contexts

*를 통해 현재 kubectl이 어떤 cluster를 바라보고 있는지 확인 가능.

 

다른 클러스터로 switch하는 법

kubectl config use-context aks-bonah

변경된 것을 확인할 수 있음.

'IT > Kubernetes' 카테고리의 다른 글

helm 설치  (0) 2020.08.11
kubernetes에 jupyter notebook 띄우기 (2)  (0) 2020.08.07
k8s 정리  (0) 2020.07.31
kubernetes에 jupyter notebook 띄우기 (1)  (0) 2020.07.15
cloud 관련 링크  (0) 2020.07.13

kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.

 

쿠버네티스는 컨테이너 응용 프로그램의 배포, 확장 및 관리를 자동화하는 오픈 소스 시스템입니다.

 

쿠버네티스는 조타수, 조종사 (그리스어)

 

CNCF(Cloud Native Computing Foundation)

 

쿠버네티스의 특징

1. 상태관리

2. 스케줄링

3. 클러스터

4. 서비스 디스커버리 : 서로 다른 서비스를 쉽게 찾고 통신할 수 있음

5. 리소스 모니터링

6. 스케일링 리소스에 따라 자동으로 서비스를 조정함

7. rollout/rollback 배포/롤백 및 버전관리

 

다양한 배포방식

 

Ingress 설정

 

Namespace, Label 관리

 

RBAC( 사용자에 따른 제어) 권한 자유자재로 부여

 

계속해서 원하는 상태를 만들기 위해서 현재의 상태를 바꾸는 것 = 쿠버네티스의 기본 개념이다.

이러한 상태를 어떻게 관리한다? 명령적 방식 보다는 선언적방식(yaml 파일!)으로 정의해서 관리한다.

 

kubernetes 사용하기 - 원하는 상태(desired state)를 다양한 오브젝트(object)에 라벨(Label)을 붙여 정의(yaml)하고 API 서버에 전달.

'IT > Kubernetes' 카테고리의 다른 글

helm 설치  (0) 2020.08.11
kubernetes에 jupyter notebook 띄우기 (2)  (0) 2020.08.07
kubernetes multiple cluster일때 cluster 옮기는 방법  (0) 2020.08.03
kubernetes에 jupyter notebook 띄우기 (1)  (0) 2020.07.15
cloud 관련 링크  (0) 2020.07.13

안녕하세요 본아에요~

 

오늘은 portal.azure.com의 vm 안에서 aks, acr등을 활용하여

 

jupyter notebook을 올리는 작업을 한번 진행해 보겠습니다.(부족한 점이 많아요)

 

1. portal azure 로그인 후, 리소스 그룹을 할당받음(리소스 그룹안에서 vm, aks, acr등이 만들어짐)

 

2. vm (ubuntu 18.04) 생성

 

3. vm 상에서 azure-cli 설치

 

 

curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
az login # Azure Cloud와의 연동

# 다음과 같은 문구가 뜬다.
#To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code HBCHP2AY5 to authenticate.

 

해당 url로 접속 후, 인증을 진행한다.

 

4. kubectl cli 설치

curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
kubectl version --client

5. docker 설치

docker는 기본적으로 root계정의 권한 아래에서 진행이 되기 때문에,

usermod를 활용하여 권한을 부여한다.

sudo apt install docker.io
docker version (client만 뜨고 server는 안뜬다)
sudo usermod -a -G docker AzureUser
sudo service docker restart
docker version
exit
docker version
docker ps -a # 컨테이너 아무것도 없음

6. Azure Container Resistory 생성

# rg-intern-2020 리소스그룹 내에 acrinternjupyter 라는 acr 생성
az acr create --resource-group rg-intern-2020 --name acrinternjupyter --sku Basic

# acrinternjupyter 리소스에 로그인
az acr login --name acrinternjupyter

rg-intern-2020 리소스 그룹내의 acr list 출력해서 보기
az acr list -g rg-intern-2020 --query "[].{acrLoginServer:loginServer}" --output table

 

7. docker hub에서 jupyter/base-notebook pull 해서 가져오기(image를 가져오는 것임)

# docker hub에서 jupyter/base-notebook 이미지 가져오기
docker pull jupyter/base-notebook

# 가져온 이미지에 태그 달기
docker tag jupyter/base-notebook acrinternjupyter.azurecr.io/base-notebook:v1

# 태그 단 이미지를 푸쉬하기(푸쉬를 하면 azure container repository로 들어가게됨)
docker push acrinternjupyter.azurecr.io/base-notebook:v1

# acr list 살펴보기
az acr repository list --name acrinternjupyter --output table

8. AKS를 생성하면서 acr과 붙이기

az aks create --resource-group rg-intern-2020 --name aks-intern-jupyter --node-count 3 --generate-ssh-keys --attach-acr acrinternjupyter

# kubectl 명령어가 먹도록 만들기 ( 이것은, kubectl 명령어가 만든 aks를 바라보도록 하는 명령어이다)
az aks get-credentials --resource-group rg-intern-2020 --name aks-intern-jupyter

9. jupyter namespace 만들어서 관리하기

kubectl create namespace jupyter

mkdir jupyter
cd jupyter
touch jupyter.yaml

kubernetes에 적용할 yaml파일 작성하기(deployment, services)

 

10. kubectl 명령어로 pods 띄우기

kubectl apply -f jupyter.yaml -n jupyter
kubectl get pods -n jupyter -w
kubectl get svc -n jupyter -w

 

여기까지가 정말 기본적으로 설치 및 주피터 노트북을 빠르게 띄우는 작업을 진행해 보았습니다.

 

다음 업로드 때에는, 영구 스토리지를 연결해서 하는 작업을 진행해 보도록 하겠습니다.

 

다음 업로드 - https://bonahbruce.tistory.com/91

 

kubernetes에 jupyter notebook 띄우기 (2)

안녕하세요 보나에요~ 전에꺼에 이어서 해볼께요! (1)을 보시고 싶으면 https://bonahbruce.tistory.com/76 여기로 들어가보세요! kubernetes에 jupyter container 띄우기 ( azure 활용) 안녕하세요 본아에요~ 오..

bonahbruce.tistory.com

 

'IT > Kubernetes' 카테고리의 다른 글

helm 설치  (0) 2020.08.11
kubernetes에 jupyter notebook 띄우기 (2)  (0) 2020.08.07
kubernetes multiple cluster일때 cluster 옮기는 방법  (0) 2020.08.03
k8s 정리  (0) 2020.07.31
cloud 관련 링크  (0) 2020.07.13

restful api : https://gmlwjd9405.github.io/2018/09/21/rest-and-restful.html

 

[Network] REST란? REST API란? RESTful이란? - Heee's Development Blog

Step by step goes a long way.

gmlwjd9405.github.io

kubenetes jupyter 연동

https://cwienczek.com/2018/05/jupyter-on-kubernetes-the-easy-way/

 

Jupyter on Kubernetes - the easy way

Introduction I have been playing a bit more with Python recently. I wanted to test out some algorithms using this awesome tool called Project Jupyter. I also did not want to drain battery of my laptop while doing this, as I have a powerful machine at home

cwienczek.com

 

'IT > Kubernetes' 카테고리의 다른 글

helm 설치  (0) 2020.08.11
kubernetes에 jupyter notebook 띄우기 (2)  (0) 2020.08.07
kubernetes multiple cluster일때 cluster 옮기는 방법  (0) 2020.08.03
k8s 정리  (0) 2020.07.31
kubernetes에 jupyter notebook 띄우기 (1)  (0) 2020.07.15

+ Recent posts