Skip to content

Commit

Permalink
[ko] Update outdated files in dev-1.24-ko.1 M73-M88
Browse files Browse the repository at this point in the history
  • Loading branch information
jihoon-seo committed May 30, 2022
1 parent e6d993f commit 6f51f7f
Show file tree
Hide file tree
Showing 15 changed files with 927 additions and 764 deletions.
475 changes: 298 additions & 177 deletions content/ko/docs/reference/command-line-tools-reference/feature-gates.md

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion content/ko/docs/reference/glossary/api-eviction.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ aka:
tags:
- operation
---

API를 이용한 축출은 [축출 API](/docs/reference/generated/kubernetes-api/{{<param "version">}}/#create-eviction-pod-v1-core)를 사용하여
생성된 `Eviction` 오브젝트로 파드를 정상 종료한다.

Expand All @@ -20,4 +19,9 @@ API를 이용한 축출은 [축출 API](/docs/reference/generated/kubernetes-api
축출 API를 직접 호출해 축출 요청을 할 수 있다.
`Eviction` 오브젝트가 생성되면, API 서버가 파드를 종료한다.

API를 이용한 축출은 사용자가 설정한 [`PodDisruptionBudgets`](/docs/tasks/run-application/configure-pdb/)
[`terminationGracePeriodSeconds`](/ko/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination) 값을 준수한다.

API를 이용한 축출은 [노드-압박 축출](/docs/concepts/scheduling-eviction/eviction/#kubelet-eviction)과 동일하지 않다.

* 더 많은 정보는 [API를 이용한 축출](/ko/docs/concepts/scheduling-eviction/api-eviction/)을 참고한다.
9 changes: 6 additions & 3 deletions content/ko/docs/reference/glossary/kubectl.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,19 @@ id: kubectl
date: 2018-04-12
full_link: /docs/user-guide/kubectl-overview/
short_description: >
쿠버네티스 API 서버와 통신하기 위한 커맨드라인 툴.
쿠버네티스 클러스터와 통신하기 위한 커맨드라인 툴.
aka:
- kubectl
tags:
- tool
- fundamental
---
{{< glossary_tooltip text="쿠버네티스 API" term_id="kubernetes-api" >}} 서버와 통신하기 위한 커맨드라인 툴.
쿠버네티스 API를 사용하여
쿠버네티스 클러스터의 {{< glossary_tooltip text="컨트롤 플레인" term_id="control-plane" >}}과
통신하기 위한 커맨드라인 툴

<!--more-->

사용자는 쿠버네티스 오브젝트를 생성, 점검, 업데이트, 삭제하기 위해서 kubectl를 사용할 수 있다.
사용자는 쿠버네티스 오브젝트를 생성, 점검, 업데이트, 삭제하기 위해서 `kubectl` 사용할 수 있다.

4 changes: 2 additions & 2 deletions content/ko/docs/reference/glossary/namespace.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
title: 네임스페이스(Namespace)
id: namespace
date: 2018-04-12
full_link: /ko/docs/concepts/overview/working-with-objects/namespaces
full_link: /ko/docs/concepts/overview/working-with-objects/namespaces/
short_description: >
쿠버네티스에서 동일한 물리 클러스터에서 다중의 가상 클러스터를 지원하기 위해 사용하는 추상화.
쿠버네티스에서, 하나의 클러스터 내에서 리소스 그룹의 격리를 지원하기 위해 사용하는 추상화.
aka:
tags:
Expand Down
3 changes: 2 additions & 1 deletion content/ko/docs/reference/glossary/pod-security-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: 파드 시큐리티 폴리시(Pod Security Policy)
id: pod-security-policy
date: 2018-04-12
full_link: /ko/docs/concepts/policy/pod-security-policy/
full_link: /ko/docs/concepts/security/pod-security-policy/
short_description: >
파드 생성과 업데이트에 대한 세밀한 인가를 활성화한다.
Expand All @@ -17,3 +17,4 @@ tags:

파드 명세에서 보안에 민감한 측면을 제어하는 클러스터 수준의 리소스. `PodSecurityPolicy` 오브젝트는 파드가 시스템에 수용될 수 있도록 파드가 실행해야 하는 조건의 집합과 관련된 필드의 기본 값을 정의한다. 파드 시큐리티 폴리시 제어는 선택적인 어드미션 컨트롤러로서 구현된다.

파드 시큐리티 폴리시는 쿠버네티스 v1.21에서 사용 중단되었고, v1.25에서 제거될 예정이다. [파드 시큐리티 어드미션](/docs/concepts/security/pod-security-admission/) 또는 써드파티 어드미션 플러그인으로 이전(migrate)하는 것을 추천한다.
2 changes: 0 additions & 2 deletions content/ko/docs/reference/issues-security/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ weight: 20

보안 및 주요 API 공지에 대한 이메일을 위해서는 [kubernetes-security-announce](https://groups.google.com/forum/#!forum/kubernetes-security-announce)) 그룹에 가입한다.

[이 링크](https://groups.google.com/forum/feed/kubernetes-security-announce/msgs/rss_v2_0.xml?num=50)를 사용하여 RSS 피드도 구독할 수 있다.

## 취약점 보고

우리는 쿠버네티스 오픈소스 커뮤니티에 취약점을 보고하는 보안 연구원들과 사용자들에게 매우 감사하고 있다. 모든 보고서는 커뮤니티 자원 봉사자들에 의해 철저히 조사된다.
Expand Down
553 changes: 552 additions & 1 deletion content/ko/docs/reference/kubectl/_index.md

Large diffs are not rendered by default.

52 changes: 34 additions & 18 deletions content/ko/docs/reference/kubectl/cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ title: kubectl 치트 시트


content_type: concept
weight: 10 # highlight it
card:
name: reference
weight: 30
Expand Down Expand Up @@ -38,6 +39,11 @@ complete -F __start_kubectl k
source <(kubectl completion zsh) # 현재 셸에 zsh의 자동 완성 설정
echo "[[ $commands[kubectl] ]] && source <(kubectl completion zsh)" >> ~/.zshrc # 자동 완성을 zsh 셸에 영구적으로 추가한다.
```
### --all-namespaces 에 대한 노트

`--all-namespaces`를 붙여야 하는 상황이 자주 발생하므로, `--all-namespaces`의 축약형을 알아 두는 것이 좋다.

```kubectl -A```

## Kubectl 컨텍스트와 설정

Expand All @@ -56,11 +62,11 @@ kubectl config view
# e2e 사용자의 암호를 확인한다
kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'

kubectl config view -o jsonpath='{.users[].name}' # 첫 번째 사용자 출력
kubectl config view -o jsonpath='{.users[].name}' # 첫 번째 사용자 출력
kubectl config view -o jsonpath='{.users[*].name}' # 사용자 리스트 조회
kubectl config get-contexts # 컨텍스트 리스트 출력
kubectl config current-context # 현재 컨텍스트 출력
kubectl config use-context my-cluster-name # my-cluster-name를 기본 컨텍스트로 설정
kubectl config get-contexts # 컨텍스트 리스트 출력
kubectl config current-context # 현재 컨텍스트 출력
kubectl config use-context my-cluster-name # my-cluster-name를 기본 컨텍스트로 설정

# 기본 인증을 지원하는 새로운 사용자를 kubeconf에 추가한다
kubectl config set-credentials kubeuser/foo.kubernetes.com --username=kubeuser --password=kubepassword
Expand All @@ -73,6 +79,10 @@ kubectl config set-context gce --user=cluster-admin --namespace=foo \
&& kubectl config use-context gce

kubectl config unset users.foo # foo 사용자 삭제

# 컨텍스트/네임스페이스를 설정/조회하는 단축 명령 (bash 및 bash 호환 셸에서만 동작함, 네임스페이스 설정을 위해 kn 을 사용하기 전에 현재 컨텍스트가 설정되어야 함)
alias kx='f() { [ "$1" ] && kubectl config use-context $1 || kubectl config current-context ; } ; f'
alias kn='f() { [ "$1" ] && kubectl config set-context --current --namespace $1 || kubectl config view --minify | grep namespace | cut -d" " -f6 ; } ; f'
```

## Kubectl apply
Expand All @@ -92,10 +102,10 @@ kubectl apply -f https://git.io/vPieo # url로부터 리소스(들) 생
kubectl create deployment nginx --image=nginx # nginx 단일 인스턴스를 시작

# "Hello World"를 출력하는 잡(Job) 생성
kubectl create job hello --image=busybox -- echo "Hello World"
kubectl create job hello --image=busybox:1.28 -- echo "Hello World"

# 매분마다 "Hello World"를 출력하는 크론잡(CronJob) 생성
kubectl create cronjob hello --image=busybox --schedule="*/1 * * * *" -- echo "Hello World"
kubectl create cronjob hello --image=busybox:1.28 --schedule="*/1 * * * *" -- echo "Hello World"

kubectl explain pods # 파드 매니페스트 문서를 조회

Expand All @@ -108,7 +118,7 @@ metadata:
spec:
containers:
- name: busybox
image: busybox
image: busybox:1.28
args:
- sleep
- "1000000"
Expand All @@ -120,7 +130,7 @@ metadata:
spec:
containers:
- name: busybox
image: busybox
image: busybox:1.28
args:
- sleep
- "1000"
Expand Down Expand Up @@ -172,9 +182,9 @@ kubectl get pods --selector=app=cassandra -o \
kubectl get configmap myconfig \
-o jsonpath='{.data.ca\.crt}'

# 모든 워커 노드 조회 (셀렉터를 사용하여 'node-role.kubernetes.io/master'
# 모든 워커 노드 조회 (셀렉터를 사용하여 'node-role.kubernetes.io/control-plane'
# 으로 명명된 라벨의 결과를 제외)
kubectl get node --selector='!node-role.kubernetes.io/master'
kubectl get node --selector='!node-role.kubernetes.io/control-plane'

# 네임스페이스의 모든 실행 중인 파드를 조회
kubectl get pods --field-selector=status.phase=Running
Expand Down Expand Up @@ -212,19 +222,21 @@ kubectl diff -f ./my-manifest.yaml

# 노드에 대해 반환된 모든 키의 마침표로 구분된 트리를 생성한다.
# 복잡한 중첩 JSON 구조 내에서 키를 찾을 때 유용하다.
kubectl get nodes -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
kubectl get nodes -o json | jq -c 'paths|join(".")'

# 파드 등에 대해 반환된 모든 키의 마침표로 구분된 트리를 생성한다.
kubectl get pods -o json | jq -c 'path(..)|[.[]|tostring]|join(".")'
kubectl get pods -o json | jq -c 'paths|join(".")'

# 모든 파드에 대해 ENV를 생성한다(각 파드에 기본 컨테이너가 있고, 기본 네임스페이스가 있고, `env` 명령어가 동작한다고 가정).
# `env` 뿐만 아니라 다른 지원되는 명령어를 모든 파드에 실행할 때에도 참고할 수 있다.
for pod in $(kubectl get po --output=jsonpath={.items..metadata.name}); do echo $pod && kubectl exec -it $pod -- env; done

# 디플로이먼트의 status 서브리소스를 조회한다.
kubectl get deployment nginx-deployment --subresource=status
```

## 리소스 업데이트


```bash
kubectl set image deployment/frontend www=image:v2 # "frontend" 디플로이먼트의 "www" 컨테이너 이미지를 업데이트하는 롤링 업데이트
kubectl rollout history deployment/frontend # 현 리비전을 포함한 디플로이먼트의 이력을 체크
Expand All @@ -234,7 +246,7 @@ kubectl rollout status -w deployment/frontend # 완료될 때
kubectl rollout restart deployment/frontend # "frontend" 디플로이먼트의 롤링 재시작


cat pod.json | kubectl replace -f - # std로 전달된 JSON을 기반으로 파드 교체
cat pod.json | kubectl replace -f - # stdin으로 전달된 JSON을 기반으로 파드 교체

# 리소스를 강제 교체, 삭제 후 재생성함. 이것은 서비스를 중단시킴.
kubectl replace --force -f ./pod.json
Expand Down Expand Up @@ -266,11 +278,15 @@ kubectl patch deployment valid-deployment --type json -p='[{"op": "remove", "

# 위치 배열에 새 요소 추가
kubectl patch sa default --type='json' -p='[{"op": "add", "path": "/secrets/1", "value": {"name": "whatever" } }]'

# Update a deployment's replicas count by patching it's scale subresource
# 디플로이먼트의 scale 서브리소스를 패치하여 레플리카 카운트를 업데이트.
kubectl patch deployment nginx-deployment --subresource='scale' --type='merge' -p '{"spec":{"replicas":2}}'
```

## 리소스 편집

편집기로 모든 API 리소스를 편집.
선호하는 편집기로 모든 API 리소스를 편집할 수 있다.

```bash
kubectl edit svc/docker-registry # docker-registry라는 서비스 편집
Expand Down Expand Up @@ -310,7 +326,7 @@ kubectl logs my-pod -c my-container --previous # 컨테이너의 이전 인
kubectl logs -f my-pod # 실시간 스트림 파드 로그(stdout)
kubectl logs -f my-pod -c my-container # 실시간 스트림 파드 로그(stdout, 멀티-컨테이너 경우)
kubectl logs -f -l name=myLabel --all-containers # name이 myLabel인 모든 파드의 로그 스트리밍 (stdout)
kubectl run -i --tty busybox --image=busybox -- sh # 대화형 셸로 파드를 실행
kubectl run -i --tty busybox --image=busybox:1.28 -- sh # 대화형 셸로 파드를 실행
kubectl run nginx --image=nginx -n mynamespace # mynamespace 네임스페이스에서 nginx 파드 1개 실행
kubectl run nginx --image=nginx # nginx 파드를 실행하고 해당 스펙을 pod.yaml 파일에 기록
--dry-run=client -o yaml > pod.yaml
Expand Down Expand Up @@ -419,7 +435,7 @@ kubectl get pods -A -o=custom-columns='DATA:spec.containers[?(@.image!="k8s.gcr.
kubectl get pods -A -o=custom-columns='DATA:metadata.*'
```

더 많은 예제는 kubectl [참조 문서](/ko/docs/reference/kubectl/overview/#custom-columns)를 참고한다.
더 많은 예제는 kubectl [참조 문서](/ko/docs/reference/kubectl/#custom-columns)를 참고한다.

### Kubectl 출력 로그 상세 레벨(verbosity)과 디버깅

Expand All @@ -440,7 +456,7 @@ Kubectl 로그 상세 레벨(verbosity)은 `-v` 또는`--v` 플래그와 로그

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

* [kubectl 개요](/ko/docs/reference/kubectl/overview/)를 읽고 [JsonPath](/ko/docs/reference/kubectl/jsonpath)에 대해 배워보자.
* [kubectl 개요](/ko/docs/reference/kubectl/)를 읽고 [JsonPath](/ko/docs/reference/kubectl/jsonpath)에 대해 배워보자.

* [kubectl](/ko/docs/reference/kubectl/kubectl/) 옵션을 참고한다.

Expand Down
10 changes: 10 additions & 0 deletions content/ko/docs/reference/kubectl/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ content_type: concept
* 예를 들어 `jobs.v1.batch/myjob`과 같이 전체 버전을 사용한다. 이를 통해 `kubectl`이 시간이 지남에 따라 변경될 수 있는 기본 버전을 사용하지 않도록 한다.
* 문맥, 설정 또는 기타 암묵적 상태에 의존하지 않는다.

## 서브리소스 {#subresources}

* kubectl의 `get`, `patch`, `edit``replace`와 같은 명령어에서
서브리소스를 지원하는 모든 리소스에 대해 `--subresource` 알파 플래그를 사용하여
서브리소스를 조회하고 업데이트할 수 있다. 현재, `status``scale` 서브리소스만 지원된다.
* 서브리소스에 대한 API 계약은 전체 리소스와 동일하다.
`status` 서브리소스를 새 값으로 업데이트해도,
컨트롤러에서 서브리소스를 잠재적으로 다른 값으로 조정할 수 있다는 점을 염두에 두어야 한다.


## 모범 사례

### `kubectl run`
Expand Down
1 change: 0 additions & 1 deletion content/ko/docs/reference/kubectl/jsonpath.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: JSONPath 지원
content_type: concept
weight: 25
---

<!-- overview -->
Expand Down
Loading

0 comments on commit 6f51f7f

Please sign in to comment.