본문 바로가기

cloud111

[따배쿠CKA]11. Deployment & Expose the service [k8s docs: service,kodeklod: Rolling update and rollback] Q. 작업 클러스터: kubectl config use-context kubernetes Reconfigure the existing deployment front-end and add a port specification named http exposing port 80/tcp of the existing container nginx. Create a new service named front-end-svc exposing the container port http. configure the new service to also expose the individual Pods via a NodePort.. 2022. 8. 10.
[따배쿠CKA]10. Node 정보수집 Q. Check Ready Nodes Check to see how many nodes are ready(not including nodes tainted NoSchedule) and write the number to /var/CKA2022/RN0001 : ready 상태에 있는 것 중 NoSchedule, taint 되어 있는 것들의 수량을 확인해서 /var ~ 해당 경로에 파일을 저장해라 1. 확인 - ready 상태에 있는 노드 확인 kubectl get nodes | grep -i ready : Not Ready 도 폼함되는 것을 확인 할 수 있다. - Not Ready 는 제외 하고 찾는 방법 -w 옵션 중요 kubectl get nodes | grep -i -w ready 2. taint 가.. 2022. 8. 9.
[따배쿠CKA]9. Node 관리 * Node 명령어 정리 -노드 목록 학인 가능 kubectl get nodes -o wide - 더이상 특정 노드에 실행을 하지 말아주세요 Kubectl cordon [ node 이름 ] k8s-worker1 : scale 한 이후에 늘어나는 node 에 대해서도 모두 다른 노드에 실행을 할 수 있다. - 다시 해당 Node 에 Pod 스케줄링 되게 하기 Kubectl uncordon [ node 이름 ] k8s-worker1 - pod 정리 kubectl drain [ node 이름 ] k8s-worker1 --ignore daemononsets : 뒤에 붙이면 완전히 삭제 : 해당되는 node 들에대한 모든 pod를 전부 삭제해줘, 스케줄링 금지 : controller 가 제어하고 있는 노드들은 그.. 2022. 8. 9.
[따배쿠CKA]8.NodeSelector *NodeSelector 특정 앱 파드를 특정 노드에서 실행시켜달라고 요청하는 것을 의미한다. Q. 작업 클러스터: kubectl config use-context k8s Scheule a pod as follows: - Name: eshop-store - Image: nginx - Node Selector: disktype=ssd : disktype이 ssd 로 표시 되어 있는 pod 를 실행시켜라 1. 노드 레이블 확인하기 kubectl get nodes --show-labels kubectl get nodes -L disktype 2. pods 만들기 (Assign pods to Nodes) k run eshop-store --image=nginx --dry-run=client -o yaml > e.. 2022. 8. 9.
[따배쿠CKA]7. Rolling Update & Roll Back Q. 작업 클러스터: kubectl config use-context k8s create a deployment as follows: TASK: - name: nginx-app - using container nginx with version 1.11.10-alpine - The deployment should contain 3 replicas Next, deploy the application with new Version 1.11.13-alpine, by performing a rolling update Finally, rollback that update to the previous version 1.11.10-alpine 1. 작업 클러스터 변경 (deployment) k config use-co.. 2022. 8. 8.
[따배쿠CKA]6. Deployment & Pod Scale * 작업 클러스터 설정 kubectl config use-context kubernetes-admin@kubernetes * 사전 작업 k get ns k create ns devops Q. Pod Scale out 작업 클러스터: k8s Expand the number of running Pods in "eshop-order" to 5 - namespace: devops - deployment: eshop-order 1. 문제에 맞는 상황을 조회 : namespace 가 있는지, deployment 가 배포가 되어 있는지 확인 k get ns devops k get deployments -n devops k get deployments -n devops 2. rs 늘리기 * 샘플과 사전 조건이 달라 현.. 2022. 8. 8.