Leanpub Header

Skip to main content

모두를 위한 쿠버네티스

처음부터 데이터센터 만들기

모두를 위한 쿠버네티스

대부분의 쿠버네티스 책은 YAML을 가르칩니다. 이 책은 데이터센터를 만드는 법을 가르칩니다. #!/usr/bin/env bash로 시작해, 완전한 멀티 서비스 클러스터를 프로비저닝하고 다시 불러오고 해체하는 명령 하나로 끝냅니다. 마법도 블랙박스도 없습니다.

This book is a translation into Korean of Kubernetes for All which was originally written in English

Minimum price

$19.00

$29.00

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
EPUB
WEB
APP
About

About

About the Book

개발자 경험은 곧 인프라입니다. 매일 배포하는 팀과 배포를 두려워하는 팀의 차이는 재능이 아니라 도구인 경우가 대부분입니다. 빠른 피드백 루프, 불변 배포, 자가 치유 클러스터, 관측 가능한 시스템.

대부분의 쿠버네티스 튜토리얼은 kubectl apply에서 끝납니다. 부족한 것은 이를 하나로 묶는 시스템입니다. 몇 초 만에 클러스터를 만들고, 이미지를 다시 빌드하고, 연결을 끊지 않고 서비스를 다시 불러오고, 무엇이 잘못됐는지 정확히 알려주는 반복 가능한 워크플로입니다.

『모두를 위한 쿠버네티스』는 완전한 클라우드 네이티브 플랫폼을 직접 만들면서 쿠버네티스를 기초부터 가르칩니다. Bash 스크립트 하나로 멀티 노드 환경을 구축하고, 애플리케이션 배포, 운영 자동화, GitOps, Prometheus와 Grafana 기반 관측성, OpenTelemetry 분산 추적까지 구현합니다.

Kind, Helm, Pod, Deployment, Service, Ingress, ConfigMap, Secret, 영구 볼륨, StatefulSet, 쿠버네티스 API를 다룹니다. 마지막에는 datacenter.sh가 16개의 마이크로서비스, PostgreSQL, KRaft 모드의 Kafka, 웹 프런트엔드를 배포합니다.

이해하고, 수정하고, 신뢰할 수 있는 쿠버네티스 도구를 원하는 엔지니어를 위한 책입니다. 쿠버네티스 경험은 필요 없습니다. Docker, Kind, 터미널, 그리고 진짜를 만들고 싶은 마음이면 충분합니다.

Share this book

This book is a translation into Korean of Kubernetes for All which was originally written in English

Author

About the Author

Joel Bryan Juliano

Hi, I'm Joel.

I am Dutch-Filipino Software Engineer with 20+ years of experience.

And with over 20 years in the game, I’ve seen it all and loved every minute of it.

My journey has taken me through a variety of industries, from sports streaming to cybersecurity, both in the private sector and for the Dutch government, and everything in between.

Along the way, I’ve picked up a diverse set of skills and experiences, in which I document into books.

Translations

Translations

Contents

Table of Contents

서론: Bash로 Kubernetes 접착하기

  1. 사전 요구사항
  2. 왜 Bash인가
  3. 우리가 구축할 것
  4. 이 책의 구성
  5. 진입점: setup.sh
  6. datacenter.sh 시작하기
  7. 실습

안전 설정, 초기화 및 생명주기 훅

  1. 전역 Set 옵션
  2. 셸 스크립트 린팅: shellcheck
  3. 스크립트 초기화
  4. 메인 컨트롤러
  5. 오류 핸들러
  6. 종료 핸들러
  7. 모두 합치기
  8. 실습 문제

종료 코드와 제어된 종료

  1. script_exit 함수
  2. 종료 코드 규약
  3. Bash 안전 패턴 복습
  4. 업데이트된 스크립트
  5. 실습

Cron 모드와 IO 리디렉션

  1. Cron 모드가 하는 일
  2. 파일 디스크립터
  3. Cron 모드를 위한 리디렉션
  4. 오류 핸들러 업데이트
  5. 종료 핸들러 업데이트
  6. main에 cron_init 등록
  7. 업데이트된 스크립트
  8. 실습

라이브러리 패턴: Bash 코드베이스 구성

  1. lib/ 디렉토리
  2. main에서 라이브러리 로딩
  3. 라이브러리 파일 작성
  4. 명명 규칙
  5. 의존성 그래프
  6. 지금 알아두면 좋은 두 가지 유틸리티 라이브러리
  7. 실습 문제

터미널 색상과 로깅

  1. 로깅 라이브러리
  2. 색상 초기화
  3. log 함수
  4. verbose_print — 상세 모드 출력
  5. init 업데이트
  6. main 업데이트
  7. 오류 핸들러 업데이트
  8. 실습

검증 헬퍼와 바이너리 체크

  1. lib/script.sh
  2. check_binary — 필수 도구 감지
  3. check_required_binaries — 시스템 사전 조건
  4. is_kind — 모드 감지
  5. check_arguments — 변수 존재 검증
  6. check_directories — 경로 검증
  7. check_files — 파일 존재 검증
  8. check_repos — 리포지토리 존재 가드
  9. build_path — PATH 구축
  10. init 체인에서 헬퍼 사용
  11. 실습 문제

구성 관리

  1. 구성 파일
  2. lib/config.sh
  3. get_configurations — 대화형 설정
  4. main에서 구성 읽기
  5. Docker 네트워크 모드
  6. 실습 문제

