분류 전체보기
-
프로메테우스Data Engineer 2024. 3. 3. 21:43
Prometheus K8s 환경에 들어오며, 전체 인프라 환경과 Application에 대한 모니터링을 하는 것이 매우 중요해졌다 인프라에 대한 전체적인 가시성을 확보해야 k8s 내에 돌아가는 Application에 대한 가용성과 안정성을 확보 모니터링 결과를 통해 고도화된 Cloud Native 시스템을 구축할 때 사용하는 지표로 활용 기존 레거시 환경은 고사양 서버에 application을 크게 운영하는 방식으로 운영 고사양 서버에 Monitoring Agent를 서버에 설치한 후, Agent가 OS의 메트릭을 수집하여 Backend에 직접 전송하는 방식을 사용 Cloud native : 컨테이너 기반의 Application을 작게 운영하고 필요할 때마다 확장, 파괴하는 방식 선택 동적으로 확장하는 ..
-
Dockerfile & Docker-composeData Engineer 2024. 2. 20. 14:12
Dockerfile Docker에서 이미지를 생성하기 위한 용도로 작성하는 파일 만들 이미지에 대한 정보를 기술해 둔 템플릿 Docker build [option] [작성한 dockerfile 경로] 위와 같이 명령어를 입력하면 작성한 도커파일의 내용을 기반으로 이미지 빌드 시작 FROM : 베이스 이미지를 지정하는 것 어느 정도 기본적인 구성 요소들이 갖추어진 상태의 이미지를 토대로 만드는 것 From 이미지, 태그 지정 시 registry에서 해당 이미지 pull RUN Command를 실행하여 새 이미지에 포함시키는 역할 컨테이너에 꼭 필요한 소프트웨어, 라이브러리를 포함시켜야 할 때 RUN 뒤에 소프트웨어/라이브러리 설치 명령어 , 파일/디렉토리 생성 명령어 작성 CMD 컨테이너가 시작될 때 실행..
-
[Security] Microsoft DefenderData Engineer 2024. 2. 19. 17:30
우리가 Azure에서 만든 서비스를 안전하게 보관하고자, Microsoft Defender를 도입하기로 하였다. 그와 관련해 공식문서를 찾아본 결과를 공유해보려 한다. Microsoft Defender 다양한 사이버 위협 및 취약성으로부터 클라우드 기반 애플리케이션을 보호하도록 설계된 보안 조치 및 사례로 구성된 CNAPP *CNAPP : Cloud Native Application Protection Platform 다중 클라우드 및 다중 파이프라인 환경에서 코드 수준에서 보안 관리를 통합하는 DevSecOps(개발 보안 작업) 솔루션 위반을 방지하기 위해 수행할 수 있는 작업을 표시하는 CSPM(클라우드 보안 태세 관리) 솔루션 서버, 컨테이너, 스토리지, 데이터베이스 및 기타 워크로드에 대한 특정 ..
-
Git Branch 전략Computer Science 2024. 2. 18. 23:31
Git flow Main Branch Feature Branch Release Branch Hotfix Branch 가장 중심이 되는 브랜치는 master와 develop 브랜치이며, Merge된 feature, release, hotfix 브랜치는 삭제하도록 한다. Main branch Master - 배포 가능한 상태만을 관리하는 브랜치 Develop - 다음에 배포할 것을 개발하는 브랜치 - 통합 브랜치의 역할을 하며, 평소에는 이 브랜치를 기반으로 개발을 진행 Supporting branch Feature - 기능을 개발하는 브랜치로, develop 브랜치로부터 분기 - 그 기능을 다 완성할 때까지 유지하고, 다 완성하면 develop 브랜치로 merge(다음 배포에 확실히 넣을 거라고 merge..
-
[Leet Code] Best time to Buy and Sell Stock IIProgrammers 2024. 2. 9. 15:40
class Solution(object): def maxProfit(self, prices): total = 0 buy = prices[0] # 산 주식을 리스트의 첫번째 원소로 지정 for i in range(1, len(prices)): if prices[i] - buy > 0: # 현재 인덱스에서 주식을 팔았을 때 이득이면 팔고, 총 수익에 더해준다 total += prices[i] - buy buy = prices[i] else: buy = min(buy, prices[i]) return total 최저 값을 buy로 선언 후, 리스트 내 원소들과 비교하며 양수면 더해주고, 아니면 최저값만 갱신해주는 연산을 처리한다 [1,2,3,4,5]를 예시로 든다면, # buy = 1 1 - 1 = 0 이므로..
-
[Django] MiddlewareDjango 2024. 2. 2. 09:25
HTTP 요청 / 응답 처리 중간에서 작동하는 시스템 HTTP 요청이 들어오면 미들웨어를 거쳐서 해당 URL에 등록되어 있는 뷰로 연결해주고, HTTP 역시 미들웨어를 거쳐서 내보낸다 Django에서 미들웨어는 http 요청 또는 응답 전처리에 사용된다 Setting.py에서 MIDDLEWARE의 full python path를 추가하면 된다 Django-admin startproject 명령어로 django project 생성 시 기본적으로 미들웨어들이 등록되어 있다 미들웨어 등록시 가장 중요한 것은 미들웨어를 등록하는 순서다. 미들웨어 등록 순서가 가지는 의미 HTTP request가 들어오면 위에서부터 아래로 미들웨어를 적용 HTTP response가 나갈 때 아래서부터 위로 미들웨어를 적용 Cus..
-
[Django] Django ThrottlingDjango 2024. 2. 2. 09:12
특정 조건 하에 최대 호출 횟수를 결정하는 클래스 Request가 승인되어야 하는지 여부를 결정하는 점에서 permissions와 유사 Setting.py를 통해 전역으로 설정 가능 AnonRateThrottle 인증요청에는 제한을 두지 않고 비인증 요청에는 IP별로 횟수 제한 Throttle 클래스 별로 scope 1개만 지정 가능 Default : anon UserRateThrottle 인증요청에는 유저별로 횟수를 제한하고, 비인증 요청에는 IP별로 횟수 제한 Throttle 클래스 별로 scope 1개만 지정 가능 Default : user ScoptedRateThrottle ScoptedRateThrottle 인증요청에는 유저별로 횟수 제한, 비인증 요청에는 IP별로 횟수 제한 API view 내..
-