Kubernetes가 무엇이냐고 묻는다면

zihooy·2022년 7월 1일
3

Kubernetes에 대한 무성한 소문만 들어왔던 나.. 마음먹고 Kubernetes에 대해 공부하기로 했다!

🏹 Kubernetes란 무엇인가

사실 내가 설명하는 것 보다 공식 문서를 읽는게 빠르다. 이 글은 단지 내가 읽은 것을 (이해할 수 있는 범위에서, 간단히) 정리하고 복습하기 위한 용도이다.
한마디로 K8s는 최적화된 방법으로 컨테이너화된 애플리케이션을 배포하고 확장을 돕기 위한 오픈 소스 플랫폼이다.
공식 문서 링크: https://cloud.google.com/kubernetes-engine/docs/tutorials

🏹 Kubernetes의 Flow

  • application → dockerize → get image → run the image as a container
  • put container in a pod(unit of deployment in k8s)
  • to run application with high availability, use replication set
  • replication set 1) replication(scaling) 2) availability : replicas monitoring
  • to update the application (v1→v2), use deployment
  • deployment strategy 1) rolling update 2) recreate
  • to manage the traffic, use service
  • service acts like a load balancer → distributes the traffic
  • every services has ip and dns/name
  • service discovery: connection with first and second application(same end point)

🏹 Kubernetes Components부터 알아보자

다음의 강의를 참고하였다.
Docker and Kubernetes Tutorial for Beginners(15 / 33)
By TechWorld with Nana

Node and Pod

Node

  • node 안에 여러개의 pod이 존재한다.

Pod

  • K8s의 가장 작은 단위
  • container가 실행될 수 있도록 한다
  • 주로 1 pod에는 1 application
  • 1개의 pod은 각각 고유 IP address를 가진다.
  • 그러나 container가 crash되거나.. 기타 이유로 pod이 restart된다면 IP address가 변경된다.
  • 따라서 service가 필요하다.

Service and Ingress

Service

  • service란 고유 IP address
  • pod이 죽어도 service는 사라지지 않는다.
  • 공개(external) / 비공개(internal) 여부 설정 가능
  • 하지만, IP address로 브라우저에서 접근하는 것 보다 Domain 이름으로 접근하는 것이 요구된다.
  • 따라서 ingress가 필요하다.

Ingress

  • Service로 forwarding해주는 역할을 담당한다.

아래의 내용들은 언젠가 to be continued...

ConfigMap and Secret

Volumes

Deployment and StatefulSet

profile
thisIsZihooLog

0개의 댓글