스크립트 잠금: 동시 실행 방지

  1. 왜 파일이 아닌 디렉토리인가
  2. lock_init
  3. 오래된 잠금 처리
  4. 실습

완전한 매개변수 파싱

  1. parse_params
  2. script_usage — 도움말 텍스트
  3. parse_params를 main에 연결
  4. 실습 문제

로컬 모드와 Kind 클러스터 관리

  1. 왜 Kind인가
  2. lib/kind.sh
  3. start_env — Kind 클러스터 생성
  4. stop_env — 클러스터 중지
  5. delete_env — 클러스터 삭제
  6. Kind에 이미지 로드
  7. Docker 환경 전환 불필요
  8. 실습 문제

Docker 작업

  1. lib/docker.sh
  2. safe_docker — 기본 래퍼
  3. safe_docker_build — 이미지 빌드
  4. safe_docker_run — 컨테이너 실행
  5. Kind에 이미지 로드
  6. Docker Compose 작업
  7. docker_cleanup — 중단된 컨테이너 및 이미지 제거
  8. 실습 문제

kubectl로 Kubernetes 관리

  1. lib/kubectl.sh
  2. safe_kubectl — 기본 래퍼
  3. kubectl_install_resource_from_file
  4. kubectl_install_database — PostgreSQL 설정
  5. kubectl_restart — 롤링 재시작
  6. DNS 관리
  7. 모든 Deployment 재시작
  8. 실습 문제

Helm: Kubernetes용 패키지 관리

  1. lib/helm.sh
  2. safe_helm — 기본 래퍼
  3. k8s/의 Helm 차트
  4. helm_install_service — 범용 서비스 설치기
  5. helm_install_core_service — 템플릿 기반 서비스
  6. 구성 릴리스 설치
  7. 업데이트 함수 — 제자리 업그레이드
  8. Traefik — Ingress 컨트롤러
  9. 실습 문제

서비스 빌드

  1. 빌드 파이프라인
  2. lib/build.sh
  3. build_service — 핵심 빌드 함수
  4. 서비스 그룹 함수
  5. build_images_init — 빌드 디스패처
  6. lib/install_deps.sh
  7. check_registry
  8. 실습 문제

제로부터 프로비저닝

  1. 시스템 아키텍처
  2. 완전한 프로비저닝 시퀀스
  3. 단계별 설명
  4. 지원 함수
  5. Kubernetes 클러스터 매개변수
  6. Kubernetes 매니페스트 참조
  7. 실습 문제
  8. 성공의 모습

리로드와 복구 작업

  1. lib/reload_services.sh
  2. reload_services — 경량 서비스 갱신
  3. reload_services_init — 리로드 디스패처
  4. lib/reload_kubernetes.sh
  5. reload_all_kubernetes — 전체 클러스터 재구축
  6. 실습 문제

해체와 정리

  1. 환경 중지
  2. 환경 삭제
  3. 완전한 Kubernetes 해체
  4. Docker 정리
  5. 종료 핸들러: 완전한 버전
  6. 전체 스크립트 종합
  7. 완전한 main() 함수
  8. 완전한 init 함수
  9. 완전한 생명주기
  10. 당신이 구축한 개발자 경험
  11. 실습 문제

ArgoCD를 사용한 GitOps

  1. lib/argocd.sh
  2. safe_argocd — 기본 래퍼
  3. helm_install_argocd — 컨트롤러 설치
  4. argocd_wait_ready — 시작 확인
  5. argocd_login — CLI 인증
  6. argocd_create_app — 애플리케이션 등록
  7. argocd_sync — 동기화 시작
  8. argocd_wait_healthy — 동기화 완료 대기
  9. argocd_delete_app — 애플리케이션 제거
  10. ArgoCD를 datacenter.sh에 통합
  11. OpenShift에 대한 참고
  12. 실습 문제

Prometheus와 Grafana를 사용한 메트릭과 대시보드

  1. lib/monitoring.sh
  2. helm_install_monitoring — 전체 스택
  3. monitoring_wait_ready — 시작 확인
  4. monitoring_port_forward — 로컬 접근
  5. monitoring_apply_servicemonitor — 서비스 스크랩
  6. monitoring_get_grafana_password — 자격 증명 조회
  7. 모니터링을 datacenter.sh에 통합
  8. kube-prometheus-stack이 제공하는 것
  9. 실습 문제

OpenTelemetry를 사용한 분산 트레이싱

  1. lib/otel.sh
  2. safe_otel — 기본 래퍼
  3. helm_install_otel_operator — Operator 설치
  4. otel_wait_ready — Operator 실행 확인
  5. otel_apply_collector — 컬렉터 배포
  6. otel_apply_instrumentation — 코드 변경 없는 자동 계측
  7. otel_wait_collector_ready — 컬렉터 확인
  8. Grafana Tempo — 트레이스 백엔드
  9. OTel을 datacenter.sh에 통합
  10. 트레이스, 메트릭, 로그를 잇기
  11. 실습 문제

부록: datacenter.sh 명령 참조

  1. setup.sh
  2. datacenter.sh
  3. 종료 코드
  4. 체인 가능 vs 비체인 가능 매개변수
  5. 일반 워크플로우
  6. 문제 해결

용어집

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub