[ko] Update outdated files dev-1.26-ko.1 (M143 - M148)

Apply suggestions from code review

Co-authored-by: Sanghong Kim <58922834+bconfiden2@users.noreply.github.com>
This commit is contained in:
Yoon Seo-Yul 2023-03-26 01:12:15 +09:00
parent c4b3d67f8c
commit eda4f1d533
No known key found for this signature in database
GPG Key ID: E0CD108B3D764517
6 changed files with 69 additions and 63 deletions

View File

@ -22,7 +22,8 @@ card:
{{< warning >}} {{< warning >}}
신뢰할 수 있는 소스의 kubeconfig 파일만 사용해야 한다. 특수 제작된 kubeconfig 파일은 악성코드를 실행하거나 파일을 노출시킬 수 있다. 신뢰할 수 있는 소스의 kubeconfig 파일만 사용해야 한다.
특수 제작된 kubeconfig 파일은 악성코드를 실행하거나 파일을 노출시킬 수 있다.
신뢰할 수 없는 kubeconfig 파일을 꼭 사용해야 한다면, 셸 스크립트를 사용하는 경우처럼 신중한 검사가 선행되어야 한다. 신뢰할 수 없는 kubeconfig 파일을 꼭 사용해야 한다면, 셸 스크립트를 사용하는 경우처럼 신중한 검사가 선행되어야 한다.
{{< /warning>}} {{< /warning>}}
@ -40,12 +41,12 @@ card:
## 클러스터, 사용자, 컨텍스트 정의 ## 클러스터, 사용자, 컨텍스트 정의
당신이 개발 작업을 위한 클러스터와 스크래치 작업을 위한 클러스터를 가지고 있다고 가정해보자. 당신이 개발 작업을 위한 클러스터와 테스트 작업을 위한 클러스터를 가지고 있다고 가정해보자.
`development` 클러스터에서는 프런트 엔드 개발자들이 `frontend`라는 네임스페이스에서 `development` 클러스터에서는 프런트 엔드 개발자들이 `frontend`라는 네임스페이스에서
작업을 하고 있고, 스토리지 개발자들은 `storage`라는 네임스페이스에서 작업을 하고 있다. 작업을 하고 있고, 스토리지 개발자들은 `storage`라는 네임스페이스에서 작업을 하고 있다.
`scratch` 클러스터에서는 개발자들이 default 네임스페이스에서 개발하거나 필요에 따라 보조 `test` 클러스터에서는 개발자들이 default 네임스페이스에서 개발하거나 필요에 따라 보조
네임스페이스들을 생성하고 있다. development 클러스터에 접근하려면 인증서로 인증을 해야 하고, 네임스페이스들을 생성하고 있다. development 클러스터에 접근하려면 인증서로 인증을 해야 하고,
scratch 클러스터에 접근하려면 사용자네임과 패스워드로 인증을 해야 한다. test 클러스터에 접근하려면 사용자네임과 패스워드로 인증을 해야 한다.
`config-exercise`라는 디렉터리를 생성한다. `config-exercise` 디렉터리에 `config-exercise`라는 디렉터리를 생성한다. `config-exercise` 디렉터리에
다음 내용을 가진 `config-demo`라는 파일을 생성한다. 다음 내용을 가진 `config-demo`라는 파일을 생성한다.
@ -59,7 +60,7 @@ clusters:
- cluster: - cluster:
name: development name: development
- cluster: - cluster:
name: scratch name: test
users: users:
- name: developer - name: developer
@ -71,7 +72,7 @@ contexts:
- context: - context:
name: dev-storage name: dev-storage
- context: - context:
name: exp-scratch name: exp-test
``` ```
구성 파일은 클러스터들, 사용자들, 컨텍스트들을 기술한다. `config-demo` 파일은 두 클러스터들과 구성 파일은 클러스터들, 사용자들, 컨텍스트들을 기술한다. `config-demo` 파일은 두 클러스터들과
@ -82,11 +83,15 @@ contexts:
```shell ```shell
kubectl config --kubeconfig=config-demo set-cluster development --server=https://1.2.3.4 --certificate-authority=fake-ca-file kubectl config --kubeconfig=config-demo set-cluster development --server=https://1.2.3.4 --certificate-authority=fake-ca-file
kubectl config --kubeconfig=config-demo set-cluster scratch --server=https://5.6.7.8 --insecure-skip-tls-verify kubectl config --kubeconfig=config-demo set-cluster test --server=https://5.6.7.8 --insecure-skip-tls-verify
``` ```
사용자의 세부사항들을 구성 파일에 추가한다. 사용자의 세부사항들을 구성 파일에 추가한다.
{{< caution >}}
쿠버네티스 클라이언트 구성에 암호를 저장하는 것은 위험하다. 자격 증명 플러그인을 사용하여 별도로 저장하는 것이 더 나은 대안이다. [client-go 자격증명 플러그인](/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins)을 참고한다.
{{< /caution >}}
```shell ```shell
kubectl config --kubeconfig=config-demo set-credentials developer --client-certificate=fake-cert-file --client-key=fake-key-seefile kubectl config --kubeconfig=config-demo set-credentials developer --client-certificate=fake-cert-file --client-key=fake-key-seefile
kubectl config --kubeconfig=config-demo set-credentials experimenter --username=exp --password=some-password kubectl config --kubeconfig=config-demo set-credentials experimenter --username=exp --password=some-password
@ -103,7 +108,7 @@ kubectl config --kubeconfig=config-demo set-credentials experimenter --username=
```shell ```shell
kubectl config --kubeconfig=config-demo set-context dev-frontend --cluster=development --namespace=frontend --user=developer kubectl config --kubeconfig=config-demo set-context dev-frontend --cluster=development --namespace=frontend --user=developer
kubectl config --kubeconfig=config-demo set-context dev-storage --cluster=development --namespace=storage --user=developer kubectl config --kubeconfig=config-demo set-context dev-storage --cluster=development --namespace=storage --user=developer
kubectl config --kubeconfig=config-demo set-context exp-scratch --cluster=scratch --namespace=default --user=experimenter kubectl config --kubeconfig=config-demo set-context exp-test --cluster=test --namespace=default --user=experimenter
``` ```
`config-demo` 파일을 열어서 세부사항들이 추가되었는지 확인한다. `config-demo` 파일을 열어보는 `config-demo` 파일을 열어서 세부사항들이 추가되었는지 확인한다. `config-demo` 파일을 열어보는
@ -125,7 +130,7 @@ clusters:
- cluster: - cluster:
insecure-skip-tls-verify: true insecure-skip-tls-verify: true
server: https://5.6.7.8 server: https://5.6.7.8
name: scratch name: test
contexts: contexts:
- context: - context:
cluster: development cluster: development
@ -138,10 +143,10 @@ contexts:
user: developer user: developer
name: dev-storage name: dev-storage
- context: - context:
cluster: scratch cluster: test
namespace: default namespace: default
user: experimenter user: experimenter
name: exp-scratch name: exp-test
current-context: "" current-context: ""
kind: Config kind: Config
preferences: {} preferences: {}
@ -152,6 +157,11 @@ users:
client-key: fake-key-file client-key: fake-key-file
- name: experimenter - name: experimenter
user: user:
# 문서 참고 사항 (이 설명은 명령 출력의 일부가 아니다.)
# 쿠버네티스 클라이언트 구성에 암호를 저장하는 것은 위험하다.
# 자격 증명 플러그인을 사용하여
# 자격 증명을 별도로 저장하는 것이 더 나은 대안이다.
# 다음을 참고하자. https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins
password: some-password password: some-password
username: exp username: exp
``` ```
@ -210,19 +220,19 @@ users:
client-key: fake-key-file client-key: fake-key-file
``` ```
이제 당신이 잠시 scratch 클러스터에서 작업하려고 한다고 가정해보자. 이제 당신이 잠시 test 클러스터에서 작업하려고 한다고 가정해보자.
현재 컨텍스트를 `exp-scratch`로 변경한다. 현재 컨텍스트를 `exp-test`로 변경한다.
```shell ```shell
kubectl config --kubeconfig=config-demo use-context exp-scratch kubectl config --kubeconfig=config-demo use-context exp-test
``` ```
이제 당신이 실행하는 모든 `kubectl` 커맨드는 `scratch` 클러스터의 이제 당신이 실행하는 모든 `kubectl` 커맨드는 `test` 클러스터의
default 네임스페이스에 적용되며 `exp-scratch` 컨텍스트에 나열된 default 네임스페이스에 적용되며 `exp-test` 컨텍스트에 나열된
사용자의 자격증명을 사용할 것이다. 사용자의 자격증명을 사용할 것이다.
현재의 컨텍스트인 `exp-scratch`에 관련된 설정을 보자. 현재의 컨텍스트인 `exp-test`에 관련된 설정을 보자.
```shell ```shell
kubectl config --kubeconfig=config-demo view --minify kubectl config --kubeconfig=config-demo view --minify
@ -328,10 +338,10 @@ contexts:
user: developer user: developer
name: dev-storage name: dev-storage
- context: - context:
cluster: scratch cluster: test
namespace: default namespace: default
user: experimenter user: experimenter
name: exp-scratch name: exp-test
``` ```
kubeconfig 파일들을 어떻게 병합하는지에 대한 상세정보는 kubeconfig 파일들을 어떻게 병합하는지에 대한 상세정보는
@ -388,6 +398,17 @@ export KUBECONFIG="$KUBECONFIG_SAVED"
$Env:KUBECONFIG=$ENV:KUBECONFIG_SAVED $Env:KUBECONFIG=$ENV:KUBECONFIG_SAVED
``` ```
## kubeconfig에 의해 표시된 제목을 확인하기
클러스터 인증 후 어떤 속성(사용자 이름, 그룹)을 얻을 수 있는지 항상 명확하지는 않다.
동시에 두 개 이상의 클러스터를 관리하는 경우 훨씬 더 어려울 수 있다.
선택되어 있는 쿠버네티스 컨텍스트의 사용자 이름 등에 대한,
주체 속성을 확인하기 위한 'kubectl' 알파 하위 명령 `kubectl alpha auth whoami`이 있다.
더 자세한 내용은 [클라이언트의 인증 정보에 대한 API 액세스](/docs/reference/access-authn-authz/authentication/#self-subject-review)
를 확인한다.
## {{% heading "whatsnext" %}} ## {{% heading "whatsnext" %}}
* [kubeconfig 파일을 사용하여 클러스터 접근 구성하기](/ko/docs/concepts/configuration/organize-cluster-access-kubeconfig/) * [kubeconfig 파일을 사용하여 클러스터 접근 구성하기](/ko/docs/concepts/configuration/organize-cluster-access-kubeconfig/)

View File

@ -198,6 +198,6 @@ spec:
## {{% heading "whatsnext" %}} ## {{% heading "whatsnext" %}}
* [서비스와 애플리케이션 연결하기](/ko/docs/tutorials/services/connect-applications-service/) 튜토리얼을 따라하기
* [서비스](/ko/docs/concepts/services-networking/service/)에 대해 알아보기 * [서비스](/ko/docs/concepts/services-networking/service/)에 대해 알아보기
* [인그레스](/ko/docs/concepts/services-networking/ingress/)에 대해 알아보기 * [인그레스](/ko/docs/concepts/services-networking/ingress/)에 대해 알아보기
* [서비스와 애플리케이션 연결하기](/ko/docs/concepts/services-networking/connect-applications-service/) 알아보기

View File

@ -38,19 +38,6 @@ tr -s '[[:space:]]' '\n' |\
sort |\ sort |\
uniq -c uniq -c
``` ```
이 커맨드는 결과값으로 나온 모든 아이템 중에 `image` 라고 명명된 필드를
모두 출력한다.
이와 다른 방법으로 파드 이미지 필드 값의 절대 경로를 사용할 수 있다.
이것은 필드명이 반복될 때에도
정확한 값을 출력하도록 보장한다.
예) 결과값 중에 많은 필드들이 `name`으로 명명되었을 경우,
```shell
kubectl get pods --all-namespaces -o jsonpath="{.items[*].spec.containers[*].image}"
```
이 jsonpath는 다음과 같이 해석할 수 있다. 이 jsonpath는 다음과 같이 해석할 수 있다.
- `.items[*]`: 각 결과값에 대하여 - `.items[*]`: 각 결과값에 대하여

