Kubeflow Install with Docker

이준석·2024년 7월 2일
0

BTC

목록 보기
5/6

EC2 생성

  • Kubeflow를 설치하기 위한 EC2 생성
  • 단순 설치용이라 AMI 크게 신경 안 써도 됨

Docker 설치

  • EC2에 접속하여 Docker 설치
curl -s https://get.docker.com | sudo su
  • Docker 권한 부여
sudo usermod -aG docker $USER

Docker로 Ubuntu 환경 구성

  • Ubuntu 이미지의 최신 버전을 가져오기
docker pull ubuntu:latest
  • 컨테이너에 연결
docker container run -it -p 127.0.0.1:8080:8080 ubuntu:latest
  • 저장소 Update
apt update
  • 필요한 도구 설치
apt install git curl unzip tar make sudo vim wget -y

Git Clone

export KUBEFLOW_RELEASE_VERSION=v1.7.0
export AWS_RELEASE_VERSION=v1.7.0-aws-b1.0.3
git clone https://github.com/awslabs/kubeflow-manifests.git && cd kubeflow-manifests
git checkout ${AWS_RELEASE_VERSION}
git clone --branch ${KUBEFLOW_RELEASE_VERSION} https://github.com/kubeflow/manifests.git upstream

도구 설치

make install-tools
Error : python3.8이 설치가 안됨
  • 해결 방안
add-apt-repository ppa:deadsnakes/ppa
Error : add-apt-repository가 없음
  • 해결방안
sudo apt-get install software-properties-common

add-apt-repository ppa:deadsnakes/ppa

# 다시 도구 설치
make install-tools

alias python=python3.8

AWS Configure 구성

aws configure --profile=kubeflow

export AWS_PROFILE=kubeflow

MFA 설정

aws sts get-session-token --profile ljs --duration-seconds 129600 --serial-number arn:aws:iam::xxxxxxx:mfa/DevOps3 --token-code xxxxxx

aws configure set aws_access_key_id 위 명령어의 output
aws configure set aws_secret_access_key 위 명령어의 output
aws configure set aws_session_token 위 명령어의 output

EKS 생성

  • 환경 변수 지정
export CLUSTER_NAME=$CLUSTER_NAME
export CLUSTER_REGION=$CLUSTER_REGION
  • EKS 생성
eksctl create cluster \
--name ${CLUSTER_NAME} \
--version 1.25 \
--region ${CLUSTER_REGION} \
--nodegroup-name linux-nodes \
--node-type m5.xlarge \
--nodes 5 \
--nodes-min 5 \
--nodes-max 10 \
--managed \
--with-oidc
  • 생성 확인

0개의 댓글