[kubernetes] Deployment

문혜리·2022년 7월 18일
0

YAML descriptor

  • kind
  • label
  • replicas
  • selector
    • match expression
    • match labels
  • template
    • spec
      • container
        • image
        • ports

deployment 과정: description을 날리면 master node가 받아서 pod로 올림

deployment yaml 파일 예시 (a.k.a Yaml descriptor)

  • 종류는 deployment
  • 이름을 정하고
  • replicas는 pod를 3개 올리고 싶고
  • selector은 pod의 label을 이용해서 select하는 것이고
  • nginx라는 걸로 할 것이다

그리고 이걸가지고 kubectl create -f [yamlfile]

내부과정:

  • 쿠버네티스는 마이크로서비스이고, 철저하게 unix way -> 자기 할일만 하고 끝
  • pod가 deploy할때의 가장 작은 단위
  • pod안에 여러 컨테이너가 동작할 수 는 있지만 여러 이유로 하나에 하나를 띄우는게 가장 좋긴 함

0개의 댓글