View File

@ -10,26 +10,15 @@ weight: 60
위해 사용하는 쿠버네티스 서비스 오브젝트를 생성하는 방법을 설명한다. 서비스는 위해 사용하는 쿠버네티스 서비스 오브젝트를 생성하는 방법을 설명한다. 서비스는
실행 중인 두 개의 인스턴스를 갖는 애플리케이션에 대한 로드 밸런싱을 제공한다. 실행 중인 두 개의 인스턴스를 갖는 애플리케이션에 대한 로드 밸런싱을 제공한다.
## {{% heading "prerequisites" %}} ## {{% heading "prerequisites" %}}
{{< include "task-tutorial-prereqs.md" >}}
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
## {{% heading "objectives" %}} ## {{% heading "objectives" %}}
- Hello World 애플리케이션 인스턴스 두 개를 실행한다.
* Hello World 애플리케이션 인스턴스 두 개를 실행한다. - 노드 포트를 노출하는 서비스 오브젝트를 생성한다.
* 노드 포트를 노출하는 서비스 오브젝트를 생성한다. - 실행 중인 애플리케이션에 접근하기 위해 서비스 오브젝트를 사용한다.
* 실행 중인 애플리케이션에 접근하기 위해 서비스 오브젝트를 사용한다.
<!-- lessoncontent --> <!-- lessoncontent -->
@ -41,9 +30,11 @@ weight: 60
1. 클러스터 내 Hello World 애플리케이션을 실행하자. 1. 클러스터 내 Hello World 애플리케이션을 실행하자.
위 파일을 사용하여 애플리케이션 디플로이먼트를 생성하자. 위 파일을 사용하여 애플리케이션 디플로이먼트를 생성하자.
```shell ```shell
kubectl apply -f https://k8s.io/examples/service/access/hello-application.yaml kubectl apply -f https://k8s.io/examples/service/access/hello-application.yaml
``` ```
앞의 명령은 앞의 명령은
{{< glossary_tooltip text="디플로이먼트" term_id="deployment" >}} {{< glossary_tooltip text="디플로이먼트" term_id="deployment" >}}
오브젝트와 연관된 오브젝트와 연관된
@ -52,29 +43,34 @@ weight: 60
{{< glossary_tooltip text="파드" term_id="pod" >}}를 갖고, {{< glossary_tooltip text="파드" term_id="pod" >}}를 갖고,
각각은 Hello World 애플리케이션을 실행한다. 각각은 Hello World 애플리케이션을 실행한다.
1. 디플로이먼트에 대한 정보를 보여준다. 1. 디플로이먼트에 대한 정보를 보여준다.
```shell ```shell
kubectl get deployments hello-world kubectl get deployments hello-world
kubectl describe deployments hello-world kubectl describe deployments hello-world
``` ```
1. 레플리카셋 오브젝트에 대한 정보를 보여준다. 1. 레플리카셋 오브젝트에 대한 정보를 보여준다.
```shell ```shell
kubectl get replicasets kubectl get replicasets
kubectl describe replicasets kubectl describe replicasets
``` ```
1. 디플로이먼트를 노출하는 서비스 오브젝트를 생성한다. 1. 디플로이먼트를 노출하는 서비스 오브젝트를 생성한다.
```shell ```shell
kubectl expose deployment hello-world --type=NodePort --name=example-service kubectl expose deployment hello-world --type=NodePort --name=example-service
``` ```
1. 서비스에 대한 정보를 보여준다. 1. 서비스에 대한 정보를 보여준다.
```shell ```shell
kubectl describe services example-service kubectl describe services example-service
``` ```
결과는 아래와 같다. 결과는 아래와 같다.
```shell ```shell
Name: example-service Name: example-service
Namespace: default Namespace: default
@ -90,19 +86,24 @@ weight: 60
Session Affinity: None Session Affinity: None
Events: <none> Events: <none>
``` ```
서비스의 노드포트(NodePort) 값을 메모하자. 예를 들어, 서비스의 노드포트(NodePort) 값을 메모하자. 예를 들어,
앞선 결과에서, 노드포트 값은 31496이다. 앞선 결과에서, 노드포트 값은 31496이다.
1. Hello World 애플리케이션이 실행 중인 파드를 나열한다. 1. Hello World 애플리케이션이 실행 중인 파드를 나열한다.
```shell ```shell
kubectl get pods --selector="run=load-balancer-example" --output=wide kubectl get pods --selector="run=load-balancer-example" --output=wide
``` ```
결과는 아래와 같다. 결과는 아래와 같다.
```shell ```shell
NAME READY STATUS ... IP NODE NAME READY STATUS ... IP NODE
hello-world-2895499144-bsbk5 1/1 Running ... 10.200.1.4 worker1 hello-world-2895499144-bsbk5 1/1 Running ... 10.200.1.4 worker1
hello-world-2895499144-m1pwt 1/1 Running ... 10.200.2.5 worker2 hello-world-2895499144-m1pwt 1/1 Running ... 10.200.2.5 worker2
``` ```
1. Hello World 파드가 실행 중인 노드들 중 하나의 노드에 대해 공용 1. Hello World 파드가 실행 중인 노드들 중 하나의 노드에 대해 공용
IP 주소를 얻자. 이 주소를 얻는 방법은 어떻게 클러스터를 설치했는지에 IP 주소를 얻자. 이 주소를 얻는 방법은 어떻게 클러스터를 설치했는지에
따라 다르다. 예를 들어, Minikube를 사용하면, `kubectl cluster-info` 따라 다르다. 예를 들어, Minikube를 사용하면, `kubectl cluster-info`
@ -117,12 +118,15 @@ weight: 60
클라우드 공급자는 방화벽 규칙을 설정하는 다른 방법을 제공한다. 클라우드 공급자는 방화벽 규칙을 설정하는 다른 방법을 제공한다.
1. Hello World 애플리케이션 접근을 위해 노드 주소와 노드 포트를 사용하자. 1. Hello World 애플리케이션 접근을 위해 노드 주소와 노드 포트를 사용하자.
```shell ```shell
curl http://<public-node-ip>:<node-port> curl http://<public-node-ip>:<node-port>
``` ```
`<public-node-ip>`는 노드의 공용 IP 주소이고, `<public-node-ip>`는 노드의 공용 IP 주소이고,
`<node-port>`는 서비스의 노드포트 값이다. `<node-port>`는 서비스의 노드포트 값이다.
성공적인 요청에 대한 응답은 hello 메시지이다. 성공적인 요청에 대한 응답은 hello 메시지이다.
```shell ```shell
Hello Kubernetes! Hello Kubernetes!
``` ```
@ -133,12 +137,8 @@ weight: 60
[서비스 설정 파일](/ko/docs/concepts/services-networking/service/)을 사용해 [서비스 설정 파일](/ko/docs/concepts/services-networking/service/)을 사용해
서비스를 생성할 수 있다. 서비스를 생성할 수 있다.
## {{% heading "cleanup" %}} ## {{% heading "cleanup" %}}
서비스를 삭제하기 위해 다음 명령어를 입력하자. 서비스를 삭제하기 위해 다음 명령어를 입력하자.
kubectl delete services example-service kubectl delete services example-service
@ -148,11 +148,8 @@ weight: 60
kubectl delete deployment hello-world kubectl delete deployment hello-world
## {{% heading "whatsnext" %}} ## {{% heading "whatsnext" %}}
튜토리얼
[서비스와 애플리케이션 연결하기](/ko/docs/concepts/services-networking/connect-applications-service/) [서비스와 애플리케이션 연결하기](/ko/docs/tutorials/services/connect-applications-service/)
대해 더 알아본다. 따라하기

