Skip to content

Commit

Permalink
Merge pull request #38485 from jihoon-seo/221214_ko_Update_outdated_R3
Browse files Browse the repository at this point in the history
[ko] Update outdated files in `dev-1.26-ko.1` (M126, M164, R1-R3)
  • Loading branch information
k8s-ci-robot authored Mar 20, 2023
2 parents c60480e + 6dee659 commit bbd4c27
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 79 deletions.
55 changes: 55 additions & 0 deletions content/ko/docs/reference/instrumentation/node-metrics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: λ…Έλ“œ λ©”νŠΈλ¦­ 데이터
content_type: reference
weight: 50
description: >-
λ…Έλ“œ, λ³Όλ₯¨, νŒŒλ“œ, μ»¨ν…Œμ΄λ„ˆ λ ˆλ²¨μ—μ„œ
kubelet이 λ³΄λŠ” 것과 λ™μΌν•œ λ©”νŠΈλ¦­μ— μ ‘κ·Όν•˜λŠ” λ©”μ»€λ‹ˆμ¦˜
---

[kubelet](/docs/reference/command-line-tools-reference/kubelet/)은
λ…Έλ“œ, λ³Όλ₯¨, νŒŒλ“œ, μ»¨ν…Œμ΄λ„ˆ μˆ˜μ€€μ˜ 톡계λ₯Ό μˆ˜μ§‘ν•˜λ©°,
이 톡계λ₯Ό
[μš”μ•½ API(Summary API)](https://github.com/kubernetes/kubernetes/blob/7d309e0104fedb57280b261e5677d919cb2a0e2d/staging/src/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go)에 κΈ°λ‘ν•œλ‹€.

톡계 μš”μ•½ API에 λŒ€ν•œ μš”μ²­μ„
μΏ λ²„λ„€ν‹°μŠ€ API μ„œλ²„λ₯Ό 톡해 ν”„λ‘μ‹œν•˜μ—¬ 전솑할 수 μžˆλ‹€.

λ‹€μŒμ€ `minikube`λΌλŠ” μ΄λ¦„μ˜ λ…Έλ“œμ— λŒ€ν•œ μš”μ•½ API μš”μ²­ μ˜ˆμ‹œμ΄λ‹€.

```shell
kubectl get --raw "/api/v1/nodes/minikube/proxy/stats/summary"
```

λ‹€μŒμ€ `curl`을 μ΄μš©ν•˜μ—¬ λ™μΌν•œ API ν˜ΈμΆœμ„ ν•˜λŠ” λͺ…λ Ήμ–΄λ‹€.

```shell
# λ¨Όμ € "kubectl proxy"λ₯Ό μ‹€ν–‰ν•΄μ•Ό ν•œλ‹€.
# 8080 뢀뢄을 "kubectl proxy" λͺ…령이 ν• λ‹Ήν•΄ μ€€ 포트둜 μΉ˜ν™˜ν•œλ‹€.
curl http://localhost:8080/api/v1/nodes/minikube/proxy/stats/summary
```

{{< note >}}
`metrics-server` 0.6.x 버전뢀터, `metrics-server`λŠ” `/stats/summary`κ°€ μ•„λ‹Œ
`/metrics/resource` kubelet μ—”λ“œν¬μΈνŠΈμ— λŒ€ν•΄ μ§ˆμ˜ν•œλ‹€.
{{< /note >}}

## μš”μ•½ λ©”νŠΈλ¦­ API μ†ŒμŠ€ {#summary-api-source}

기본적으둜, μΏ λ²„λ„€ν‹°μŠ€λŠ” kubelet λ‚΄λΆ€μ—μ„œ μ‹€ν–‰λ˜λŠ”
λ‚΄μž₯ [cAdvisor](https://github.com/google/cadvisor)λ₯Ό μ‚¬μš©ν•˜μ—¬ λ…Έλ“œ μš”μ•½ λ©”νŠΈλ¦­ 데이터λ₯Ό κ°€μ Έμ˜¨λ‹€.

## CRIλ₯Ό 톡해 μš”μ•½ API 데이터 κ°€μ Έμ˜€κΈ° {#pod-and-container-stats-from-cri}

{{< feature-state for_k8s_version="v1.23" state="alpha" >}}

ν΄λŸ¬μŠ€ν„°μ— `PodAndContainerStatsFromCRI`
[κΈ°λŠ₯ 게이트](/ko/docs/reference/command-line-tools-reference/feature-gates/)λ₯Ό ν™œμ„±ν™”ν•˜κ³ ,
{{< glossary_tooltip term_id="cri" text="μ»¨ν…Œμ΄λ„ˆ λŸ°νƒ€μž„ μΈν„°νŽ˜μ΄μŠ€(CRI)">}}λ₯Ό
ν†΅ν•œ 톡계 정보 접근을 μ§€μ›ν•˜λŠ” μ»¨ν…Œμ΄λ„ˆ λŸ°νƒ€μž„μ„ μ‚¬μš©ν•˜λŠ” 경우,
kubelet은 cAdvisorκ°€ μ•„λ‹Œ CRIλ₯Ό μ‚¬μš©ν•˜μ—¬ νŒŒλ“œ 및 μ»¨ν…Œμ΄λ„ˆ μˆ˜μ€€μ˜ λ©”νŠΈλ¦­ 데이터λ₯Ό κ°€μ Έμ˜¨λ‹€.

## {{% heading "whatsnext" %}}

[ν΄λŸ¬μŠ€ν„° νŠΈλŸ¬λΈ”μŠˆνŒ…ν•˜κΈ°](/ko/docs/tasks/debug/debug-cluster/) νƒœμŠ€ν¬ νŽ˜μ΄μ§€μ—μ„œ
μ΄λŸ¬ν•œ 데이터에 μ˜μ‘΄ν•˜λŠ” λ©”νŠΈλ¦­ νŒŒμ΄ν”„λΌμΈμ„ μ‚¬μš©ν•˜λŠ” 방법에 λŒ€ν•΄ 닀룬닀.
14 changes: 13 additions & 1 deletion content/ko/docs/reference/node/_index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
---
title: λ…Έλ“œ 레퍼런슀 정보
weight: 40
weight: 80
no_list: true
---

이 μ„Ήμ…˜μ—μ„œλŠ” λ…Έλ“œμ— κ΄€ν•œ λ‹€μŒμ˜ 레퍼런슀 주제λ₯Ό 닀룬닀.

* kubelet의 [체크포인트 API](/docs/reference/node/kubelet-checkpoint-api/)
* [도컀심 제거 및 CRI ν˜Έν™˜ λŸ°νƒ€μž„ μ‚¬μš©μ— λŒ€ν•œ κΈ€](/ko/docs/reference/node/topics-on-dockershim-and-cri-compatible-runtimes/) λͺ©λ‘

λ‹€μŒκ³Ό 같은 λ‹€λ₯Έ μΏ λ²„λ„€ν‹°μŠ€ λ¬Έμ„œμ—μ„œλ„
λ…Έλ“œ 레퍼런슀 상세에 λŒ€ν•΄ 읽어볼 수 μžˆλ‹€.

* [λ…Έλ“œ λ©”νŠΈλ¦­ 데이터](/ko/docs/reference/instrumentation/node-metrics/).

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ title: kubelet 이미지 자격 증λͺ… κ³΅κΈ‰μž κ΅¬μ„±ν•˜κΈ°
# - cheftako
description: kubelet의 이미지 자격 증λͺ… κ³΅κΈ‰μž ν”ŒλŸ¬κ·ΈμΈμ„ κ΅¬μ„±ν•œλ‹€.
content_type: task
min-kubernetes-server-version: v1.26
---

{{< feature-state for_k8s_version="v1.24" state="beta" >}}
{{< feature-state for_k8s_version="v1.26" state="stable" >}}

<!-- overview -->

Expand All @@ -27,10 +28,13 @@ kubelet은 ν”ŒλŸ¬κ·ΈμΈμ„ 톡해 정적 자격 증λͺ…을 λ””μŠ€ν¬μ— μ €μž₯ν•˜

## {{% heading "prerequisites" %}}

* kubelet 이미지 자격 증λͺ… κ³΅κΈ‰μžλŠ” μ•ŒνŒŒ(alpha) κΈ°λŠ₯으둜 v1.20μ—μ„œ λ„μž…λ˜μ—ˆλ‹€.
이 κΈ°λŠ₯을 κ΅¬λ™ν•˜λ €λ©΄, λ‹€λ₯Έ μ•ŒνŒŒ κΈ°λŠ₯κ³Ό λ§ˆμ°¬κ°€μ§€λ‘œ κΈ°λŠ₯ 게이트(feature gate) `KubeletCredentialProviders`κ°€ kubeletμ—μ„œλ§Œ ν™œμ„±ν™”λ˜μ–΄μ•Ό ν•œλ‹€.
* kubelet 자격 증λͺ… κ³΅κΈ‰μž ν”ŒλŸ¬κ·ΈμΈμ„ μ§€μ›ν•˜λŠ” λ…Έλ“œλ‘œ κ΅¬μ„±λœ μΏ λ²„λ„€ν‹°μŠ€ ν΄λŸ¬μŠ€ν„°κ°€ ν•„μš”ν•˜λ‹€.
이 κΈ°λŠ₯은 μΏ λ²„λ„€ν‹°μŠ€ {{< skew currentVersion >}}μ—μ„œ μ‚¬μš© κ°€λŠ₯ν•˜λ‹€.
μΏ λ²„λ„€ν‹°μŠ€ v1.24 및 v1.25μ—λŠ” 베타 κΈ°λŠ₯으둜 ν¬ν•¨λ˜μ—ˆμœΌλ©°, 기본적으둜 ν™œμ„±ν™”λ˜μ–΄ μžˆλ‹€.
* 자격 증λͺ… κ³΅κΈ‰μž exec ν”ŒλŸ¬κ·ΈμΈμ— λŒ€ν•œ κ΅¬ν˜„μ²΄(implementation)κ°€ ν•„μš”ν•˜λ‹€. 이λ₯Ό μœ„ν•΄ 자체 ν”ŒλŸ¬κ·ΈμΈμ„ κ΅¬μΆ•ν•˜κ±°λ‚˜ ν΄λΌμš°λ“œ κ³΅κΈ‰μžκ°€ μ œκ³΅ν•˜λŠ” ν”ŒλŸ¬κ·ΈμΈμ„ μ‚¬μš©ν•  수 μžˆλ‹€.

{{< version-check >}}

<!-- steps -->

## λ…Έλ“œμ— ν”ŒλŸ¬κ·ΈμΈ μ„€μΉ˜ν•˜κΈ°
Expand All @@ -52,36 +56,36 @@ kubelet은 `--image-credential-provider-config`둜 μ „λ‹¬λœ ꡬ성 νŒŒμΌμ„
[ECR](https://aws.amazon.com/ecr/)-based ν”ŒλŸ¬κ·ΈμΈμ„ μ‚¬μš©ν•˜λŠ” 경우 μ‚¬μš©ν•˜κ²Œ 될 수 μžˆλŠ” ꡬ성 파일의 예:

```yaml
apiVersion: kubelet.config.k8s.io/v1alpha1
apiVersion: kubelet.config.k8s.io/v1
kind: CredentialProviderConfig
# providers is a list of credential provider plugins that will be enabled by the kubelet.
# Multiple providers may match against a single image, in which case credentials
# from all providers will be returned to the kubelet. If multiple providers are called
# for a single image, the results are combined. If providers return overlapping
# auth keys, the value from the provider earlier in this list is used.
# providers ν•„λ“œλŠ” kubelet이 ν™œμ„±ν™”ν•  자격 증λͺ… κ³΅κΈ‰μž 헬퍼 ν”ŒλŸ¬κ·ΈμΈμ˜ λͺ©λ‘μ„ λ‚˜νƒ€λ‚Έλ‹€.
# 단일 이미지에 λŒ€ν•΄ 볡수 κ³΅κΈ‰μžκ°€ 맀치될 μˆ˜λ„ 있으며,
# μ΄λŸ¬ν•œ 경우 λͺ¨λ“  κ³΅κΈ‰μžμ˜ 자격 증λͺ…이 kubelet으둜 λ¦¬ν„΄λœλ‹€.
# 단일 이미지에 λŒ€ν•΄ 볡수 κ³΅κΈ‰μžκ°€ 호좜된 경우, κ²°κ³Όκ°€ ν•©μ‚°λœλ‹€.
# κ³΅κΈ‰μžκ°€ μ€‘λ³΅λ˜λŠ”(overlapping) 인증 ν‚€λ₯Ό λ¦¬ν„΄ν•œ 경우, 이 λͺ©λ‘μ˜ μœ„μͺ½μ— μœ„μΉ˜ν•˜λŠ” κ³΅κΈ‰μžλ‘œλΆ€ν„°μ˜ 값이 μ‚¬μš©λœλ‹€.
providers:
# name is the required name of the credential provider. It must match the name of the
# provider executable as seen by the kubelet. The executable must be in the kubelet's
# bin directory (set by the --image-credential-provider-bin-dir flag).
# name ν•„λ“œλŠ” 자격 증λͺ… κ³΅κΈ‰μžλ₯Ό κ΅¬λΆ„ν•˜κΈ° μœ„ν•œ ν•„μˆ˜ ν•„λ“œμ΄λ‹€.
# 이 이름은 kubelet이 μΈμ‹ν•˜λŠ” κ³΅κΈ‰μž μ‹€ν–‰ 파일의 이름과 μΌμΉ˜ν•΄μ•Ό ν•œλ‹€.
# ν•΄λ‹Ή μ‹€ν–‰ νŒŒμΌμ€ kubelet의 bin 디렉토리에 μ‘΄μž¬ν•΄μ•Ό ν•œλ‹€(--image-credential-provider-bin-dir ν”Œλž˜κ·Έλ‘œ μ„€μ •).
- name: ecr
# matchImages is a required list of strings used to match against images in order to
# determine if this provider should be invoked. If one of the strings matches the
# requested image from the kubelet, the plugin will be invoked and given a chance
# to provide credentials. Images are expected to contain the registry domain
# and URL path.
# matchImages ν•„λ“œλŠ” 각 이미지에 λŒ€ν•΄ 이 κ³΅κΈ‰μžκ°€ ν™œμ„±ν™”λ˜μ–΄μ•Ό ν•˜λŠ”μ§€λ₯Ό
# νŒλ‹¨ν•˜κΈ° μœ„ν•œ λ¬Έμžμ—΄μ˜ λͺ©λ‘μ„ λ‚˜νƒ€λ‚΄λŠ” ν•„μˆ˜ ν•„λ“œμ΄λ‹€.
# kubelet이 μš”μ²­ν•œ 이미지가 λ‹€μŒ λ¬Έμžμ—΄ 쀑 ν•˜λ‚˜μ™€ 맀치되면,
# ν•΄λ‹Ή ν”ŒλŸ¬κ·ΈμΈμ΄ ν™œμ„±ν™”λ˜μ–΄ 자격 증λͺ…을 μ œκ³΅ν•  수 있게 λœλ‹€.
# 이미지 νƒœκ·Έ λ¬Έμžμ—΄μ€ μ €μž₯μ†Œ(registry) 도메인 및 URL 경둜λ₯Ό 포함해야 ν•œλ‹€.
#
# Each entry in matchImages is a pattern which can optionally contain a port and a path.
# Globs can be used in the domain, but not in the port or the path. Globs are supported
# as subdomains like '*.k8s.io' or 'k8s.*.io', and top-level-domains such as 'k8s.*'.
# Matching partial subdomains like 'app*.k8s.io' is also supported. Each glob can only match
# a single subdomain segment, so *.io does not match *.k8s.io.
# matchImages의 각 ν•­λͺ©μ€ νŒ¨ν„΄μ„ λ‚˜νƒ€λ‚΄λ©°, ν¬νŠΈμ™€ 경둜λ₯Ό 포함할 수 μžˆλ‹€.
# 도메인 μžλ¦¬μ— κΈ€λ‘­(glob)도 μ‚¬μš©ν•  수 μžˆμœΌλ‚˜, ν¬νŠΈμ™€ κ²½λ‘œμ—λŠ” μ‚¬μš©ν•  수 μ—†λ‹€.
# 글둭은 '*.k8s.io' λ˜λŠ” 'k8s.*.io'와 같이 μ„œλΈŒλ„λ©”μΈ ν˜•νƒœλ‘œ μ‚¬μš©ν•˜κ±°λ‚˜, 'k8s.*'와 같이 μ΅œμƒμœ„ 도메인 ν˜•νƒœλ‘œ μ‚¬μš©ν•  수 μžˆλ‹€.
# 'app*.k8s.io'와 같이 μ„œλΈŒλ„λ©”μΈμ˜ 일뢀λ₯Ό λ§€μΉ­ν•˜λŠ” 것도 μ§€μ›λœλ‹€.
# 각 글둭은 단일 μ„œλΈŒλ„λ©”μΈ λΆ„ν• λ§Œμ„ 맀칭할 수 μžˆμœΌλ―€λ‘œ, `*.io`λŠ” `*.k8s.io`에 λ§€μΉ˜λ˜μ§€ **μ•ŠλŠ”λ‹€**.
#
# A match exists between an image and a matchImage when all of the below are true:
# - Both contain the same number of domain parts and each part matches.
# - The URL path of an imageMatch must be a prefix of the target image URL path.
# - If the imageMatch contains a port, then the port must match in the image as well.
# λ‹€μŒ 사항이 λͺ¨λ‘ 만쑱될 λ•Œμ—λ§Œ image와 matchImageκ°€ λ§€μΉ˜λ˜μ—ˆλ‹€κ³  νŒλ‹¨ν•œλ‹€.
# - μ–‘μͺ½μ˜ 도메인 파트 μˆ˜κ°€ λ™μΌν•˜κ³ , 각 νŒŒνŠΈκ°€ 맀치됨
# - imageMatch의 URL κ²½λ‘œκ°€ νƒ€κ²Ÿ 이미지 URL 경둜의 μ ‘λ‘μ‚¬μž„
# - imageMatchκ°€ 포트λ₯Ό ν¬ν•¨ν•˜λ©΄, 이미지 μͺ½μ— 기재된 ν¬νŠΈμ™€ 맀치됨
#
# Example values of matchImages:
# matchImages μ˜ˆμ‹œλŠ” λ‹€μŒκ³Ό κ°™λ‹€.
# - 123456789.dkr.ecr.us-east-1.amazonaws.com
# - *.azurecr.io
# - gcr.io
Expand All @@ -93,21 +97,21 @@ providers:
- "*.dkr.ecr-fips.*.amazonaws.com"
- "*.dkr.ecr.us-iso-east-1.c2s.ic.gov"
- "*.dkr.ecr.us-isob-east-1.sc2s.sgov.gov"
# defaultCacheDuration is the default duration the plugin will cache credentials in-memory
# if a cache duration is not provided in the plugin response. This field is required.
# defaultCacheDuration ν•„λ“œλŠ” μΊμ‹œ 기간이 ν”ŒλŸ¬κ·ΈμΈ 응닡에 λͺ…μ‹œλ˜μ§€ μ•Šμ€ κ²½μš°μ—
# ν•΄λ‹Ή ν”ŒλŸ¬κ·ΈμΈμ΄ 자격 증λͺ…을 인메λͺ¨λ¦¬ μΊμ‹œμ— 보관할 κΈ°λ³Έ 기간을 μ§€μ •ν•œλ‹€. 이 ν•„λ“œλŠ” ν•„μˆ˜μ΄λ‹€.
defaultCacheDuration: "12h"
# Required input version of the exec CredentialProviderRequest. The returned CredentialProviderResponse
# MUST use the same encoding version as the input. Current supported values are:
# - credentialprovider.kubelet.k8s.io/v1alpha1
apiVersion: credentialprovider.kubelet.k8s.io/v1alpha1
# Arguments to pass to the command when executing it.
# +optional
# apiVersion ν•„λ“œλŠ” CredentialProviderRequestλ₯Ό μ‹€ν–‰ν•  λ•Œ 기재될 μž…λ ₯ 버전을 μ§€μ •ν•˜λŠ” ν•„μˆ˜ ν•„λ“œμ΄λ‹€.
# 응닡 CredentialProviderResponseλŠ” μž…λ ₯κ³Ό λ™μΌν•œ 인코딩 버전을 μ‚¬μš©ν•΄μ•Ό ν•œλ‹€. ν˜„μž¬ μ§€μ›λ˜λŠ” 값은 λ‹€μŒκ³Ό κ°™λ‹€.
# - credentialprovider.kubelet.k8s.io/v1
apiVersion: credentialprovider.kubelet.k8s.io/v1
# args ν•„λ“œλŠ” μ»€λ§¨λ“œλ₯Ό μ‹€ν–‰ν•  λ•Œ 전달할 인자λ₯Ό μ§€μ •ν•˜λŠ” ν•„λ“œμ΄λ‹€.
# 이 ν•„λ“œλŠ” 선택사항이닀.
args:
- get-credentials
# Env defines additional environment variables to expose to the process. These
# are unioned with the host's environment, as well as variables client-go uses
# to pass argument to the plugin.
# +optional
# env ν•„λ“œλŠ” ν”„λ‘œμ„ΈμŠ€μ— λ…ΈμΆœν•  좔가적인 ν™˜κ²½ λ³€μˆ˜λ₯Ό κΈ°μž¬ν•˜λŠ” ν•„λ“œμ΄λ‹€.
# 이듀은 호슀트의 ν™˜κ²½ λ³€μˆ˜ 및
# client-goκ°€ ν”ŒλŸ¬κ·ΈμΈμ— 인자λ₯Ό μ „λ‹¬ν•˜κΈ° μœ„ν•΄ μ‚¬μš©ν•˜λŠ” λ³€μˆ˜μ™€ ν•©μ‚°λœλ‹€.
# 이 ν•„λ“œλŠ” 선택사항이닀.
env:
- name: AWS_PROFILE
value: example_profile
Expand Down Expand Up @@ -150,7 +154,7 @@ Glob은 `*.k8s.io`μ΄λ‚˜ `k8s.*.io` 같은 μ„œλΈŒλ„λ©”μΈκ³Ό `k8s.*`와 같은

## {{% heading "whatsnext" %}}

* [kubelet ꡬ성 API(v1alpha1) 레퍼런슀](/docs/reference/config-api/kubelet-config.v1alpha1/)μ—μ„œ
* [kubelet ꡬ성 API(v1) 레퍼런슀](/docs/reference/config-api/kubelet-config.v1/)μ—μ„œ
`CredentialProviderConfig`에 λŒ€ν•œ μ„ΈλΆ€ 정보 읽기
* [kubelet 자격 증λͺ… κ³΅κΈ‰μž API (v1alpha1) 레퍼런슀](/docs/reference/config-api/kubelet-credentialprovider.v1alpha1/) 읽기
* [kubelet 자격 증λͺ… κ³΅κΈ‰μž API (v1) 레퍼런슀](/docs/reference/config-api/kubelet-credentialprovider.v1/) 읽기

Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ metrics-serverλŠ” 각 λ…Έλ“œλ‘œλΆ€ν„° λ©”νŠΈλ¦­μ„ μˆ˜μ§‘ν•˜κΈ° μœ„ν•΄ [kubelet]
* v0.6.0 이상: λ©”νŠΈλ¦­ λ¦¬μ†ŒμŠ€ μ—”λ“œν¬μΈνŠΈ `/metrics/resource`
* 이전 버전: μš”μ•½ API μ—”λ“œν¬μΈνŠΈ `/stats/summary`

## {{% heading "whatsnext" %}}

metrics-server에 λŒ€ν•œ 더 λ§Žμ€ μ •λ³΄λŠ”
[metrics-server μ €μž₯μ†Œ](https://github.com/kubernetes-sigs/metrics-server)λ₯Ό ν™•μΈν•œλ‹€.

Expand All @@ -243,26 +245,5 @@ metrics-server에 λŒ€ν•œ 더 λ§Žμ€ μ •λ³΄λŠ”
* [metrics-server 릴리슀](https://github.com/kubernetes-sigs/metrics-server/releases)
* [Horizontal Pod Autoscaling](/ko/docs/tasks/run-application/horizontal-pod-autoscale/)

### μš”μ•½ API(Summary API) μ†ŒμŠ€ {#summary-api-source}

[Kubelet](/docs/reference/command-line-tools-reference/kubelet/)은
λ…Έλ“œ, λ³Όλ₯¨, νŒŒλ“œ, μ»¨ν…Œμ΄λ„ˆ μˆ˜μ€€μ˜ 톡계λ₯Ό μˆ˜μ§‘ν•˜λ©°,
μ†ŒλΉ„μž(consumer)κ°€ 읽을 수 μžˆλ„λ‘ 이 톡계λ₯Ό
[μš”μ•½ API](https://github.com/kubernetes/kubernetes/blob/7d309e0104fedb57280b261e5677d919cb2a0e2d/staging/src/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go)에 κΈ°λ‘ν•œλ‹€.

λ‹€μŒμ€ `minikube` λ…Έλ“œμ— λŒ€ν•œ μš”μ•½ API μš”μ²­ μ˜ˆμ‹œμ΄λ‹€.

```shell
kubectl get --raw "/api/v1/nodes/minikube/proxy/stats/summary"
```

λ‹€μŒμ€ `curl`을 μ΄μš©ν•˜μ—¬ λ™μΌν•œ API ν˜ΈμΆœμ„ ν•˜λŠ” λͺ…λ Ήμ–΄λ‹€.

```shell
curl http://localhost:8080/api/v1/nodes/minikube/proxy/stats/summary
```

{{< note >}}
metrics-server 0.6.x 버전뢀터,
μš”μ•½ API `/stats/summary` μ—”λ“œν¬μΈνŠΈκ°€ `/metrics/resource` μ—”λ“œν¬μΈνŠΈλ‘œ λŒ€μ²΄λ  것이닀.
{{< /note >}}
kubelet이 μ–΄λ–»κ²Œ λ…Έλ“œ λ©”νŠΈλ¦­μ„ μ œκ³΅ν•˜λŠ”μ§€, 그리고 μΏ λ²„λ„€ν‹°μŠ€ APIλ₯Ό 톡해 μ΄λŸ¬ν•œ λ©”νŠΈλ¦­μ— μ–΄λ–»κ²Œ μ ‘κ·Όν•˜λŠ”μ§€ μ•Œμ•„λ³΄λ €λ©΄,
[λ…Έλ“œ λ©”νŠΈλ¦­ 데이터](/ko/docs/reference/instrumentation/node-metrics/) λ¬Έμ„œλ₯Ό μ°Έμ‘°ν•œλ‹€.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# - lavalamp
# - thockin
title: μ„œλΉ„μŠ€μ™€ μ• ν”Œλ¦¬μΌ€μ΄μ…˜ μ—°κ²°ν•˜κΈ°
content_type: concept
weight: 30
content_type: tutorial
weight: 20
---


Expand All @@ -17,9 +17,7 @@ weight: 30

μΏ λ²„λ„€ν‹°μŠ€λŠ” νŒŒλ“œκ°€ 배치된 ν˜ΈμŠ€νŠΈμ™€λŠ” λ¬΄κ΄€ν•˜κ²Œ λ‹€λ₯Έ νŒŒλ“œμ™€ 톡신할 수 μžˆλ‹€κ³  κ°€μ •ν•œλ‹€. μΏ λ²„λ„€ν‹°μŠ€λŠ” λͺ¨λ“  νŒŒλ“œμ—κ²Œ 자체 ν΄λŸ¬μŠ€ν„°-프라이빗 IP μ£Όμ†Œλ₯Ό μ œκ³΅ν•˜κΈ° λ•Œλ¬Έμ— νŒŒλ“œκ°„μ— λͺ…μ‹œμ μœΌλ‘œ 링크λ₯Ό λ§Œλ“€κ±°λ‚˜ μ»¨ν…Œμ΄λ„ˆ 포트λ₯Ό 호슀트 ν¬νŠΈμ— 맀핑할 ν•„μš”κ°€ μ—†λ‹€. 이것은 νŒŒλ“œ λ‚΄μ˜ μ»¨ν…Œμ΄λ„ˆλŠ” λͺ¨λ‘ 둜컬호슀트(localhost)μ—μ„œ μ„œλ‘œμ˜ ν¬νŠΈμ— 도달할 수 있으며 ν΄λŸ¬μŠ€ν„°μ˜ λͺ¨λ“  νŒŒλ“œλŠ” NAT 없이 μ„œλ‘œλ₯Ό λ³Ό 수 μžˆλ‹€λŠ” μ˜λ―Έμ΄λ‹€. 이 λ¬Έμ„œμ˜ λ‚˜λ¨Έμ§€ λΆ€λΆ„μ—μ„œλŠ” μ΄λŸ¬ν•œ λ„€νŠΈμ›Œν‚Ή λͺ¨λΈμ—μ„œ μ‹ λ’°ν•  수 μžˆλŠ” μ„œλΉ„μŠ€λ₯Ό μ‹€ν–‰ν•˜λŠ” 방법에 λŒ€ν•΄ μžμ„Ένžˆ μ„€λͺ…ν•  것이닀.

이 κ°€μ΄λ“œλŠ” κ°„λ‹¨ν•œ nginx μ„œλ²„λ₯Ό μ‚¬μš©ν•΄μ„œ κ°œλ…μ¦λͺ…을 보여쀀닀.


이 νŠœν† λ¦¬μ–Όμ€ κ°„λ‹¨ν•œ nginx μ„œλ²„λ₯Ό μ‚¬μš©ν•˜μ—¬ κ°œλ…μ„ μ‹œμ—°ν•œλ‹€.

<!-- body -->

Expand Down Expand Up @@ -53,11 +51,12 @@ kubectl get pods -l run=my-nginx -o custom-columns=POD_IP:.status.podIPs
이제 ν΄λŸ¬μŠ€ν„°μ˜ λͺ¨λ“  λ…Έλ“œλ‘œ ssh μ ‘μ†ν•˜κ±°λ‚˜ `curl`κ³Ό 같은 도ꡬλ₯Ό μ‚¬μš©ν•˜μ—¬ 두 IP μ£Όμ†Œμ— 질의λ₯Ό 전솑할 수 μžˆμ„ 것이닀. μ»¨ν…Œμ΄λ„ˆλŠ” λ…Έλ“œμ˜ 포트 80을 μ‚¬μš©ν•˜μ§€ *μ•ŠμœΌλ©°* , νŠΈλž˜ν”½μ„ νŒŒλ“œλ‘œ λΌμš°νŒ…ν•˜λŠ” νŠΉλ³„ν•œ NAT κ·œμΉ™λ„ μ—†λ‹€λŠ” 것을 μ°Έκ³ ν•œλ‹€. 이것은 λ™μΌν•œ `containerPort`λ₯Ό μ‚¬μš©ν•˜μ—¬ λ™μΌν•œ λ…Έλ“œμ—μ„œ μ—¬λŸ¬ nginx νŒŒλ“œλ₯Ό μ‹€ν–‰ν•˜λŠ” 것이 κ°€λŠ₯ν•˜κ³ , λ˜ν•œ μ„œλΉ„μŠ€μ— ν• λ‹Ήλœ IP μ£Όμ†Œλ₯Ό μ‚¬μš©ν•˜μ—¬ ν΄λŸ¬μŠ€ν„°μ˜ λ‹€λ₯Έ νŒŒλ“œλ‚˜ λ…Έλ“œμ—μ„œ μ ‘κ·Όν•  수 μžˆλ‹€λŠ” μ˜λ―Έμ΄λ‹€. 호슀트 λ…Έλ“œμ˜ νŠΉμ • 포트λ₯Ό λ°°ν›„(backing) νŒŒλ“œλ‘œ ν¬μ›Œλ“œν•˜κ³  μ‹Άλ‹€λ©΄, κ°€λŠ₯은 ν•˜μ§€λ§Œ λ„€νŠΈμ›Œν‚Ή λͺ¨λΈμ„ μ‚¬μš©ν•˜λ©΄ κ·Έλ ‡κ²Œ ν•  ν•„μš”κ°€ μ—†μ–΄μ•Ό ν•œλ‹€.
λ§Œμ•½ κΆκΈˆν•˜λ‹€λ©΄ [μΏ λ²„λ„€ν‹°μŠ€ λ„€νŠΈμ›Œν‚Ή λͺ¨λΈ](/ko/docs/concepts/cluster-administration/networking/#μΏ λ²„λ„€ν‹°μŠ€-λ„€νŠΈμ›Œν¬-λͺ¨λΈ)을 μžμ„Ένžˆ 읽어본닀.
## μ„œλΉ„μŠ€ μƒμ„±ν•˜κΈ°
ν‰ν‰ν•˜κ³  넓은 ν΄λŸ¬μŠ€ν„° μ „μ²΄μ˜ μ£Όμ†Œ κ³΅κ°„μ—μ„œ nginxλ₯Ό μ‹€ν–‰ν•˜λŠ” νŒŒλ“œκ°€ μžˆλ‹€κ³  κ°€μ •ν•˜μž. μ΄λ‘ μ μœΌλ‘œλŠ” μ΄λŸ¬ν•œ νŒŒλ“œμ™€ 직접 λŒ€ν™”ν•  수 μžˆμ§€λ§Œ, λ…Έλ“œκ°€ 죽으면 μ–΄λ–»κ²Œ λ˜λŠ”κ°€? νŒŒλ“œκ°€ ν•¨κ»˜ 죽으면 λ””ν”Œλ‘œμ΄λ¨ΌνŠΈμ—μ„œ λ‹€λ₯Έ IPλ₯Ό 가진 μƒˆλ‘œμš΄ νŒŒλ“œλ₯Ό μƒμ„±ν•œλ‹€. 이 문제λ₯Ό μ„œλΉ„μŠ€κ°€ ν•΄κ²°ν•œλ‹€.
이제 μš°λ¦¬μ—κ²ŒλŠ” ν”Œλž«(flat)ν•˜κ³  ν΄λŸ¬μŠ€ν„° 전역에 κ±ΈμΉ˜λŠ” μ£Όμ†Œ κ³΅κ°„μ—μ„œ μ‹€ν–‰λ˜κ³  μžˆλŠ” nginx νŒŒλ“œκ°€ μžˆλ‹€. μ΄λ‘ μ μœΌλ‘œλŠ” μ΄λŸ¬ν•œ νŒŒλ“œμ™€ 직접 λŒ€ν™”ν•  수 μžˆμ§€λ§Œ, λ…Έλ“œκ°€ 죽으면 μ–΄λ–»κ²Œ λ˜λŠ”κ°€? νŒŒλ“œκ°€ ν•¨κ»˜ 죽으면 λ””ν”Œλ‘œμ΄λ¨ΌνŠΈμ—μ„œ λ‹€λ₯Έ IPλ₯Ό 가진 μƒˆλ‘œμš΄ νŒŒλ“œλ₯Ό μƒμ„±ν•œλ‹€. 이 문제λ₯Ό ν•΄κ²°ν•˜λŠ” 것이 λ°”λ‘œ μ„œλΉ„μŠ€μ΄λ‹€.
μΏ λ²„λ„€ν‹°μŠ€ μ„œλΉ„μŠ€λŠ” ν΄λŸ¬μŠ€ν„° μ–΄λ”˜κ°€μ—μ„œ μ‹€ν–‰λ˜λŠ” 논리적인 νŒŒλ“œ 집합을 μ •μ˜ν•˜κ³  μΆ”μƒν™”ν•¨μœΌλ‘œμ¨ λͺ¨λ‘ λ™μΌν•œ κΈ°λŠ₯을 μ œκ³΅ν•œλ‹€. μƒμ„±μ‹œ 각 μ„œλΉ„μŠ€μ—λŠ” κ³ μœ ν•œ IP μ£Όμ†Œ(clusterIP라고도 ν•œλ‹€)κ°€ ν• λ‹Ήλœλ‹€. 이 μ£Όμ†ŒλŠ” μ„œλΉ„μŠ€μ˜ 수λͺ…κ³Ό μ—°κ΄€λ˜μ–΄ 있으며, μ„œλΉ„μŠ€κ°€ ν™œμ„±ν™” λ˜μ–΄ μžˆλŠ” λ™μ•ˆμ—λŠ” λ³€κ²½λ˜μ§€ μ•ŠλŠ”λ‹€. νŒŒλ“œλŠ” μ„œλΉ„μŠ€μ™€ ν†΅μ‹ ν•˜λ„λ‘ ꡬ성할 수 있으며, μ„œλΉ„μŠ€μ™€μ˜ 톡신은 μ„œλΉ„μŠ€μ˜ 맴버 쀑 일뢀 νŒŒλ“œμ— μžλ™μ μœΌλ‘œ λ‘œλ“œ-λ°ΈλŸ°μ‹± λœλ‹€.
Expand Down Expand Up @@ -91,13 +90,17 @@ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
my-nginx ClusterIP 10.0.162.149 <none> 80/TCP 21s
```
μ•žμ—μ„œ μ–ΈκΈ‰ν•œ 바와 같이, μ„œλΉ„μŠ€λŠ” νŒŒλ“œ 그룹에 μ˜ν•΄ μ§€μ›λœλ‹€. 이 νŒŒλ“œλ“€μ€
`endpoints` λ₯Ό 톡해 λ…ΈμΆœλœλ‹€. μ„œλΉ„μŠ€ μ…€λ ‰ν„°λŠ” μ§€μ†μ μœΌλ‘œ ν‰κ°€λ˜κ³ 
κ²°κ³ΌλŠ” `my-nginx` μ΄λ¦„μ˜ μ—”λ“œν¬μΈνŠΈ μ˜€λΈŒμ νŠΈμ— POSTλœλ‹€.
νŒŒλ“œκ°€ 죽으면 μžλ™μ μœΌλ‘œ μ—”λ“œν¬μΈνŠΈμ—μ„œ 제거되며 μ„œλΉ„μŠ€ 셀렉터와
μΌμΉ˜ν•˜λŠ” μƒˆ νŒŒλ“œλŠ” μžλ™μ μœΌλ‘œ μ—”λ“œν¬μΈνŠΈμ— μΆ”κ°€λœλ‹€.
μ—”λ“œν¬μΈνŠΈλ₯Ό ν™•μΈν•˜κ³  IPκ°€ 첫 번째 λ‹¨κ³„μ—μ„œ μƒμ„±λœ νŒŒλ“œμ™€ λ™μΌν•˜λ‹€λŠ”
점을 μ°Έκ³ ν•œλ‹€.
μ•žμ—μ„œ μ–ΈκΈ‰ν•œ 바와 같이, μ„œλΉ„μŠ€ λ°‘μ—λŠ” μ—¬λŸ¬ νŒŒλ“œλ“€μ΄ μžˆλ‹€.
이 νŒŒλ“œλ“€μ€
{{<glossary_tooltip term_id="endpoint-slice" text="μ—”λ“œν¬μΈνŠΈμŠ¬λΌμ΄μŠ€(EndpointSlice)">}}λ₯Ό
톡해 λ…ΈμΆœλœλ‹€. ν•΄λ‹Ή μ„œλΉ„μŠ€μ˜ μ…€λ ‰ν„°λŠ” μ§€μ†μ μœΌλ‘œ ν‰κ°€λ˜κ³ , κ·Έ κ²°κ³ΌλŠ”
{{< glossary_tooltip text="λ ˆμ΄λΈ”" term_id="label" >}}을 μ‚¬μš©ν•˜μ—¬
μ„œλΉ„μŠ€μ— μ—°κ²°λœ μ—”λ“œν¬μΈνŠΈμŠ¬λΌμ΄μŠ€λ‘œ POSTλœλ‹€.
νŒŒλ“œκ°€ 죽으면, ν•΄λ‹Ή νŒŒλ“œλ₯Ό μ—”λ“œν¬μΈνŠΈλ‘œ κ°–λŠ” μ—”λ“œν¬μΈνŠΈμŠ¬λΌμ΄μŠ€μ—μ„œ μžλ™μœΌλ‘œ μ œκ±°λœλ‹€.
μ‹ κ·œ νŒŒλ“œκ°€ νŠΉμ • μ„œλΉ„μŠ€μ˜ 셀렉터에 맀치되면
ν•΄λ‹Ή μ„œλΉ„μŠ€λ₯Ό μœ„ν•œ μ—”λ“œν¬μΈνŠΈμŠ¬λΌμ΄μŠ€μ— μžλ™μœΌλ‘œ μΆ”κ°€λœλ‹€.
μ—”λ“œν¬μΈνŠΈλ₯Ό 확인해 보면,
IPκ°€ 첫 번째 λ‹¨κ³„μ—μ„œ μƒμ„±λœ νŒŒλ“œμ˜ IP와 λ™μΌν•˜λ‹€λŠ” 것을 μ•Œ 수 μžˆλ‹€.
```shell
kubectl describe svc my-nginx
Expand Down Expand Up @@ -140,7 +143,7 @@ curl을 ν•  수 μžˆμ„ 것이닀. μ„œλΉ„μŠ€ IPλŠ” μ™„μ „νžˆ κ°€μƒμ΄λ―€λ‘œ μ™Έ
{{< /note >}}
### ν™˜κ²½ λ³€μˆ˜λ“€
### ν™˜κ²½ λ³€μˆ˜
νŒŒλ“œκ°€ λ…Έλ“œμ—μ„œ 싀행될 λ•Œ kubelet은 각기 ν™œμ„±ν™”λœ μ„œλΉ„μŠ€μ— λŒ€ν•΄ 일련의 ν™˜κ²½
λ³€μˆ˜ 집합을 μΆ”κ°€ν•œλ‹€. 이것은 μˆœμ„œ 문제λ₯Ό μ•ΌκΈ°ν•œλ‹€. 이유λ₯Ό ν™•μΈν•˜λ €λ©΄
Expand Down

0 comments on commit bbd4c27

Please sign in to comment.