개요
이 글은 kubeflow를 쉽고 간편하게 설치해주는 Distribution인 Charmed Kubeflow를 안내하는 글이다.
Charmed Kubeflow는 Canonical 에서 만든 프로젝트로 상용으로 사용해도 문제가 없다.
여기서 제공하는 Kubeflow 버전은 3가지(full, lite, edge)로 각 버전별로 기능의 수가 다르다
기존에 Kubeflow가 설치되어 있다면 따로 진행할 필요는 없다.
목표
Charmed Kubeflow 설치를 통해 kubeflow를 설치해본다.
여정
설치 요구사항은 아래와 같다
- be version 1.22
- have a (default) storage class configured
- have dns configured for accessing the dashboard,
- have a LoadBalancer and Ingress
JuJu 설치
# snap(설치 지원 패키지) 설치
sudo yum -y install epel-release
sudo yum -y install snapd
# snap 실행
sudo systemctl enable --now snapd.socket
# classic snap 심볼릭 링크 생성
sudo ln -s /var/lib/snapd/snap /snap
# classic snap으로 juju 설치
sudo snap install juju --classic
# sudo snap install juju --channel=3.1/stable
# juju 2.9.42 from Canonical✓ installed
Charmed Kubeflow 설치
# 현재 설치된 로컬 클러스터명 확인
juju clouds
# kubernetes-admin@cluster.local
juju add-credential kubernetes-admin
# Enter credential name: local-cluster
# Select auth type [certificate]: userpass
# Enter username: admin
# Enter password: [엔터 눌러서 넘김]
juju add-k8s cluster.local
# k8s admin 계정에 'kubeflow-controller'라는 이름의 컨트롤러 생성
# 컨트롤러는 이미지 배포를 담당함.
juju bootstrap cluster.local kubeflow
# kubeflow charm 설치
juju add-model kubeflow
juju deploy ch:kubeflow --trust
# 설치 시간 10~15분 정도 소요됨
watch -c juju status --color [ active | waiting | error ]
Dex, OIDC 설정
# istio-ingressgateway 이름이 붙은 service의 IP 확인
kubectl get service istio-ingressgateway -n kubeflow
# 확인한 IP를 아래와 설정
juju config dex-auth public-url=http://<IP address>
juju config oidc-gatekeeper public-url=http://<IP address>
juju config dex-auth public-url=http://10.96.67.121
juju config oidc-gatekeeper public-url=http://10.96.67.121
# 확인한 IP주소 + nip.io로 접속할 수 있음
# ex) http://10.64.140.43.nip.io.
# ID/PW 설정
juju config dex-auth static-username=user@example.com
juju config dex-auth static-password=12341234
Q & A
- Clean Up
# juju를 이용한 삭제
juju destroy-model kubeflow --destroy-storage
# 에러가 발생한 경우 강제 삭제
juju destroy-model --yes --destroy-storage --force --no-wait --debug kubeflow
# 컨트롤러 삭제
juju destroy-controller kubeflow-controller --destroy-all-models --destroy-all-models --force --no-wait --force --no-wait
- juju 모델 및 컨트롤러 삭제가 잘 안됩니다.
# 남아있는 어플리케이션 명칭 확인
watch -c juju status --color
# 하나씩 입력하면서 제거
juju remove-application --force --no-wait ${어플리케이션 이름}
# 컨트롤러와 관련된 나머지 리소스 제거
kubectl delete all --all -n controller-kubeflow-lite
kubectl delete ns controller-kubeflow-lite
# 아래 경로에서 관련된 내용 삭제
# ~/.local/share/juju/accounts.yaml
# ~/.local/share/juju/cookies
# ~/.local/share/juju/controllers.yaml
# ~/.local/share/juju/bootstrap-config.yaml
# ~/.local/share/juju/models.yaml
참고자료
https://charmed-kubeflow.io/docs/get-started-with-charmed-kubeflow
'DevOps' 카테고리의 다른 글
코드로 클러스터 구축하기 - (2) 네트워크 생성 (0) | 2023.08.10 |
---|---|
코드로 클러스터 구축하기 - (1) AWS 네트워크 기본 개념 (0) | 2023.08.10 |
IaC로 쿠버네티스 환경 구축하기 (Ansible + Kubespray) (0) | 2023.04.15 |
Kubeflow 라이징 - BentoML로 Model Serving하기 (1) | 2023.04.01 |
Secure K8S - RBAC 설정을 통한 멀티 클러스터 환경 분리 (0) | 2023.03.12 |