본문 바로가기

전체 글757

bitanami nginx helm chart 설치 (nodeport 로 설치) 1. chart repo 를 추가 해 줌 shell> helm repo add bitnami https://charts.bitnami.com/bitnami shell> helm search repo bitnami 2. helm 을 install 해줌 shell> helm install webserver bitnami/nginx --set service.type=NodePort (뒤에 --set 이하 부분을 안 붙이면 loadbalancer 타입이 default 임) 파라미터 관련 내용은 https://github.com/bitnami/charts/tree/main/bitnami/nginx 를 참고 하면 됨 3. kubectl get svc 로 접속 포트 확인 4. worker node 로 가서 정상적으로.. 2023. 6. 10.
prometheus operator 간단 설치 (NodePort 사용) 1. prometheus operator 를 git clone git clone https://github.com/prometheus-community/helm-charts.git 2. 설치를 위한 namespace 생성 shell> kubectl create namespace monitor 3. prometheus 의 tsdb 데이터가 저장 될 pv 생성 kube-pv.yaml apiVersion: v1 kind: PersistentVolume metadata: name: kube-pv spec: capacity: storage: 1Gi # 스토리지 용량 1GB volumeMode: Filesystem # 파일 시스템 형식 accessModes: # 읽기/쓰기 옵션 - ReadWriteOnce stor.. 2023. 6. 2.
prometheus 에서 no space left on device 에러 발생시 prometheus 에서 err="write to WAL: log samples: write /prometheus/wal/123456: no space left on device" 와 같은 오류가 발생 할 수 있다. 해당 에러 메시지는 말 그대로 데이터 저장 공간이 부족하다는 메시지 이다. 해당 오류가 발생 했을 때의 전략을 아래와 같이 살펴 본다. 1. 기존 prometheus 데이터를 backup 할 NAS 를 mount 한다. (control plain 에) 2. prometheus sts 의 replica 를 0으로 만든다. 3. prometheus db 데이터 snapshot 을 뜬다. 4. pod 의 container 내부의 데이터를 backup NAS 로 복사 한다. 5. prometheus.. 2023. 5. 29.
kubernetes 의 pod 내 container 목록 조회 kubectl get pod 로 조회시 root@k8smaster:~# kubectl get pod NAME READY STATUS RESTARTS AGE alertmanager-prometheus-kube-prometheus-alertmanager-0 2/2 Running 0 9m41s 와 같이 2개 이상의 container 를 가진 pod 가 있는데 이런 pod 의 container 를 조회 하기 위해선 컨테이너 명을 알아야 한다. shell> kubectl get pod [pod 명] -o jsonpath={..spec.containers[*].name} | xargs -n1 과 같이 조회 해 주면 된다. 이렇게 조회 후 container log 를 조회 하려면 kubectl logs pod/pro.. 2023. 5. 29.