728x90
반응형

DevOps 25

Pods 성능관리

CPU/MEM 값 조회 kubectl top pods -n [ns 명] or kubectl get hpa -A Pod 스펙 변경 pod의 cpu/mem를 수정할 때 사용 requests는 생성 시 필요한 최소 자원이고 최대 limits 까지 자원을 사용할 수 있다. kubectl edit deploy -n [ns명] [deploy명] resources: limits: cpu: 100m memory:500Mi requests: cpu:100m memory:500Mi 신규 Pod 배포시 빠른 배포 $ kubectl get replicaset -n [ns명] 레플리카 조회 후 수정 $ kubectl edit replicaset -n [ns명] [기존replicaset] spec: replicaset:0

DevOps/Kubernetes 2023.07.10

Pods 생성/변경

run을 사용해서 eginx1.14 버전 80포트를 사용하는pod 생성 kubectl run [pod명] --image=nginx:1.14 --port 80 실행 하는지 확인만 하고 싶을경우 뒤에 --dry-run을 붙힌다. 만약 yaml파일로 저장해 사용하고 싶다면? kubectl run [pod명] --image=nginx:1.14 --port 80 --dry-run -o yaml > [파일명].yaml 저장한 파일로 pod를 생성하려면? kubectl create -f [파일명].yaml 잘 만들어 졌는지 확인 kubectl get pods -o wide 명령어를 사용하면 ip가 나옴 kubectl curl [ip주소]를 적어서 잘 생성되었나 확인 create를 사용해서 아파치 서버를 사용하는 de..

DevOps/Kubernetes 2023.07.10

NS [NameSpace] 생성하기

namespace:클러스터 하나를 여러 개의 논리적 단위로 나눠서 사용한 것 CLI로 만들기 $ kubectl create namespace [ns 명] $ kubectl get namespaces yaml로 만들기 $ kubectl create namespace [ns명] --dry-run -o yaml > [ns명].yaml vim [ns명].yaml $ kubectl create -f [file명].yaml -n [ns명] 삭제 $ kubectl delete namespace 기본 네임스페이스로 지정 $ kubectl config set-context $(kubectl config current-context) --namespace=[ns]

DevOps/Kubernetes 2023.07.10

k8s POD 문제시 즉 조치 재기동 방법

서비스 불가 상태인 경우 rollout restart 명령어를 통해 rolling 재기동을 수행한다. Rolling 재기동을 하게되면 POD 하나가 먼저 새로 기동되고 기존 POD 하나가 내려가며 항상 Min POD수를 충족시켜 Down-time이 존재하지 않는다. Bastion서버 접속 root계정 스위칭 Kubectl get ns -네임스페이스 명 확인 Kubectl get deploy -n [namespace명]- 디플로이먼트명 확인 Kubectl rollout restart deploy [deployment명] -n [namespace명]

DevOps/Kubernetes 2023.07.10

Kafka - 간단한 이론 및 명령어

kafka=> Producer -> kafka Server -> Consumer 비동기 처리를 위한 메시징 큐(FIFO) kafka-topics.sh 토픽에 관련된 작업을 할 수 있는 스크립트 sh bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --topic test-topic test topic명의 topic 생성 sh bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --partitions 10--replication-factor 1--topic test-topic2 --config retention.ms=172800000 원하는 설정을 입력한 topic 생성 sh bin/..

DevOps/Kafka 2023.07.07
728x90
반응형