본문 바로가기

cloud/k8s(문제풀이)76

[k8s]Troubleshooting - worker node failure 1. Fix the broken cluster k get nodes systemctl status docker systemctl status kubelet systemctl start --now kubelet systemctl status kubelet 2. The cluster is broken again. Investigate and fix the issue. k get nodes ssh node01 systemctl status docker systemctl status kubelet cat /etc/kubernetes/kubelet.conf : 이상없음 cat /var/lib/kubelet/config.yaml : config 에 명시된 file 이름과 해당경로 파일 이름이 다르다. k edit .. 2022. 8. 17.
[따배쿠 CKA] 25. User Role binding ( RBAC ) *RBAC: Role 에대한 권한 [k8s docs k.w: csr] * API 인증 & 권한 : kubernetes 는 모든 리소스에 대한 접근이 API를 통해서 한다. : "kubectl run" 명령어 입력후 API 에 접근하기 위해 인증이 필요하다. : 이 인증은 k8s 계정에 권한을 부여한다. (인증서로) : k8s 는 이 인증서를 확인하고, 이에 맞는 권한을 주게한다. Q. Cluster: Kubectl config use-context k8s TASK: Create the Kubeconfig named ckauser - username: ckasuer - certificate location: /data/cka/ckauser.crt, /data/cka/ckauser.key - context-.. 2022. 8. 17.
[따배쿠CKA] 24.Kubernetes Troubleshooting(2) * 트러블 슈팅 문제 해결 - 서비스가 운영되지 않아요, replicas 개수가 확장되지 않아요 등등등 - 단계별로 잘 정리해서 해결해야함 * 같은 환경 구성이 어려워 강의를 통해 문제만 정리 A kubernetes worker node, named hk8s-w2 is in state NotReady. Investigate why this is the case, and perform any appropriate stes to bring the node to a Ready state, ensuring that any changes are made permanent. 1. 상태 확인하기 kubectl get nodes 2. 시스템 환경점검 : 현재 hk8s-2 의 워커노드가 작동되지 않기 떄문에 hk8s-2.. 2022. 8. 17.
[따배쿠CKA]23. kubernetes Troubleshooting(1) *k8s 구조 • Worker Node - docker: 컨테이너를 실행시켜주는 엔진 - kubelet: systemctl 로 운영을 하게 되면 시스템 클러스터로 운영을 하게 해줌 - kube-proxy: 쿠버 환경에서 클라이언트커넥션을 받아주는 네트워크의 포트를 리슨하고 있는 역할을 담당한다. 쿠버네티스의 네트워크를 담당하고 있다. • 예를들면, Master Node 에서 API 가 어떤 Deploy 를 통해서 Nginx POD를 두개 실행하려고 하는데 그 중에 현재의 Worker Node에 실행하려고 한다면?? -> API 요청 -> kubelet -> kubelet 는 파드 실행 능력이 없어 -> Docker (nginx 에게 요청한다) -> doc hub 에서 컨테이너 이미지를 다운받아 -> 파드.. 2022. 8. 16.
[따배쿠CKA]22.Kubernetes Upgrade 노드업그레이드도 있고 마스터 업그레이드도 있는데 마스터 업그레이드가 가장 많이 나옴 Q. upgrade system: k8s-master Given an existing kubernetes cluster running version 1.23.x, upgrade all of the kubernetes control plane and node components on the master node only to version 1.24.x Be sure to drain the master node before upgrading it and uncordon it after the upgrade. : 1.22.4 로 쿠버 버전이 되어 있는데 1.23.3으로 변경할 것 *현재 나의 환경에서는 1.19.0 -> 1.2.. 2022. 8. 12.
[따배쿠CKA]21. Check Resource Information *Check Resource Information : 파드, 서비스, pv 등 관리하는 방법에 대한 부분 : 문제유형은 비슷하나 대상이 달라질 수 있다. [k8s docs: cheat sheet] Q. Set configuration context: kubectl config use-context k8s List all 'PV' s sorted by name saving the full kubectl output to /var/CKA2022/my_volumes. Use kubectl's own functionally for sorting th output, and do not manipulate it any further. : 이런 종류의 문제가 자주 나오고, 이번에는 PV 이지만 pod가 될 수 있고,.. 2022. 8. 12.