Final Korean I10n work for release-1.13 (#13593)
* ko: Fix nav-menu sync in tutorials/statefulset #13374 (#13469) * ko: add outdated files in dev-1.13-ko.9 branch (#13464) Co-authored-by: Yoon <learder@gmail.com> Co-authored-by: Claudia J. Kang <claudiajkang@gmail.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
8d6823ba24
commit
240c0e7886
@@ -52,7 +52,9 @@ index.php는 CPU 과부하 연산을 수행한다.
|
||||
첫 번째 단계로, 실행 중인 이미지의 디플로이먼트를 시작하고 서비스로 노출시킨다.
|
||||
|
||||
```shell
|
||||
$ kubectl run php-apache --image=k8s.gcr.io/hpa-example --requests=cpu=200m --expose --port=80
|
||||
kubectl run php-apache --image=k8s.gcr.io/hpa-example --requests=cpu=200m --expose --port=80
|
||||
```
|
||||
```
|
||||
service/php-apache created
|
||||
deployment.apps/php-apache created
|
||||
```
|
||||
@@ -63,13 +65,18 @@ deployment.apps/php-apache created
|
||||
간단히 얘기하면, HPA는 (디플로이먼트를 통한) 평균 CPU 사용량을 50%로 유지하기 위하여 레플리카의 개수를 늘리고 줄인다. ([kubectl run](https://github.com/kubernetes/kubernetes/blob/{{< param "githubbranch" >}}/docs/user-guide/kubectl/kubectl_run.md)으로 각 파드는 200 밀리코어까지 요청할 수 있고, 따라서 여기서 말하는 평균 CPU 사용은 100 밀리코어를 말한다.) 이에 대한 자세한 알고리즘은 [여기](https://git.k8s.io/community/contributors/design-proposals/autoscaling/horizontal-pod-autoscaler.md#autoscaling-algorithm)를 참고하기 바란다.
|
||||
|
||||
```shell
|
||||
$ kubectl autoscale deployment php-apache --cpu-percent=50 --min=1 --max=10
|
||||
kubectl autoscale deployment php-apache --cpu-percent=50 --min=1 --max=10
|
||||
```
|
||||
```
|
||||
horizontalpodautoscaler.autoscaling/php-apache autoscaled
|
||||
```
|
||||
|
||||
실행 중인 오토스케일러의 현재 상태를 확인해본다.
|
||||
|
||||
```shell
|
||||
$ kubectl get hpa
|
||||
kubectl get hpa
|
||||
```
|
||||
```
|
||||
NAME REFERENCE TARGET MINPODS MAXPODS REPLICAS AGE
|
||||
php-apache Deployment/php-apache/scale 0% / 50% 1 10 1 18s
|
||||
|
||||
@@ -83,17 +90,19 @@ php-apache Deployment/php-apache/scale 0% / 50% 1 10 1
|
||||
|
||||
|
||||
```shell
|
||||
$ kubectl run -i --tty load-generator --image=busybox /bin/sh
|
||||
kubectl run -i --tty load-generator --image=busybox /bin/sh
|
||||
|
||||
Hit enter for command prompt
|
||||
|
||||
$ while true; do wget -q -O- http://php-apache.default.svc.cluster.local; done
|
||||
while true; do wget -q -O- http://php-apache.default.svc.cluster.local; done
|
||||
```
|
||||
|
||||
실행 후, 약 1분 정도 후에 CPU 부하가 올라가는 것을 볼 수 있다.
|
||||
|
||||
```shell
|
||||
$ kubectl get hpa
|
||||
kubectl get hpa
|
||||
```
|
||||
```
|
||||
NAME REFERENCE TARGET CURRENT MINPODS MAXPODS REPLICAS AGE
|
||||
php-apache Deployment/php-apache/scale 305% / 50% 305% 1 10 1 3m
|
||||
|
||||
@@ -102,7 +111,9 @@ php-apache Deployment/php-apache/scale 305% / 50% 305% 1 10
|
||||
CPU 소비가 305%까지 증가하였다. 결과적으로, 디플로이먼트의 레플리카 개수는 7개까지 증가하였다.
|
||||
|
||||
```shell
|
||||
$ kubectl get deployment php-apache
|
||||
kubectl get deployment php-apache
|
||||
```
|
||||
```
|
||||
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
|
||||
php-apache 7 7 7 7 19m
|
||||
```
|
||||
@@ -117,11 +128,17 @@ php-apache 7 7 7 7 19m
|
||||
`busybox` 컨테이너를 띄운 터미널에서, `<Ctrl> + C`로 부하 발생을 중단시킨다. 그런 다음 (몇 분 후에) 결과를 확인한다.
|
||||
|
||||
```shell
|
||||
$ kubectl get hpa
|
||||
kubectl get hpa
|
||||
```
|
||||
```
|
||||
NAME REFERENCE TARGET MINPODS MAXPODS REPLICAS AGE
|
||||
php-apache Deployment/php-apache/scale 0% / 50% 1 10 1 11m
|
||||
```
|
||||
|
||||
$ kubectl get deployment php-apache
|
||||
```shell
|
||||
kubectl get deployment php-apache
|
||||
```
|
||||
```
|
||||
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
|
||||
php-apache 1 1 1 1 27m
|
||||
```
|
||||
@@ -143,7 +160,7 @@ CPU 사용량은 0으로 떨어졌고, HPA는 레플리카의 개수를 1로 낮
|
||||
첫 번째로, `autoscaling/v2beta2` 형식으로 HorizontalPodAutoscaler YAML 파일을 생성한다.
|
||||
|
||||
```shell
|
||||
$ kubectl get hpa.v2beta2.autoscaling -o yaml > /tmp/hpa-v2.yaml
|
||||
kubectl get hpa.v2beta2.autoscaling -o yaml > /tmp/hpa-v2.yaml
|
||||
```
|
||||
|
||||
에디터로 `/tmp/hpa-v2.yaml` 파일을 열면, 다음과 같은 YAML을 확인할 수 있다.
|
||||
@@ -332,7 +349,9 @@ HorizontalPodAutoscaler의 `autoscaling/v2beta2` 형식을 사용하면, Horizon
|
||||
이 조건은 `status.conditions`에 나타난다. HorizontalPodAutoscaler에 영향을 주는 조건을 보기 위해 `kubectl describe hpa`를 사용할 수 있다.
|
||||
|
||||
```shell
|
||||
$ kubectl describe hpa cm-test
|
||||
kubectl describe hpa cm-test
|
||||
```
|
||||
```shell
|
||||
Name: cm-test
|
||||
Namespace: prom
|
||||
Labels: <none>
|
||||
@@ -370,7 +389,9 @@ HorizontalPodAutoscaler를 생성하기 위해 `kubectl autoscale` 명령어를
|
||||
다음 명령어를 실행하여 오토스케일러를 생성할 것이다.
|
||||
|
||||
```shell
|
||||
$ kubectl create -f https://k8s.io/examples/application/hpa/php-apache.yaml
|
||||
kubectl create -f https://k8s.io/examples/application/hpa/php-apache.yaml
|
||||
```
|
||||
```
|
||||
horizontalpodautoscaler.autoscaling/php-apache created
|
||||
```
|
||||
|
||||
|
||||
@@ -115,4 +115,19 @@ Windows에 Minikube를 수동으로 설치하려면, [`minikube-windows-amd64`](
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
## 새롭게 시작하기 위해 모두 정리하기
|
||||
|
||||
이전에 minikube를 설치한 적이 있다면, 실행한다.
|
||||
```shell
|
||||
minikube start
|
||||
```
|
||||
|
||||
이 커맨드는 에러를 리턴한다.
|
||||
```shell
|
||||
machine does not exist
|
||||
```
|
||||
|
||||
구성 파일을 삭제해야 한다.
|
||||
```shell
|
||||
rm -rf ~/.minikube
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user