Forth Korean l10n work for release-1.19
- Fix ko glossary managed service title (#24621) - Translate reference/glossary/service-broker.md in Korean (#24632) - Translate reference/command-line-tools-reference/kubelet-authentication-authorization.md into korean (#24623) - Update outdated files in the dev-1.19-ko.4 branch (#24622) - Translate setup/production-environment/tools/kubeadm/self-hosting/ into Korean (#24655) - Translate reference/kubectl/kubectl.md into Korean (#24482) - docs: fix typo (#24713) - Translate connecting-frontend-backend to Korean (#24422) - Translate reference/kubectl/conventions.md into Korean (#24614) - Translate k8s 1.19 relaese note in korean (#24633) Co-authored-by: seokho-son <shsongist@gmail.com> Co-authored-by: santachopa <santachopa@naver.com> Co-authored-by: kosehy@gmail.com <kosehy@gmail.com> Co-authored-by: Jerry Park <jaehwa@gmail.com> Co-authored-by: markruler <csu0414@gmail.com> Co-authored-by: noel <neutiyoo@gmail.com> Co-authored-by: coolguyhong <podolsmith@naver.com> Co-authored-by: chhanz <han0495@gmail.com> Co-authored-by: bluefriday <bluefriday86@gmail.com>
This commit is contained in:
@@ -0,0 +1,212 @@
|
||||
---
|
||||
title: 서비스를 사용하여 프론트엔드를 백엔드에 연결
|
||||
content_type: tutorial
|
||||
weight: 70
|
||||
---
|
||||
|
||||
<!-- overview -->
|
||||
|
||||
이 작업은 프론트엔드와 마이크로서비스 백엔드를 어떻게 생성하는지를
|
||||
설명한다. 백엔드 마이크로서비스는 인사하기(hello greeter)이다.
|
||||
프론트엔드와 백엔드는 쿠버네티스 {{< glossary_tooltip term_id="service" text="서비스" >}}
|
||||
오브젝트를 이용해 연결되어 있다.
|
||||
|
||||
## {{% heading "objectives" %}}
|
||||
|
||||
* {{< glossary_tooltip term_id="deployment" text="디플로이먼트(Deployment)" >}} 오브젝트를 사용해 마이크로서비스를 생성하고 실행한다.
|
||||
* 프론트엔드를 사용하여 백엔드로 트래픽을 전달한다.
|
||||
* 프론트엔드 애플리케이션을 백엔드 애플리케이션에 연결하기 위해
|
||||
서비스 오브젝트를 사용한다.
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
|
||||
|
||||
이 작업은
|
||||
지원되는 환경이 필요한
|
||||
[외부 로드밸런서가 있는 서비스](/docs/tasks/access-application-cluster/create-external-load-balancer/)를 사용한다. 만약, 이를 지원하지 않는 환경이라면, [노드포트](/ko/docs/concepts/services-networking/service/#nodeport) 서비스 타입을
|
||||
대신 사용할 수 있다.
|
||||
|
||||
<!-- lessoncontent -->
|
||||
|
||||
## 디플로이먼트를 사용해 백엔드 생성하기
|
||||
|
||||
백엔드는 인사하기라는 간단한 마이크로서비스이다. 여기에 백엔드 디플로이먼트
|
||||
구성 파일이 있다.
|
||||
|
||||
{{< codenew file="service/access/hello.yaml" >}}
|
||||
|
||||
백엔드 디플로이먼트를 생성한다.
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/service/access/hello.yaml
|
||||
```
|
||||
|
||||
백엔드 디플로이먼트에 관한 정보를 본다.
|
||||
|
||||
```shell
|
||||
kubectl describe deployment hello
|
||||
```
|
||||
|
||||
결과는 아래와 같다.
|
||||
|
||||
```
|
||||
Name: hello
|
||||
Namespace: default
|
||||
CreationTimestamp: Mon, 24 Oct 2016 14:21:02 -0700
|
||||
Labels: app=hello
|
||||
tier=backend
|
||||
track=stable
|
||||
Annotations: deployment.kubernetes.io/revision=1
|
||||
Selector: app=hello,tier=backend,track=stable
|
||||
Replicas: 7 desired | 7 updated | 7 total | 7 available | 0 unavailable
|
||||
StrategyType: RollingUpdate
|
||||
MinReadySeconds: 0
|
||||
RollingUpdateStrategy: 1 max unavailable, 1 max surge
|
||||
Pod Template:
|
||||
Labels: app=hello
|
||||
tier=backend
|
||||
track=stable
|
||||
Containers:
|
||||
hello:
|
||||
Image: "gcr.io/google-samples/hello-go-gke:1.0"
|
||||
Port: 80/TCP
|
||||
Environment: <none>
|
||||
Mounts: <none>
|
||||
Volumes: <none>
|
||||
Conditions:
|
||||
Type Status Reason
|
||||
---- ------ ------
|
||||
Available True MinimumReplicasAvailable
|
||||
Progressing True NewReplicaSetAvailable
|
||||
OldReplicaSets: <none>
|
||||
NewReplicaSet: hello-3621623197 (7/7 replicas created)
|
||||
Events:
|
||||
...
|
||||
```
|
||||
|
||||
## 백엔드 서비스 오브젝트 생성하기
|
||||
|
||||
프론트엔드와 백엔드를 연결하는 방법은 백엔드
|
||||
서비스이다. 서비스는 백엔드 마이크로서비스에 언제든 도달하기 위해
|
||||
변하지 않는 IP 주소와 DNS 이름 항목을 생성한다. 서비스는
|
||||
트래픽을 보내는 파드를 찾기 위해
|
||||
{{< glossary_tooltip text="selectors" term_id="selector" text="셀렉터" >}}를 사용한다.
|
||||
|
||||
먼저, 서비스 구성 파일을 살펴보자.
|
||||
|
||||
{{< codenew file="service/access/hello-service.yaml" >}}
|
||||
|
||||
구성 파일에서 서비스가 `app: hello` 과 `tier: backend` 레이블을 갖는
|
||||
파드에 트래픽을 보내는 것을 볼 수 있다.
|
||||
|
||||
`hello` 서비스를 생성한다.
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/service/access/hello-service.yaml
|
||||
```
|
||||
|
||||
이 시점에서, 백엔드 디플로이먼트는 Running 중이며, 해당 백엔드로
|
||||
트래픽을 보내는 서비스를 갖고 있다.
|
||||
|
||||
## 프론트엔드 생성하기
|
||||
|
||||
이제 백엔드가 있기 때문에 백엔드와 연결하는 프론트엔드를 생성할 수 있다.
|
||||
프론트엔드는 백엔드 서비스에서 제공된 DNS 이름을 사용해 백엔드 워커
|
||||
파드에 연결할 수 있다. DNS 이름은 "hello" 이고, 앞선
|
||||
서비스 구성 파일의 `name` 항목의 값이다.
|
||||
|
||||
프론트엔드 디플로이먼트 안에 파드는 hello 백엔드 서비스를 찾도록
|
||||
구성된 nginx 이미지를 실행한다. 여기에 nginx 구성 파일이 있다.
|
||||
|
||||
{{< codenew file="service/access/frontend.conf" >}}
|
||||
|
||||
백엔드와 같이, 프론트엔드는 디플로이먼트와 서비스를 갖고 있다.
|
||||
서비스의 구성은 `type: LoadBalancer` 이며, 이는 서비스가
|
||||
클라우드 공급자의 기본 로드 밸런서를 사용하는 것을 의미한다.
|
||||
|
||||
{{< codenew file="service/access/frontend.yaml" >}}
|
||||
|
||||
프론트엔드 디플로이먼트와 서비스를 생성한다.
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/service/access/frontend.yaml
|
||||
```
|
||||
|
||||
결과는 두 리소스가 생성되었음을 확인한다.
|
||||
|
||||
```
|
||||
deployment.apps/frontend created
|
||||
service/frontend created
|
||||
```
|
||||
|
||||
{{< note >}}
|
||||
nginx 구성은 [컨테이너 이미지](/examples/service/access/Dockerfile)에
|
||||
반영 되었다. 이를 실행하는 더 좋은 방법은
|
||||
구성을
|
||||
보다 쉽게 변경할
|
||||
수 있는 [컨피그맵(ConfigMap)](/docs/tasks/configure-pod-container/configure-pod-configmap/)을 사용하는 것이다.
|
||||
{{< /note >}}
|
||||
|
||||
## 프론트엔드 서비스와 통신하기
|
||||
|
||||
일단 로드밸런서 타입의 서비스를 생성하면, 이 명령어를
|
||||
사용해 외부 IP를 찾을 수 있다.
|
||||
|
||||
```shell
|
||||
kubectl get service frontend --watch
|
||||
```
|
||||
|
||||
`frontend` 서비스의 구성을 보여주고, 변경 사항을
|
||||
주시한다. 처음에, 외부 IP는 `<pending>` 으로 나열된다.
|
||||
|
||||
```
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
frontend LoadBalancer 10.51.252.116 <pending> 80/TCP 10s
|
||||
```
|
||||
|
||||
하지만, 외부 IP가 생성되자마자 구성은
|
||||
`EXTERNAL-IP` 제목 아래에 새로운 IP를 포함하여 갱신한다.
|
||||
|
||||
```
|
||||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
||||
frontend LoadBalancer 10.51.252.116 XXX.XXX.XXX.XXX 80/TCP 1m
|
||||
```
|
||||
|
||||
이제 해당 IP는 클러스터 외부에서 `frontend` 서비스와 통신하는데
|
||||
사용된다.
|
||||
|
||||
## 프론트엔드 통해서 트래픽 보내기
|
||||
|
||||
이제 프론트엔드와 백엔드가 연결되었다. 프론트엔드 서비스의 외부 IP에서
|
||||
curl 명령을 사용해 엔드포인트에 도달할 수 있다.
|
||||
|
||||
```shell
|
||||
curl http://${EXTERNAL_IP} # 앞의 예에서 본 EXTERNAL-IP로 수정한다
|
||||
```
|
||||
|
||||
결과로 백엔드에서 생성된 메시지가 보인다.
|
||||
|
||||
```json
|
||||
{"message":"Hello"}
|
||||
```
|
||||
|
||||
## {{% heading "cleanup" %}}
|
||||
|
||||
서비스를 삭제하기 위해, 아래 명령어를 입력하자.
|
||||
|
||||
```shell
|
||||
kubectl delete services frontend hello
|
||||
```
|
||||
|
||||
백엔드와 프론트엔드 애플리케이션에서 실행 중인 디플로이먼트, 레플리카셋, 파드를 삭제하기 위해, 아래 명령어를 입력하자.
|
||||
|
||||
```shell
|
||||
kubectl delete deployment frontend hello
|
||||
```
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
* [서비스](/ko/docs/concepts/services-networking/service/)에 대해 더 알아본다.
|
||||
* [컨피그맵](/docs/tasks/configure-pod-container/configure-pod-configmap/)에 대해 더 알아본다.
|
||||
|
||||
+3
-7
@@ -7,7 +7,7 @@ min-kubernetes-server-version: v1.10
|
||||
|
||||
<!-- overview -->
|
||||
|
||||
이 페이지는 `kubectl port-forward` 를 사용해서 쿠버네티스 클러스터 내에서
|
||||
이 페이지는 `kubectl port-forward` 를 사용해서 쿠버네티스 클러스터 내에서
|
||||
실행중인 Redis 서버에 연결하는 방법을 보여준다. 이 유형의 연결은 데이터베이스
|
||||
디버깅에 유용할 수 있다.
|
||||
|
||||
@@ -29,7 +29,7 @@ min-kubernetes-server-version: v1.10
|
||||
## Redis 디플로이먼트와 서비스 생성하기
|
||||
|
||||
1. Redis를 실행하기 위해 디플로이먼트를 생성한다.
|
||||
|
||||
|
||||
```shell
|
||||
kubectl apply -f https://k8s.io/examples/application/guestbook/redis-master-deployment.yaml
|
||||
```
|
||||
@@ -151,7 +151,7 @@ min-kubernetes-server-version: v1.10
|
||||
또는 다음과 같다.
|
||||
|
||||
```shell
|
||||
kubectl port-forward svc/redis-master 7000:6379
|
||||
kubectl port-forward service/redis-master 7000:redis
|
||||
```
|
||||
|
||||
위의 명령어들은 모두 동일하게 동작한다. 이와 유사하게 출력된다.
|
||||
@@ -203,7 +203,3 @@ UDP 프로토콜에 대한 지원은
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
[kubectl port-forward](/docs/reference/generated/kubectl/kubectl-commands/#port-forward)에 대해 더 알아본다.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ Kubeconfig 인증 방법은 외부 아이덴티티 프로파이더 또는 x509
|
||||
만약 이름을 10이라는 숫자로 세팅한다면, 파드는 기본 네임스페이스로 배정하게 될 것이다.
|
||||
|
||||
네임스페이스 생성이 성공하는 경우, 생성된 네임스페이스가 기본으로 선택된다.
|
||||
만약 생성에 실패하면, 첫번째 네임스페이스가 선택된다.
|
||||
만약 생성에 실패하면, 첫 번째 네임스페이스가 선택된다.
|
||||
|
||||
- **이미지 풀(Pull) 시크릿**:
|
||||
특정 도커 컨테이너 이미지가 프라이빗한 경우,
|
||||
|
||||
Reference in New Issue
Block a user