본문 바로가기

k8s5

pod evicted 난 pod 일괄 삭제하기 evicted가 된 pod의 경우 계속 pod에 남아 있어서 k8s 화면에 빨간색으로 떠 있게 된다.. (이게 너무 싫음) 그래서 evicted된 pod를 모두 일괄 삭제하기로 했다. 우선 evicted된 원인 확인을 위해 evicted 된 pod의 describe를 log에 저장한다. kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl describe pods {} > evicted.log 해당 log 저장이 완료되었으면 이제 해당 pod들을 삭제해주자. k get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pods {} 2024. 2. 6.
k8s deployment에 sidecar 적용해보기 대부분의 pod는 1 pod = 1 container가 기본이나 동작 방식이나 응용 방식에 따라서 1pod안에 여러 개의 container를 두는 경우가 있다. 이러한 경우를 sidecar라고 하며 아래의 구조와 같다. 그냥 nginx를 별도 pod로 띄우고 micro service를 하면 되지 않을까?? 라는 생각을 잠시 하였으나, web application의 경우 nginx와 통신하기 위해서는 cross domain 문제도 설정해야 하는 이슈 등이 있기 때문에 일단 간편하게 위와 같은 방식으로 사용했다. sidecar를 설정하기 위해서는 아래와 같이 deployment.yaml을 작성해 주면 된다. apiVersion: apps/v1 kind: Deployment metadata: name: pro.. 2023. 9. 25.
kubeflow pvc에 있는 모델 inference하기 이번에는 pvc에 있는 model을 kubeflow inference service를 이용하여 serving을 진행해보도록 하자. kubeflow ui에서 왼쪽 models 메뉴를 클릭한 후 NEW MODEL SERVER를 클릭하자. 클릭하면 빈 화면이 나타나는데 해당 화면에 inference service에서 사용할 yaml 값을 기입하자. inference.yaml apiVersion: "serving.kubeflow.org/v1beta1" kind: "InferenceService" metadata: name: “iris" spec: predictor: sklearn: Image: sklearn-server:v0.6.1 storageUri: "pvc://test/model” 위의 yaml 값을 입력.. 2022. 12. 30.
Kubeflow pipeline 작성 및 pvc에 저장하기 kubeflow를 통해 모델 생성을 위한 pipeline을 작성하고 작성된 모델을 kfserving을 통해 serving을 해볼 수가 있다. 오늘은 그 작업을 해보려고 한다. 우선 pipeline을 작업하기 위해서는 아래와 같은 requirements 가 필요하다. kfp == 1.8.9 scikit-learn == 1.0.1 dill == 0.3.4 numpy kfserving 위 python package를 설치했다면 이제 pipeline을 위한 코드를 작성해보자. pipeline.py import kfp from kfp import onprem from kfp import dsl def preprocess_op(): return dsl.ContainerOp( name='Preprocess Data'.. 2022. 12. 29.
[KUBEFLOW] 1. Data science at scale https://www.manning.com/books/kubeflow-in-action Kubeflow in Action Kubeflow simplifies and automates machine learning tasks like interactive analysis, complex pipelines, and model training. Seamlessly push models to production in the containerized and distributed environment and scale your ML infrastructure from your lapt www.manning.com kubeflow는 데이터 사전 처리에서 모델 학습, 배포까지의 모든 기능을 제공하는 프레임워크이다. 1.. 2022. 2. 12.