본문 바로가기
반응형

IT80

Kubernetes CronJob CronJob 이란CronJob은 정해진 시간 간격에 따라 작업(Job)을 주기적으로 실행할 수 있도록 하는 Kubernetes 리소스입니다. 일반적인 예로는 데이터베이스 백업, 로그 정리, 주기적인 보고서 생성 등이 있습니다CronJob의 구성 요소  구성 요소설명Schedule작업 실행 주기를 설정하는 Cron 표현식Job Template실행할 작업의 템플릿을 정의Concurrency Policy작업의 동시 실행 정책 (Allow, Forbid, Replace)Starting Deadline작업이 시작될 수 있는 최대 지연 시간 (초 단위) concurrencyPolicy 옵션Allow: 이전 작업이 실행 중일 때 새로운 작업을 시작합니다.Forbid: 이전 작업이 완료될 때까지 새로운 작업을 시작하.. 2024. 7. 5.
Kubernetes Postgres DataBase Backup DataBase를 사용하게 되면 반드시 백업은 필수, 데이터 유실 될 경우 복구가 불가능..매번 수동으로 백업하면 실수도 할 수 있고 누락도 될 수 있음Kubernetes Postgres Pod를 백업 하는 방법에서 알아보도록 하겠습니다 환경Kubernetes ClusterPostgres Deployment , Pod ,SVCPostgres PV, PVCPostgres Backup PV,PVCCronJob Kubernetes Cluster , Deplyoment, Pod , SVC 생성했다는 가정Harbor 외부용 Postgres로 생성했던 부분이라 아래 참고(Postgres Pod형태로 배포 생성도 포함)https://monta010.tistory.com/122 Harbor 외부 Postgres DB.. 2024. 7. 5.
Harbor 외부 Postgres DB 연동 및 구성 네임스페이스 생성kubectl create ns postgresDeployment 생성apiVersion: apps/v1kind: Deploymentmetadata: name: postgres namespace: postgresspec: replicas: 1 selector: matchLabels: app: postgres template: metadata: labels: app: postgres spec: containers: - name: postgres image: postgres:15.7-alpine ports: - containerPort: 5432 env: -.. 2024. 7. 2.
Harbor Replicas 설정 Harbor Replicas로  복제 하는 방법에 대해서 알아보도록 하겠습니다.HA 구성 할 경우에는 불 필요할 거 같지만,  백업용으로 괜찮을듯함  Harbor replicas 192.168.20.117 -> 192.168.20.247 수동 복제 원본 Harbor 상태 타켓 Harbor 상태  1.  replicas 설정(타켓 Registrty Endpoint 설정)  2.  Replications 설정   3. 복제 진행Relicas ID 값은 사전 테스트를 위해서 실행을 하여 ID 값이 2로 보여짐 2024. 6. 28.
Harbor HA 구성 구성도  설치 방법helm 미설치 시 : https://monta010.tistory.com/96helm repo add harbor https://helm.goharbor.iohelm fetch harbor/harbor --untar  기본 설정 Service Type 설정 ingress", "clusterIP", "nodePort" or "loadBalancer" 선택설정 방법 : expose -> type externalURL 설정외부 접속 하가 위한 정보(http://192.168.x.x:Port)  Replicas 적용 대상Core , jobservice , nginx, , portal, registry,제외 대상 : database, redis, trivystatefulset으로 배포되는 방식.. 2024. 6. 28.
Ray Cluster 설치 Ray Cluster는 다양한 환경에 설치 가능하다, Kubernetes상에서 Ray Cluster를 설치하기 위해서는KubeRay Operatoer를 사용하는 것을 권장한다. KubeRay Kubernetes 사용자 정의 리소스 정의(CRDs) : RayCLuster , RayJob , RayServiceRayCluster :클러스터 생성/삭제, 자동 크기 조정내결함성 보장RayCluster의 수명주기를 완벽 관리RayJob :KubeRay는 자동으로 RayCluster를 생성, 클러스터가 준비작업이 완료시  RayCluster를 자동으로 삭제하도록 RayJob을 구성할 수 있음RayService :RayCluster 및 Ray Serve 배포 그래프라는 두 부분으로 구성RayCluster 및 고가용성.. 2024. 6. 23.
Ray Cluster 개요 Ray Cluster기계 학습, AI, 파이선 애플리케이션 확장을 위한 오픈 소스 통합 프레임 워크분산  담당자가 없이도 병렬처리를 위함데이터 전처리, 분산 훈련, 초매개변수 조정, 강화 학습, 모델Python 애플리케이션 병렬화 및 확장을 위한 Python 기반 분산 컴퓨팅환경 : Kubernetes, AWS, GCP, Azure 등에서도 사용 가능 Ray Cluster 시스템오케스테레이션 : 분삭 시스템의 다양한 구성 요소 관리예약 : 작업이 실행되는 시기와 장소 조정내결합성 : 불가피한 실패 시점에 관계 없이 작업이 완료되도록 보장자동 크기 조정  : 동작 수요에 할당된 리소스 수를 조정Ray Cluster 활용CPU, GPU에 대한 일괄 추론모델 제공대형 모델의 분산 학습병렬 하이퍼 파리미터 튜닝.. 2024. 6. 23.
Airflow 스케줄링 Airflow 스케줄러모든 작업, 모든 DAG모니티링하여 작업 인스턴스를 트리거DAG 개체 폴더를 모니터링하고 동기화하여 유지하여 정기적(1분)으로 트리거DAG 파일들 확인하여 작업, 스케줄링 간격들을 확인하여 처리Airflow 스케줄러 로그날짜 기준으로 자동으로 수집처리됨  스케줄러 자동기본적으로 UTC 기준으로 동작하므로 KST로 변경하여 사용해야함.   스케줄러 설정시간(UTC -> KST)간격 설정(Schedule_interval)DAGs 코드상에서 변경 스케줄링 Schedule_intervalStart_date : 시작할 시점end_date : 시작할 시점Schedule_interval : 스케줄 시간 시점 2024. 6. 16.
Airflow 기본 예제 테스트 서버 dags 폴더에 example-pipeline.py 생성하여  코드 넣기 import textwrapfrom datetime import datetime, timedelta# The DAG object; we'll need this to instantiate a DAGfrom airflow.models.dag import DAG# Operators; we need this to operate!from airflow.operators.bash import BashOperatorwith DAG( "tutorial", # These args will get passed on to each operator # You can override them on a per-task basis dur.. 2024. 6. 16.
Airflow 기본 설치 및 구성 전체 조건(airflow 2.9.2 기준 )파이썬 : 3.8 ~ 3.12데이터베이스 :Mysql 8.0. , mariaDB 지원XSQLite : 3.15.0 (프로덕션 사용 금지)kubernets : 1.26 ~ 1.29최소 메모리 : 4GB 지원 버전https://airflow.apache.org/docs/apache-airflow/stable/installation/supported-versions.html# Supported versions — Airflow Documentation airflow.apache.org  AirFlow 설치 환경 : Python3.8.12 업데이트sudo apt update -y && sudo apt upgrade -y Python3.8 설치sudo apt instal.. 2024. 6. 16.
Jenkins Deployment로 설치하기 Kubernetes에 Jenkins 설치 간단한 테스트를 위한 환경이기에 PV 경로는 hostPath로 진행하며, NFS, SC를 사용해도 상관없습니다.  DeploymentapiVersion: apps/v1kind: Deploymentmetadata: name: jenkins namespace: jenkinsspec: replicas: 1 selector: matchLabels: app: jenkins template: metadata: labels: app: jenkins spec: containers: - name: jenkins image: jenkins/jenkins:lts ports: .. 2024. 6. 13.
k3s 설치 가이드 설치에 필요한 스크립트들을 통해서 k3s를 설치kubectl, cictl ,ctr, ks3-killall.sh , ks3-uninstall.sh재부팅시에도 자동으로 ks3 동작하도록 서비스가 등록curl -sfL https://get.k3s.io | sh -   클러스터 상태 확인sudo kubectl get nodes     Workernode 추가K3S_URL = master server IPK3S_TOKEN = /var/lib/rancher/k3s/server/node-token curl -sfL https://get.k3s.io | K3S_URL=https://192.168.0.50:6443 K3S_TOKEN=K10be4c8a71c2dda402dfd0d5f138ef7a699ebd85775d5334.. 2024. 6. 13.
반응형