๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
Kubernetes

[k8s] Kubernetes ๋กœ๊ทธ - PLG ๊ฐœ์š”

by The Future Engineer, Lucy 2024. 11. 4.
728x90
๋ฐ˜์‘ํ˜•

PLG๋ž€?

PLG๋Š” Promtail + Loki + Grafana๋ฅผ ์ด์šฉํ•˜์—ฌ ๊ตฌ์„ฑํ•˜๋Š” ๋กœ๊ทธ ํ†ตํ•ฉ ์‹œ์Šคํ…œ์ด๋‹ค. ๊ฐ๊ฐ์˜ ์ด๋‹ˆ์…œ์„ ๋”ฐ์„œ PLG๋ผ๊ณ  ํ•œ๋‹ค. EFK/ELK์™€ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๋กœ๊ทธ๋ฅผ ์ˆ˜์ง‘, ์ €์žฅ, ๋ถ„์„ํ•˜๊ณ  ์‹œ๊ฐํ™”ํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” ์˜คํ”ˆ ์†Œ์Šค ์Šคํƒ์ด๋‹ค.

Promtail์ด๋ž€?

Promtail์€ ๋กœ์ปฌ ๋ฐ์ดํ„ฐ์˜ ๋‚ด์šฉ์„ Grafana Loki ์ธ์Šคํ„ด์Šค๋‚˜ Grafana Cloud๋กœ ์ „๋‹ฌํ•˜๋Š” ์—์ด์ „ํŠธ์ด๋‹ค. Promtail์€ ์ถ”์ ํ•˜๊ณ ์ž ํ•˜๋Š” ๋ชจ๋“  ๋…ธ๋“œ ์œ„์—์„œ Daemonset์œผ๋กœ ์‹คํ–‰๋œ๋‹ค. ๋กœ๊ทธ ์ŠคํŠธ๋ฆผ์— ๋ผ๋ฒจ์„ ๋ถ€์ฐฉํ•˜๊ณ  ์ด๋ฅผ Loki ์ธ์Šคํ„ด์Šค๋กœ ์ „๋‹ฌํ•œ๋‹ค. Promtail์€ ๋กœ์ปฌ ๋กœ๊ทธ ํŒŒ์ผ๊ณผ systemd journal์—์„œ ๋กœ๊ทธ๋ฅผ ์ถ”์ ํ•œ๋‹ค. ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์•„๋ž˜ ์‚ฌ์ดํŠธ๋ฅผ ์ฐธ๊ณ ํ•˜๋ฉด ๋œ๋‹ค.

 

Promtail agent | Grafana Loki documentation

Open source Promtail agent Promtail is an agent which ships the contents of local logs to a private Grafana Loki instance or Grafana Cloud. It is usually deployed to every machine that runs applications which need to be monitored. NotePromtail is feature c

grafana.com

Grafana Loki๋ž€?

Grafana Loki๋Š” Grafana Labs์˜ ๊ฐœ๋ฐœํ•œ ์˜คํ”ˆ ์†Œ์Šค๋กœ ๋กœ๊ทธ ์Šคํƒ์„ ๊ตฌ์„ฑํ•œ๋‹ค. ํ”„๋กœ๋ฉ”ํ…Œ์šฐ์Šค ๋ผ๋ฒจ๊ณผ ๋งˆ์ฐฌ๊ฐ€์ง€๋กœ ๋กœ๊ทธ ๋ผ๋ฒจ์— ๋Œ€ํ•œ ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋งŒ ์ธ๋ฑ์‹ฑํ•œ๋‹ค๋Š” ์•„์ด๋””์–ด๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•œ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋กœ๊ทธ ๋ฐ์ดํ„ฐ ์ž์ฒด๋ฅผ ์••์ถ•ํ•˜์—ฌ Amazond S3๋‚˜ GCS์™€๊ฐ™์€ ๊ฐ์ฒด ์ €์žฅ์†Œ ๋˜๋Š” ํŒŒ์ผ ์‹œ์Šคํ…œ์˜ ์ฒญํฌ์— ์ €์žฅํ•œ๋‹ค. Loki์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์•„๋ž˜์˜ ๊ณต์‹ ์‚ฌ์ดํŠธ๋ฅผ ์ฐธ๊ณ ํ•˜๋ฉด ๋œ๋‹ค.

 

