Skip to content

Commit

Permalink
[ko] Update outdated files in dev-1.26-ko.1 R1-3
Browse files Browse the repository at this point in the history
  • Loading branch information
jihoon-seo committed Dec 15, 2022
1 parent 5c9e45e commit 6dee659
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 80 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/) 태스크 페이지에서
이러한 데이터에 의존하는 메트릭 파이프라인을 사용하는 방법에 대해 다룬다.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 포트와 프로토콜
content_type: reference
weight: 50
weight: 40
---

물리적 네트워크 방화벽이 있는 온프레미스 데이터 센터 또는
Expand Down
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 6dee659

Please sign in to comment.