본문 바로가기
[CKA] taint 조회kubectl describe nodes | grep -i taint   taint# kubectl taint nodes =:# 키값은 자유이나 많이 쓰는 형식이 있음 node-role.kubernetes.io=control-plane:NoSchedule# 키값은 자유이나 많이 쓰는 형식이 있음 node-role.kubernetes.io=worker:NoSchedule# 값 생략 가능 node-role.kubernetes.io=NoSchedule# NoSchedule: toleration 없는 Pod이 이 노드에 스케줄 되지 않음# PreferNoSchedule: 가능하면 스케줄하지 않지만 강제는 아님# NoExecute: 기존 Pod도 강제 종료됨 (evict)kubectl taint nodes .. 2025. 2. 13.
[CKA] PV 생성 [Storage] 1. pv hostpath 볼륨 마운트apiVersion: v1kind: PersistentVolumemetadata: name: task-pv-volume labels: type: localspec: storageClassName: manual #사용할 sc지정 (필요시 사용) capacity: storage: 10Gi accessModes: - ReadWriteOnce hostPath: path: "/mnt/data" [Workloads & Scheduling] 2. 기존 팟 수정해서 볼륨에 로그 저장하는 사이드카 컨테이너 붙이기 (커맨드 추가)   [Cluster Architecture] 3. etcd 백업, 복구# 백업ETCDCTL_API=3 et.. 2025. 2. 11.
[CKA] Node 유형 1) 특정 워커노드 drain 하기 문제문제Set the node named ek8s-node-1 as unavailable and reschedule all the pods running on it.풀이이 문제는 https://killercoda.com/killer-shell-cka/scenario/playground 에서 풀이하는 것으로 하자drain 명령을 통해 특정 노드를 스케줄러에서 제외시켜 파드가 할당되지 않도록 하고, 기존에 배포된 파드를 다른 노드로 이동한다.kubectl drain {노드이름} --ignore-daemonsets --delete-local-data --force공식문서에서 Safely Drain a Node를 찾으면 -ignore-daemonsets을 사용하는 옵션을 확인.. 2025. 2. 10.
[CKA] 스토리지 유형 1) Persistent Volumes 문제문제List all persistent volumes sorted by capacity, saving the full kubectl output to /opt/KUCC00102/volume_list. Use kubectl's own functionality for sorting the output, and do not manipulate it any further.풀이클러스터 내의 모든 Persistent Volumes를 가져와서 저장 용량을 기준으로 정렬된 목록을 출력한다.# PersistentVolumes을 용량별로 정렬해서 조회kubectl get pv --sort-by=.spec.capacity.storage 2) emptyDir 문제문제Create a .. 2025. 2. 10.
[CKA] 권한 유형 1) secret 문제문제Create a Kubernetes secret as follows:Name: super-secretpassword: bobCreate a pod named pod-secrets-via-file Image, which mounts a secret named super-secret at /secrets.Create a second pod named pod-secrets-via-env Image, which exports password as CONFIDENTIAL풀이명령어는 검색을 해결해야한다..from-literal 이걸 기억해야한다!https://kubernetes.io/search/?q=from-literalhttps://kubernetes.io/docs/concepts/co.. 2025. 2. 10.
[CKA] Service 유형 1) NodePort 문제문제Create and configure the service front-end-service so it's accessible through NodePort and routes to the existing pod named front-end. 풀이먼저 front-end이름의 Pod를 만들어야 한다.아래 처럼 명령어로 빠르게 만들 수 있고 공식 문서를 찾아 만들 수도 있다.https://kubernetes.io/docs/concepts/workloads/pods/#using-pods# podapiVersion: v1kind: Podmetadata: name: front-end labels: name: front-endspec: containers: - image: n.. 2025. 2. 9.