Grafana Loki | Grafana Loki documentation

Manage Loki Learn how to manage tenants, log ingestion, storage, queries, and more.

grafana.com

Grafana๋ž€?

Grafana๋Š” Grafana Labs์—์„œ ์ œ๊ณตํ•˜๋Š” ์˜คํ”ˆ ์†Œ์Šค๋กœ ๋Œ€์‹œ๋ณด๋“œ ๋ฐ ์‹œ๊ฐํ™” ํ”Œ๋žซํผ์ด๋‹ค. Grafana ๋ฐ์ดํ„ฐ ์†Œ์Šค ํ”Œ๋Ÿฌ๊ทธ์ธ์„ ์‚ฌ์šฉํ•˜๋ฉด Prometheus, Cloudwatch์™€ ๊ฐ™์€ ์‹œ๊ณ„์—ด ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค, loki, elasticsearch์™€ ๊ฐ™์€ ๋กœ๊ทธ ๋„๊ตฌ, NoSQL/SQL ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค CI/CD tooling ๋“ฑ์˜ ๋ฐ์ดํ„ฐ ์†Œ์Šค๋ฅผ ์ฟผ๋ฆฌ ํ•  ์ˆ˜ ์žˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๊ทธ๋ž˜ํ”„์™€ ์‹œ๊ฐํ™”๋ฅผ ํ†ตํ•ด ๋ฐ์ดํ„ฐ๋ฅผ ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋Œ€์‹œ๋ณด๋“œ์— ํ‘œ์‹œํ•  ์ˆ˜ ์žˆ๋‹ค. Grafana์— ๋Œ€ํ•œ ์ž์„ธํ•œ ๋‚ด์šฉ์€ ์•„๋ž˜ ๊ณต์‹ ์‚ฌ์ดํŠธ๋ฅผ ์ฐธ๊ณ ํ•˜๋ฉด ๋œ๋‹ค.

 

Grafana OSS and Enterprise | Grafana documentation

Dashboards Query, transform, visualize, and understand your data no matter where it’s stored.

grafana.com

PLG ๊ตฌ์ถ•์— ๋Œ€ํ•œ ๋‚ด์šฉ์€ ์ด์ „์— ์˜ฌ๋ ค๋‘” ๊ธ€์„ ์ฐธ๊ณ ํ•˜๋ฉด ๋œ๋‹ค.

 

[k8s] Kubernetes ๋กœ๊ทธ - PLG ๊ตฌ์ถ•

PLG๋ฅผ ์„ ํƒํ•œ ์ด์œ ํ”„๋กœ์ ํŠธ ์ง„ํ–‰ ์ค‘ EFK์—์„œ slack์œผ๋กœ ์•Œ๋ฆผ์„ ์—ฐ๋™ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” security ์„ค์ •์„ ์ตœ๊ณ ๋กœ ๋†’์—ฌ ์ฒดํ—˜ํŒ์„ ์‚ฌ์šฉํ•˜๊ฑฐ๋‚˜ ๋ˆ ๋‚ด๊ณ  ์‚ฌ์šฉํ•ด์•ผํ–ˆ๋‹ค. ์ด ๊ณผ์ •์—์„œ security ์„ค์ •์— ์–ด๋ ค์›€์„ ๊ฒช์œผ

lucy-devblog.tistory.com

์ด์ƒ์œผ๋กœ PLG์— ๋Œ€ํ•œ ์ •๋ฆฌ๋ฅผ ๋งˆ์น˜๊ฒ ๋‹ค.

728x90
๋ฐ˜์‘ํ˜•