`kubectl top`
kubectl top pods -n spark
kubectl top nodes
์ ๋ช ๋ น์ด๋ก ํ ๋์ ํ๋๋ณ๋ก cpu, mem์ ์ผ๋ง๋ ์ฌ์ฉํ๊ณ ์๋์ง ํ์ธ์ด ๊ฐ๋ฅํ๋ฉฐ, ๋ ธ๋๋ณ๋ก๋ ์ผ๋ง๋ ์์์ด ์ฌ์ฉ์ค์ธ์ง ํ์ธ์ด ๊ฐ๋ฅํ๋ค. ํด๋ฌ์คํฐ์ ๊ฒฝ๊ณ ๋ ์ฅ์ ๊ฐ ๋๋ฉด, Grafana์ ๋ค์ด๊ฐ์ง ์๊ณ ํธ๋ค๋ฅ ํฐ๋ฏธ๋์์ผ '๋๊ฐ spark์ผ๋ก ์์์ ์ผ๋ง๋ ํ ๋นํด ์ฐ๊ณ ์๋'ํ์ธํ๋ ๋ฐ์ ์์ฃผ ์ฌ์ฉํ๊ณ ์๋ค.
Kubernetes Metrics API
Resource metrics pipeline
For Kubernetes, the Metrics API offers a basic set of metrics to support automatic scaling and similar use cases. This API makes information available about resource usage for node and pod, including metrics for CPU and memory. If you deploy the Metrics AP
kubernetes.io
๊ธฐ๋ณธ์ ์ผ๋ก๋ Metrics API๊ฐ ๊น๋ ค์๋ค๋ฉด, ์ ์ํคํ ์ณ๋ฅผ ์ ๊ณตํ๊ณ ์๋ ๊ฒ์ด๋ค. ์ปจํ ์ด๋ ๋ฐํ์์ ๋ํ ์ ๋ณด๋ cAdvisor(google)๋ฅผ ํตํด ์์ง. cAdvisor์ metric๊ณผ pod์ ์ ๋ณด๋ฅผ kubelet์ด ์ทจํฉํ๋ค. metrics-server๋ ๊ฐ ๋ ธ๋ kubelet์ ํด๋น ์ ๋ณด๋ฅผ fetchํ๊ณ , API Server ๋ฅผ ํตํด kubectl top๊ณผ Pod AutoScaling์ ์ํ ์ปดํฌ๋ํธ์ ์ ๊ณตํ๋ค.
GitHub - google/cadvisor: Analyzes resource usage and performance characteristics of running containers.
Analyzes resource usage and performance characteristics of running containers. - GitHub - google/cadvisor: Analyzes resource usage and performance characteristics of running containers.
github.com
Kubernetes ๋ฆฌ์์ค ์ธก์
`kubectl top` ์
๋ ฅ ์ ํํ๋๋ cpu ์ปฌ๋ผ์ ๊ฐ์ ์ด๋ป๊ฒ ์ธก์ ๋ ๊ฒ์ด๋ฉฐ ์ด๋ป๊ฒ ์ ์ด๋๊ณ ์๋ ๊ฑด์ง๋ ํ์ธํด๋ณธ๋ค.
cpu.shares, cpu.cfs_quota ๋ฑ์์ ๊ธฐ์ค์ด ๋๋ ๊ฐ์ ๊ณ ์ ํ์ฌ ์๋์ ์ผ๋ก ์ ์๋๋ ๊ฐ๋ค์ ์ฌ์ฉ์๊ฐ ์ ๋์ ์ธ ์์ผ๋ก ์ ์ดํ ์ ์๋๋ก ํ๊ณ ์๋ค. ์์ธํ ๋ด์ฉ์ ์๋ ๊ธ์ ์ฐธ๊ณ ํ๋ค.
Kubernetes์์์ cpu requests, cpu limits๋ ์ด๋ป๊ฒ ์ ์ฉ๋ ๊น :: Ibiza
Kubernetes์์์ cpu requests, cpu limits๋ ์ด๋ป๊ฒ ์ ์ฉ๋ ๊น Kubernetes ์์๋ ์ปจํ ์ด๋ ๋จ์๋ก resource๋ฅผ ํ ๋นํ ์ ์๋ค. ์ฌ๊ธฐ์๋ memory, cpu, ephemeral-storage, hugepages ๋ฑ์ด ํฌํจ๋๋ค. ์ด ์ค์์ cpu ์ requests,
kimmj.github.io
'Pod memory' vs 'Conatiner memory'
to be continue...
'๐ป > MLOps' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Kubernetes API ํด๋ผ์ด์ธํธ ์ฌ์ฉ (0) | 2024.02.23 |
---|---|
stern : ๋ถ์ฐ ์ฒ๋ฆฌ ํ๋ซํผ ๋ชจ๋ํฐ๋ง (0) | 2024.02.23 |
Apache Cassandra (0) | 2023.07.31 |
[Pinot] ์คํ์์ค ๊ธฐ์ฌ ํ๋ก์ธ์ค (0) | 2023.03.05 |
[Pinot] Apache Pinot ๊ฐ๋ฐ ํ๊ฒฝ (0) | 2023.03.05 |