kubeflow를 설치하는데는 몇가지 어려움이 있어서 공유합니다.
- 이전 설치기록에 따른 삭제가 제대로 적용안되서 발생한 에러
- 대부분 문서가 1.2이하 버전의 내용위주와 하위버전이라는점...
- 설치시 많은 리소스가 필요에 따른 제대로 설치가 안되는점 .. 회사서버를 이용해야 할듯..
- kubeflow 공식문서를 통해서 이해하는데 어려움
환경 & 준비물
EKS kubernetes 1.21버전 사용 (가장 최신 1.22 로컬 minikube)
kubeflow 1.4.1설치 목표 - 최신 istio설치 목표
kustomize 3.2이상 ~ 4미만 설치
minikube로 설치시 제대로 설치가 안될수 있음. 아래 설치시 적절한 cpu, memory사양을 요구합니다.
kubeflow pipleline에서 설치가 제대로 안될경우, kubectl describe를 통해서 정확하나 원인을 확인해봐야함.
설치 Tool
기존 kubeflow 1.2이하 버전까지는 kfctl이라는 툴을 이용하여 설치하였습니다.
kfctl툴은 삭제해도 되며, 사용하지 맙시다.
위의 툴은 설치하는 서비스들이 2020년버전으로 특히 istio가 낮은 버전으로 설치되다보니 최신것을 사용하기 힘든 Dependency로 문제가 있습니다.
kubeflow 1.4가 있습니다.
https://github.com/kubeflow/manifests
https://github.com/kubeflow/manifests/releases
위의 release버전을 보시면 현재 1.4.1이 가장 최신입니다.
1.3부터는 설치를 kustomize을 이용하여 설치하게 되어있습니다. 꼭 참고바랍니다.
https://github.com/kubeflow/manifests#change-default-user-password
위의 문서를 참고하고 따라가기만 하면 됩니다.
아래 링크에서 중요한 부분
Kubernetes
(tested with version1.19
) with a default StorageClasskustomize
(version3.2.0
) (download link)- ⚠️ Kubeflow 1.4.0 is not compatible with the latest versions of of kustomize 4.x. This is due to changes in the order resources are sorted and printed. Please see kubernetes-sigs/kustomize#3794 and kubeflow/manifests#1797. We know this is not ideal and are working with the upstream kustomize team to add support for the latest versions of kustomize as soon as we can.
kustomize설치 참고
위의 문구에서도 Kubeflow 1.4는 kustomize 4.x가 안됩니다. 꼭 kustomize는 3.x대이하로 해주세요.
저같은경우 kustomize소스를 가지고 golang 컴파일을 통해서 내부에서 적용했습니다. 적절한 방법으로 하위 버전으로 설치하세요.
Mac기준 darwin kustomize 3.8.9버전 다운로드
wget https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv3.8.9/kustomize_v3.8.9_darwin_amd64.tar.gz
tar xvf kustomize_v3.8.9_darwin_amd64.tar.gz
mv kustomize /usr/local/bin
kubeflow의 component들 하나하나씩 설치해보자
git clone git@github.com:kubeflow/manifests.git
cd manifests
manifests안에 common을 참조하여 설치한다.
kustomize build common/cert-manager/cert-manager/base | kubectl apply -f -
kustomize build common/cert-manager/kubeflow-issuer/base | kubectl apply -f -
kustomize build common/istio-1-9/istio-crds/base | kubectl apply -f -
kustomize build common/istio-1-9/istio-namespace/base | kubectl apply -f -
kustomize build common/istio-1-9/istio-install/base | kubectl apply -f -
Dex 설치
kustomize build common/dex/overlays/istio | kubectl apply -f -
OIDC AuthService 설치
kustomize build common/oidc-authservice/base | kubectl apply -f -
Knative Install Knative Serving 설치
kustomize build common/knative/knative-serving/base | kubectl apply -f -
kustomize build common/istio-1-9/cluster-local-gateway/base | kubectl apply -f -
Knative Eventing 설치
kustomize build common/knative/knative-eventing/base | kubectl apply -f -
Kubeflow Namespace 설치
kustomize build common/kubeflow-namespace/base | kubectl apply -f -
Kubeflow Roles for Install kubeflow roles 설치
kustomize build common/kubeflow-roles/base | kubectl apply -f -
Kubeflow Istio Resources
Create the Istio resources needed by Kubeflow. This kustomization currently creates an Istio Gateway named kubeflow-gateway, in namespace kubeflow. If you want to install with your own Istio, then you need this kustomization as well.
Install istio resources:
kustomize build common/istio-1-9/kubeflow-istio-resources/base | kubectl apply -f -
Kubeflow Pipelines
kustomize build apps/pipeline/upstream/env/platform-agnostic-multi-user | kubectl apply -f -
kustomize build apps/pipeline/upstream/env/platform-agnostic-multi-user-pns | kubectl apply -f -
KFServing
Install the KFServing official Kubeflow component:
kustomize build apps/kfserving/upstream/overlays/kubeflow | kubectl apply -f -
Katib
Install the Katib official Kubeflow component:
kustomize build apps/katib/upstream/installs/katib-with-kubeflow | kubectl apply -f -
Central Dashboard - 해당 서비스를 통해서 kubeflow접근합니다.
Install the Central Dashboard official Kubeflow component:
kustomize build apps/centraldashboard/upstream/overlays/istio | kubectl apply -f -
Admission Webhook
Install the Admission Webhook for PodDefaults:
kustomize build apps/admission-webhook/upstream/overlays/cert-manager | kubectl apply -f -
Notebooks
Install the Notebook Controller official Kubeflow component:
kustomize build apps/jupyter/notebook-controller/upstream/overlays/kubeflow | kubectl apply -f -
Install the Jupyter Web App official Kubeflow component:
kustomize build apps/jupyter/jupyter-web-app/upstream/overlays/istio | kubectl apply -f -
Profiles + KFAM
Install the Profile Controller and the Kubeflow Access-Management (KFAM) official Kubeflow components:
kustomize build apps/profiles/upstream/overlays/kubeflow | kubectl apply -f -
Volumes Web App
Install the Volumes Web App official Kubeflow component:
kustomize build apps/volumes-web-app/upstream/overlays/istio | kubectl apply -f -
Tensorboard
Install the Tensorboards Web App official Kubeflow component:
kustomize build apps/tensorboard/tensorboards-web-app/upstream/overlays/istio | kubectl apply -f -
kustomize build apps/tensorboard/tensorboard-controller/upstream/overlays/kubeflow | kubectl apply -f -
Training Operator
Install the Training Operator official Kubeflow component:
kustomize build apps/training-operator/upstream/overlays/kubeflow | kubectl apply -f -
MPI Operator
Install the MPI Operator official Kubeflow component:
kustomize build apps/mpi-job/upstream/overlays/kubeflow | kubectl apply -f -
User Namespace default user (named kubeflow-user-example-com).
kustomize build common/user-namespace/base | kubectl apply -f -
실행
다 설치가 됐는지 확인해봅니다.
kubectl get pods -n cert-manager
kubectl get pods -n istio-system
kubectl get pods -n auth
kubectl get pods -n knative-eventing
kubectl get pods -n knative-serving
kubectl get pods -n kubeflow
서비스 접근
kubectl port-forward svc/istio-ingressgateway -n istio-system 8080:80
위의 서비스를 접근시 dex를 통해서 인증하게 됩니다.
auth 네임서비스의 configmap을 보시면 dex인증 기존 auth를 확인할수 있습니다.
아래 인증정보 입력해서 들어가면 끝입니다.
user@example.com / 12341234
설치가 제대로 안된경우? 네임스페이스 삭제(중요)
위의 설명되로 설치하면 문제가 없을수도 있지만, 기존의 설치하면서 이력서 남는경우,
깔끔하게 삭제가 안되는경우가 있습니다. 아래와 같이 꼭 모든 네임스페이스를 삭제해야합니다.
# 설치하고자 하는 서비스가 이미 설치가 됐다면 깔끔하게 삭제처리하자 중요....
kubectl delete ns 네임스페이스이름
# 정확히 삭제가 아닌 terminated라고 나온다면 아래와 같이 finalize를 해줘야 설치가 정상적으로 가능하다.
kubectl get ns 네임스페이스이름 -o json | \
jq '.spec.finalizers=[]' | \
curl -X PUT [http://localhost:8001/api/v1/namespaces/네임스페이스이름/finalize](http://localhost:8001/api/v1/namespaces/kourier-system/finalize) -H "Content-Type: application/json" --data @-
# 설치된 validatingwebhookconfigurations가 있는지 확인
kubectl get validatingwebhookconfigurations
# 위의 검색된 설정을 깔끔히 삭제한다. (중요)
kubectl delete validatingwebhookconfigurations istiod-istio-system
참고
https://coffeewhale.com/kubernetes/admission-control/2021/04/28/opa1
'IT&Tech' 카테고리의 다른 글
API 인증프로세스 Istio Ingress Gateway, OAuth2-Proxy and Keycloak (0) | 2022.01.20 |
---|---|
Golang을 이용한 Graphql서버 구현 (6) | 2022.01.20 |
Kubernetes 소개 (2) | 2022.01.19 |
Istio service mesh 소개 & 설치방법 (0) | 2022.01.18 |
cert-manager를 이용한 ACME 무료인증 (0) | 2022.01.18 |