본문 바로가기

Computer Science/Kubernetes18

Chapter 18. Extending Kubernetes 마지막 장이다! 끝! 주요 내용 Kubernetes 에 custom resource/controller/API server 추가하기 Kubernetes Service Catalog OpenShift, Deis Workflow, Helm 18.1 Defining custom API objects 지금까지 책에서 살펴본 Kubernetes object 들은 비교적으로 low-level 한 object 이고 일반적인 개념을 다룬다. 그런데 Kubernetes ecosystem 이 발전하게 되면서 high-level object 를 만나게 되는데, 이러한 object 들은 일반적인 개념보다는 특정한 개념을 다루고, 애플리케이션 전체나 소프트웨어 서비스를 나타낸다. Custom controller 를 사용하게 되.. 2021. 9. 4.
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.
Chapter 13. Securing cluster nodes and the network 주요 내용 노드의 default Linux namespace 사용하기 컨테이너/Pod 단위로 권한 및 네트워크를 제어하여 보안 수준 높이기 컨테이너는 독립적인 환경을 제공한다고 하긴 했지만, 공격자가 API server 에 접근하게 되면 컨테이너에 무엇이든 집어넣고 악의적인 코드를 실행할 수 있고, 이는 실행 중인 다른 컨테이너에 영향을 줄 수도 있다! 13.1 Using the host node's namespaces in a pod 컨테이너는 별도의 linux namespace 에서 실행된다고 했었다. 13.1.1 Using the node's network namespace in a pod 시스템과 관련된 작업 (노드 레벨의 자원을 확인/수정하는 등) 을 하는 pod 의 경우 노드의 default .. 2021. 6. 29.
Chapter 12. Securing the Kubernetes API server 주요 내용 Authentication 과 ServiceAccount 에 대한 이해 RBAC plugin, Role/RoleBinding, ClusterRole/ClusterRoleBinding 에 대한 이해 12.1 Understanding authentication API server 가 요청을 받게 되면, authentication plugin 을 거치며 요청을 보낸 주체가 누구인지 분석한다. Plugin 을 거치게 되면 username, user ID, 클라이언트가 속하는 group 등의 정보가 API server 에게 전달된다. 12.1.1 Users and groups Understanding users Kubernetes 에서는 API server 에 연결하는 주체를 2가지로 분류한다. 사람 .. 2021. 6. 6.
Chapter 11. Understanding Kubernetes internals 주요 내용 Kubernetes 클러스터를 구성하는 컴포넌트의 기능과 역할에 대한 이해 Pod 생성시 일어나는 일에 대한 이해 Kubernetes 내부 네트워크와 Service 의 동작 방식 이해 Kubernetes 리소스들이 어떻게 구현되었는지 살펴보자! 11.1 Understanding the architecture Kubernetes 클러스터는 다음과 같이 구성되어 있음을 1장에서 배웠다! Kubernetes Control Plane: 클러스터의 상태를 저장하고 관리한다 etcd distributed persistent storage API server Scheduler Controller Manager (Worker) Node(s): 실제로 컨테이너를 동작하게 한다 Kubelet Kubernetes.. 2021. 5. 30.
Chapter 10. StatefulSets: deploying replicated stateful applications 주요 내용 StatefulSet 에 대한 이해 Stateful application 배포하기 DNS SRV record 를 이용한 peer discovery 10.1 Replicating stateful pods 도입 질문: 각 pod replica 가 하나씩 PV 를 갖게 할 수는 없을까? ReplicaSet 의 pod template 에서 PVC (PersistentVolumeClaim) 를 사용하게 되면, 모든 replica 가 하나의 PV (PersistentVolume) 을 참조하게 된다. 그래서 하나의 ReplicaSet 으로는 distributed data store 를 만들 수 없다. 지금까지 살펴본 API object 만으로는 조금 복잡하다. 10.1.1 Running multiple r.. 2021. 5. 17.