본문 바로가기

전체 글61

Chapter 17. Best practices for developing apps 주요 내용 Kubernetes 리소스에 대한 전반적인 이해 Pod lifecycle hooks and init containers 17.1 Bringing everything together 일반적인 어플리케이션이 Kubernetes 위에서 배포될 때 어떤 형태로 하는지, 지금까지 살펴본 것들을 종합하여 알아본다. 일반적으로 어플리케이션을 배포할 때는 Deployment 또는 StatefulSet 을 반드시 사용하게 된다. 이들은 pod template 를 들고 있으며, 거기에는 liveness/readiness probe 가 모두 정의되어 있다. Service 를 이용해서 외부에서 pod 로 요청을 보낼 수 있도록 하고, 이 Service 는 LoadBalancer 또는 NodePort 타입이나 Ing.. 2021. 8. 15.
Chapter 16. Advanced scheduling 주요 내용 노드의 taint 와 pod tolerations Node affinity rules 사용 Pod affinity, anti-affinity 사용 16.1 Using taints and tolerations to repel pods from certain nodes Pod 가 특정 노드에 schedule 되기 위해서는 그 노드의 taint 를 tolerate 할 수 있어야 한다. 16.1.1 Introducing taints and tolerations Taint 는 key, value, effect 로 이루어져 있고, =: 로 표현된다. kubectl describe node [NODE_NAME] 을 해보면 Taints 항목에서 확인할 수 있다. 예를 들어 node-role.kubernete.. 2021. 8. 15.
Chapter 15. Automatic scaling of pods and cluster nodes 주요 내용 HPA 리소스 이해하고 사용하기 클러스터 노드의 automatic scaling 수동으로 scaling (수평) 을 하는 경우 ReplicationController, ReplicaSet, Deployment 등에서 replicas field 를 고쳐줘야 했다. 이번 장에서는 pod 나 노드의 상태에 따라 자동으로 scaling 하는 방법을 알아본다. 15.1 Horizontal pod autoscaling Horizontal pod autoscaling 은 Horizontal controller 가 pod 의 replica 수를 알아서 조절하는 것이다. 이 controller 는 HorizontalPodAutoscaler(HPA) 리소스를 생성하면 활성화 되며, 주기적으로 pod 의 metr.. 2021. 7. 18.
Chapter 14. Managing pods' computational resources 주요 내용 Pod requests/limits 설정, 동작 방식 및 scheduling 에 미치는 영향 Pod requests/limits 과 QoS class LimitRange resource, ResourceQuota object 각 pod 가 어느 정도의 자원(CPU/메모리)을 소모할지 파악하고, 이를 적절히 제한하는 것은 pod 정의에서 굉장히 중요한 부분이다. 14.1 Requesting resources for a pod's containers Pod 를 생성할 때 requests 와 limits 를 정할 수 있다. requests: 컨테이너가 필요로 하는 CPU와 메모리 양을 설정 limits: 컨테이너가 최대로 사용할 수 있는 CPU와 메모리를 설정 이는 각 컨테이너 별로 설정할 수 있으.. 2021. 7. 11.