Skip to Content
쿠버네티스를 활용한 클라우드 네이티브 데브옵스
book

쿠버네티스를 활용한 클라우드 네이티브 데브옵스

by 최경현, 저스틴 도밍거스, 존 어런들
December 2019
Beginner to intermediate
420 pages
8h 34m
Korean
Hanbit Media, Inc.
Content preview from 쿠버네티스를 활용한 클라우드 네이티브 데브옵스
111
4
쿠버네티스 오브젝트 다루기
kubectl
apply
-f
k8s/service.yaml
service "demo" created
kubectl
port-forward
service/demo
9999:8888
Forwarding from 127.0.0.1:9999 -> 8888
Forwarding from [::1]:9999 -> 8888
이전과 마찬가지로
kubectl
port
-
forward
demo
서비스를 로컬 컴퓨터의 포트로 연결하여
브라우저로
http
://
localhost
:
9999
접속할있게 한다.
모든 예제를 문제없이 잘 따라했다면 다음 절로 넘어가기 전에 다음 명령어를 실행하여 정리하
자.
kubectl
delete
-f
k8s/
TIP
앞서 했던 것처럼 레이블 셀렉터를 지정하고
kubectl
delete
명령어를 사용하여 셀렉터와 일치하는 모든
리소스를 삭제할 수 있다(‘
9
.
1
절 레이블’ 참조). 또는 여기서처럼
kubectl
delete
-
f
를 매니페스트 디렉터
리와 함께 사용할 수 있다. 매니페스트 파일에 지정된 모든 리소스는 삭제될 것이다.
연습 문제
k8s
/
deployment
.
yaml
파일을 수정하여 레플리카의 수를
3
으로 변경해보자.
kubectl
apply
를 사용하여 매니페스트를 다시 적용하고
kubectl
get ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

쿼커스 쿡북: 쿠버네티스를 위한 네이티브 자바 솔루션

쿼커스 쿡북: 쿠버네티스를 위한 네이티브 자바 솔루션

유동환, 알렉스 소토 부에노, 제이슨 포터

Publisher Resources

ISBN: 9791162248249