View File

@ -1,6 +1,7 @@
--- ---
title: 쿠버네티스 API를 사용하여 클러스터에 접근하기 title: 쿠버네티스 API를 사용하여 클러스터에 접근하기
content_type: task content_type: task
weight: 60
--- ---
<!-- overview --> <!-- overview -->

View File

@ -1,12 +1,12 @@
--- ---
title: 인증서 title: 인증서
content_type: task content_type: task
weight: 20 weight: 30
--- ---
<!-- overview --> <!-- overview -->
클라이언트 인증서로 인증을 사용하는 경우 `easyrsa`, `openssl` 또는 `cfssl` 클라이언트 인증서로 인증을 사용하는 경우 [`easyrsa`](https://github.com/OpenVPN/easy-rsa), [`openssl`](https://github.com/openssl/openssl) 또는 [`cfssl`](https://github.com/cloudflare/cfssl)
을 통해 인증서를 수동으로 생성할 수 있다. 을 통해 인증서를 수동으로 생성할 수 있다.
<!-- body --> <!-- body -->
@ -18,7 +18,7 @@ weight: 20
1. `easyrsa3`의 패치 버전을 다운로드하여 압축을 풀고, 초기화한다. 1. `easyrsa3`의 패치 버전을 다운로드하여 압축을 풀고, 초기화한다.
```shell ```shell
curl -LO https://storage.googleapis.com/kubernetes-release/easy-rsa/easy-rsa.tar.gz curl -LO https://dl.k8s.io/easy-rsa/easy-rsa.tar.gz
tar xzf easy-rsa.tar.gz tar xzf easy-rsa.tar.gz
cd easy-rsa-master/easyrsa3 cd easy-rsa-master/easyrsa3
./easyrsa init-pki ./easyrsa init-pki
@ -140,7 +140,7 @@ weight: 20
```shell ```shell
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key \ openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key \
-CAcreateserial -out server.crt -days 10000 \ -CAcreateserial -out server.crt -days 10000 \
-extensions v3_ext -extfile csr.conf -extensions v3_ext -extfile csr.conf -sha256
``` ```
1. 인증서 서명 요청을 확인한다. 1. 인증서 서명 요청을 확인한다.