전체 글

전체 글

    nats - prometheus 연동

    목적 nats -> prometheus -> grafana 구성으로 모니터링 환경을 구축 하려고 한다. 방법 nats와 prometheus 모니터링을 하기위해, nats 서버에 prometheus-nats-exporter를 설치 해야한다. nats와 nats-exporter 연동을 위해서는 nats-server 기동시 -m 옵션으로 모니터링 포트를 지정해야한다. nats-server -p 4222 -m 8222 nats-exporter를 기동한다. prometheus-nats-exporter -varz -jsz=all http://127.0.0.1:8222nats-exporter가 nats-server보다 먼저 기동되어서는 안된다. 8222 포트가 listen 된것을 확인하고, 기동해야 정상적으로 연동된..

    Grafana와 EFS 연동

    목적 Helm으로 설치한 Grafana가 Storage를 안잡았더니, pod가 생성될때마다 Datasource와 Dashboard 설정을 해줘야했다. 이를 위해 PVC 설정을 하려고 한다. 방법 grafana-pvc.yaml 생성 efs는 기존에 만들어진 efs-sc를 사용했다. kind: PersistentVolumeClaim apiVersion: v1 metadata: name: pvc-prom-grafana namespace: prometheus annotations: volume.beta.kubernetes.io/storage-class: efs-sc spec: accessModes: - ReadWriteMany resources: requests: storage: 10Gi pvc 생성 및 확인 ..

    promethues 쿼리 몇 가지

    kubernetes에 prometheus & grafana로 구성하고, grafana 에서 사용한 prometheus 쿼리 몇가지 정리 합니다. 버전 Prometheus 2.26.0 Grafana 8.3.0 쿼리 Stat namespace 개수: count(kube_namespace_created) pvc 개수: count(kube_presistentvolumeclain_info) pod 개수: count(count by(pod)(container_spec_memory_reservation_limit_bytes{pod!=""})) container 개수: count(kube_pod_container_status_running{namespace!="/"}) Replica Rate: sum(kube_repl..

    vscode 에서 원격 디버깅

    목적 - vscode를 사용해서 g++을 원격으로 디버깅하는 방법을 설명하고자 한다.방법 먼저 ssh로 접속이 가능하도록 설정 한다. (여기 까지는 공개된 방법이 많이 있습니다) code.visualstudio.com/docs/remote/ssh 작업 영역을 설정한다. 디버깅은 작업영역을 설정해야 가능 합니다. launch.json 파일에 추가한다. Run { "name": "process1 run", "type": "cppdbg", "request": "launch", "program": "/home/newtype/vscode_debug/process1", "cwd": "${workspaceFolder}", "MIMode": "gdb", "miDebuggerPath": "/usr/bin/gdb", "s..

    Golang으로 Synology 연동 Telegram 봇 만들기

    Golang으로 Synology 연동 Telegram 봇 만들기

    재택근무를 하면서 q10에서 타오 나스를 구매했습니다. 주 용도는 마크 서버 및 torrent 머신인데, 헤놀로지 세팅을 하다 보니 욕심이 생겨서 외부에서도 텔레그램 봇을 통해 torrent파일이나 마그넷 링크로 다운로드할 수 있게 했습니다. 여기서는 그 방법을 공유하려고 합니다. 목표 Telegram bot: 예전에 python으로는 만들어본 적이 있는데, 이번에는 Golang으로 만들어 보려고 합니다. Torrent 파일은 disk station의 감시 경로에 넣어주면 되고, magnet은 Synology API(SYNO API)에서 지원하네요. 시놀로지 세팅: Download Station 감시 설정, API 설정, API 연동용 계정 생성 등을 해야 합니다. 그리고 시놀로지에서는 Golang을 지..