controller7 Kubernetes - Deployment Deployment 정의 ReplicaSet을 컨트롤해서 Pod수를 조절 Rolling Update & Rolling Back RollingUpdate란? 서비스 중단없이 이루어질 수 있도록 하는 업데이트 생성 root@master:~# cat > deployment-examl.yaml apiVersion: apps/v1 kind: Deployment metadata: name: app-deploy spec: replicas: 3 selector: matchLabels: app: webui template: metadata: labels: app: webui spec: containers: - image: nginx:1.14 name: web ports: - containerPort: 80 root@ma.. 2021. 11. 25. Kubernetes - DaemonSet DaemonSet 정의 전체 노드에서 Pod가 한개씩 실행되도록 보장 로그 수집기, 모니터링 에이전트와 같은 프로그램 실행시 적용 생성 root@master:~# cat > daemonset-exam.yaml apiVersion: apps/v1 kind: DaemonSet metadata: name: daemonset-nginx spec: selector: matchLabels: app: webui template: metadata: name: nginx-pod labels: app: webui spec: containers: - name: nginx-container image: nginx:1.14 root@master:~# kubectl create -f daemonset-exam.yaml daemo.. 2021. 11. 25. Kubernetes - CronJob CronJob 정의 job 컨트롤러로 실행할 Application Pod를 주기적으로 반복해서 실행 Linux의 cronjob의 스케줄링 기능을 Job Controller에 추가한 API 다음과 같은 반복해서 실행하는 Job을 운영해야 할 때 사용 Data Backup Send email Cleaning tasks Cronjob Schedule: "0 3 1 * *" Minutes (from 0 to 59) Hours (from 0 to 23) Day of the month (from 1 to 31) Month (from 1 to 12) Day of the week (from 0 to 6) 생성 옵션 설명 concurrencyPolicy Allow: 중복실행 가능, Forbid: 중복실행 불가 root@.. 2021. 11. 24. Kubernetes -Job Controller Job Controller 정의 쿠버네티스는 Pod를 running 중인 상태로 유지 Batch 처리하는 Pod는 작업이 완료되면 종료됨 Batch 처리에 적합한 컨트롤러로 Pod의 성공적인 완료를 보장 생성 옵션 설명 completions 실행해야 할 jobs의 수가 몇 개인지 지정 parallelism 병렬성. 동시 running되는 pod 수 activeDeadlineSeconds 지정 시간 내에 Job을 완료 옵션 설명 restartPolicy Never: Pod를 재시작, OnFailure: Container를 재시작 backoffLimit restartPolicy가 OnFailure일 경우 재시작 횟수를 지정 root@master:~# cat > job-exam.yaml apiVersion: .. 2021. 11. 23. Kubernetes - StatefulSet StatefulSet 정의 Pod의 상태를 유지해주는 컨트롤러 Pod 이름 Pod의 볼륨(스토리지) 생성 root@master:~# cat > sf-nginx.yaml apiVersion: apps/v1 kind: StatefulSet metadata: name: sf-nginx spec: replicas: 3 serviceName: df-nginx-service podManagementPolicy: Parallel selector: matchLabels: app: webui template: metadata: name: nginx-pod labels: app: webui spec: containers: - name: nginx-container image: nginx:1.14 root@master:~#.. 2021. 11. 22. Kubernetes - ReplicaSet ReplicaSet 정의 ReplicationController 와 같은 역할을 하는 컨트롤러 ReplicationController 보다 풍부한 selector matchExpressions 연산자 표현 설명 In key와 values를 지정하고 key, value가 일치하는 Pod만 연결 NotIn key는 일치하고 value는 일치하지 않는 Pods에 연결 Exists key에 맞는 label의 pod를 연결 DoesNotExist key와 다른 label의 pod를 연결 실행방법 생성 root@master:~# cat > rs-nginx.yaml apiVersion: apps/v1 kind: ReplicaSet metadata: name: rs-nginx spec: replicas: 3 selec.. 2021. 11. 21. Kubernetes - ReplicationController ReplicationController 정의 요구하는 Pod의 개수를 보장하며 파드 집합의 실행을 항상 안정적으로 유지하는 것을 목표 요구하는 Pod의 개수가 부족하면 template 이용해 Pod를 추가 요구하는 Pod 수 보다 많으면 최근에 생성된 Pod를 삭제 기본 구조 selector replicas template 실행방법 생성 replicas를 3으로 설정하고 3개의 pod를 생성 root@master:~# cat > rc-nginx.yaml apiVersion: v1 kind: ReplicationController metadata: name: rc-nginx spec: replicas: 3 selector: app: webui template: metadata: name: nginx-pod.. 2021. 11. 19. 이전 1 다음 728x90 반응형