지니데비 기록 자세히보기
반응형

데브옵스/Orchestration 72

[Kubernetes] 20. Multiple Scheduler

Multiple Scheduler기본 스케줄러 외에 커스텀 스케줄러를 추가하여 여러 스케줄러가 각기 다른 스케줄링 요구에 따라 Pod를 할당하도록 구성하는 방식Scheduler 지정 방식Pod의 spec.schedulerName 필드에 스케줄러 이름을 설정커스텀 스케줄러 구성 파일 생성 및 배포apiVersion: apps/v1kind: Deploymentmetadata: name: custom-scheduler namespace: kube-systemspec: replicas: 1 selector: matchLabels: component: custom-scheduler template: metadata: labels: component: custom-..

[Kubernetes] 19. Static Pod

Static PodapiVersion: v1kind: Podmetadata: name: static-nginxspec: containers: - name: nginx image: nginx ports: - containerPort: 80YAML 파일을 Static Pod 디렉토리에 저장kubelet 설정 파일에 --pod-manifest-path= 옵션으로 지정된 경로에 YAML 파일을 저장한다.일반적으로 /etc/kubernetes/manifests 경로가 사용되지만, 클러스터 설정에 따라 다를 수 있다.kubelet이 Static Pod 인식kubelet은 --pod-manifest-path 옵션으로 지정된 디렉토리를 지속적으로 감시하고, YAML 파일이 추가되거나 변경될 때마다..

[Kubernetes] 17. Resources, LimitRange

ResourcesapiVersion: v1kind: Podmetadata:  name: resource-limits-examplespec:  containers:  - name: nginx    image: nginx    resources:      requests:        memory: "64Mi"     # 최소 보장 메모리 64Mi        cpu: "250m"        # 최소 보장 CPU 0.25 vCPU      limits:        memory: "128Mi"    # 최대 메모리 128Mi        cpu: "500m"        # 최대 CPU 0.5 vCPUrequests.memory와 requests.cpu: 컨테이너가 배치될 때 스케줄러는 이 Pod가 64M..

[Kubernetes] 16. Node Selector, Node Affinity

Node SelectorapiVersion: v1kind: Podmetadata:  name: myapp-podspec:  containers:  - name: nginx-container    image: nginx  affinity:    nodeAffinity:      requiredDuringSchedulingIgnoredDuringExecution:        nodeSelectorTerms:        - matchExpressions:          - key: disktype            operator: In            values:            - ssd      preferredDuringSchedulingIgnoredDuringExecution:    ..

[Kubernetes] 15. Taints, Tolerations

TaintTaint는 노드에 붙여서 해당 노드에 특정 Pod가 스케줄링되지 못하도록 하는 제약 조건이다. 노드에 Taint를 적용하면, Taint에 맞는 Toleration이 없는 Pod는 그 노드에 스케줄링되지 않는다.Taint는 Key, Value, 그리고 Effect 세 가지 필드로 구성된다.Effect는 Taint가 가지는 영향을 의미하고, 다음 세 가지 중 하나야:NoSchedule: 이 노드에는 Toleration이 없는 Pod는 스케줄링되지 않는다.PreferNoSchedule: 이 노드에 Toleration이 없는 Pod는 되도록 스케줄링되지 않지만, 꼭 막지는 않는다.NoExecute: 이 노드에 이미 있는 Pod라도 Toleration이 없으면 쫓겨난다.## taint 설정kubectl..

[Kubernetes] 14. Label, Selector, Annotation

Label용도: 리소스를 그룹화하거나 특정 리소스를 쉽게 식별하는 데 사용.구조:키: 영문 소문자와 숫자 사용 가능, 최대 63자.값: 영문 소문자와 숫자, 대시(-), 밑줄(_) 사용 가능.metadata:  labels:    app: my-app    environment: production    version: v1kubectl get pods -l app=my-appSelector용도: 특정 Label을 가진 리소스만 선택해 동작을 제한하고 제어.종류:Equality-based: = 또는 != 연산자 사용. (ex. app=my-app)Set-based: in, notin, exists 등을 이용해 조건에 맞는 리소스를 선택할 수 있다.selector:  matchLabels:    app: ..

[Kubernetes] 13. Scheduling

명시적으로 배포할 Node 지정apiVersion: v1kind: Podmetadata:  name: nginx  labels:    name: nginxspec:  containers:    - name: nginx      image: nginx      ports:        - containerPort: 8080  nodeName: worker02명시하지 않은 경우에는 Scheduler에 의해 Pod를 실행할 Node는 자동으로 지정함이미 배포한 Pod에 대해 Node 지정## Binding 객체 생성apiVersion: v1kind: Bindingmetadata:  name: nginxtarget:  apiVersion: v1  kind: Node  name: worker02

[Kubernetes] 11. Imperative(명령적) vs Declarative(선언적) + 필수암기

Imperative(명령형) 관리## Create objectskubectl run --image=nginx nginxkubectl run hazelcast --image=hazelcast/hazelcast --labels="app=hazelcast,env=prod"kubectl create deployment --image=nginx nginxkubectl expose deployment nginx --port 80## Update objectkubectl edit deployment nginxkubectl scale deployment nginx --replicas=5kubectl set image deployment nginx nginx=nginx:1.18kubectl create -f nginx...

반응형