전체 글

System Engineering/Kubernetes

8. K8s AutoScaling

1. AutoScaling HPA (Horizontal Pod Autoscaler) RC / RS / Deploymen를 통해 실행되는 Pod의 Scaling이다. 설정된 주기(Default 30초)마다 CPU 사용률등의 Metric을 모니터링하며, DaemonSet에는 적용되지 않는다. apiVersion: autoscaling/v2alpha1 kind: HorizontalPodAutoscaler metadata: name: hpa-ex namespace: default spec: scaleTargetRef: apiVersion: apps/v1beta1 kind: Deployment name: hpa-ex minReplicas: 3 maxRelpicas: 9 metircs: - type: Resourc..

System Engineering/Kubernetes

7. K8s Resource / Scheduling

1. Resource Management - Pod를 배포할 때 CPU / Memory / Network Bandwidth(Not supported yet)를 어떻게 할당할지 결정 - Memory는 MegaByte, CPU는 millisecond의 단위 사용 (1,000ms = 1vCore) - limits는 Pod의 Max Resource, requests는 Min Resource이다 apiVersion: v1 kind: Pod metadata: name: frontend spec: containers: - name: db image: mysql resources: requests: memory: "64Mi" cpu: "250m" limits: memory: "128Mi" cpu: "500m" - na..

System Engineering/Kubernetes

6. K8s Volume

1. Volume의 특징 - Pod가 생성되거나 삭제될때 Volume도 함께 생성/삭제 - Volume의 Life cylce은Pod에서 관리 - 동일 Pod의 컨테이너끼리 Volume 공유 apiVersion: v1 kind: Pod metadata: name: pv-recycler- namespace: default spec: restartPolicy: Never volumes: - name: vol hostPath: path: /tmp/path/ containers: - name: pv-recycler image: "gcr.io/... command: ... volumeMounts: - name: vol mountPath: /scrub 2. Volume의 종류 - Local Disk 1) emptyD..

System Engineering/Kubernetes

5. K8s Lifecycle / Configmap

1. Probe - 컨테이너에서 kubelet에 의해 주기적으로 수행되는 진단 - kubelet은 컨테이너에 의해 구현된 핸들러를 호출 - Probe Type 1) ExecAction : 컨테이너 내에 지정된 명령어(Shell Command)를 실행하며, 명령어 Status Code가 0으로 종료되면 진단 성공으로 간주 exec-liveness.yaml docs/tasks/configure-pod-container apiVersion: v1 kind: Pod metadata: labels: test: liveness name: liveness-exec spec: containers: - name: liveness image: k8s.gcr.io/busybox agrs: - /bin/sh - -c - to..

Hopulence
IT 뉴비 생존기