[Storage] 1. pv hostpath 볼륨 마운트
apiVersion: v1
kind: PersistentVolume
metadata:
name: task-pv-volume
labels:
type: local
spec:
storageClassName: manual #사용할 sc지정 (필요시 사용)
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mnt/data"
[Workloads & Scheduling] 2. 기존 팟 수정해서 볼륨에 로그 저장하는 사이드카 컨테이너 붙이기 (커맨드 추가)
[Cluster Architecture] 3. etcd 백업, 복구
# 백업
ETCDCTL_API=3 etcdctl --endpoints=https://127.0.0.1:2397 \
--cacert=/opt/KUCM00302/ca.crt \
--cert=/opt/KUCM00302/etcd-client.crt \
--key=/opt/KUCM00302/etcd-client.key \
snapshot save /srv/data/etcd-snapshot.db
# 복구
ETCDCTL_API=3 etcdctl --data-dir <data-dir-location> snapshot restore snapshot.db
$ sudo ETCDCTL_API=3 etcdctl \
--data-dir /var/lib/etcd-previous \
snapshot restore /data/etcd-snapshot-previous.db
# etcd 설정 수정
sudo vi /etc/kubernetes/manifests/etcd.yaml
spec:
containers:
- command:
- etcd
- --advertise-client-urls=https://172.30.1.2:2379
- --cert-file=/etc/kubernetes/pki/etcd/server.crt
- --client-cert-auth=true
- --data-dir=/var/lib/etcd
이 부분을 수정한다.
[Troubleshooting] 4. 워커노드 트러블슈팅(kubelet)
systemctl restart kubelet
systemctl enable kubelet
[Troubleshooting] 5. pod 특정 레이블 중 top cpu 파드 이름 저장
kubectl top pod -l name=cpu_utilizer
[Troubleshooting] 6.taint된 노드 개수
[Services & Networking] 7. ingress 재작 후 curl 테스트
[Storage]8. 멀티컨테이너 파드 만들기
[Services & Networking]9. 조건에따라 networkpolicy 만들기 (특정 네임스페이스, 포트, 파드로 가는 트래픽 허용)
[Cluster Architecture] 10. 마스터 노드 업그레이드
[Services & Networking] 11. 디플로이먼트 expose 하는 nodeport 타입 서비스 만들기
[Workloads & Scheduling] 12. pod disktype
[workloads & Scheduling] 13.디플로이먼트 파드 스케일링 (presentation이라는 디플로이먼트를 5개로 늘리기)
[Cluster Architecture] 14. svc 생성 후 클러스터롤 , 바인딩하기
[Workloads & Scheduling] 15. 워커 노드 비우기
kubectl drain {node} --ignore-daemonsets --delete-local-data --force
drain 후에 원복
kubectl uncordon {node}
[Workloads & Scheduling] 16. pod error log 확인 후 저장
kubectl logs {pod} | grep "" > path
[Storage] 17. pvc만들고 만든 뒤에 capacity 늘리기 (record)
[Workloads & Scheduling] 18. deployment (kubectl set image)
unavailable, rerunning pod
[Services & Networking] 19. pod를 이용한 name service 구성
[Workloads & Scheduling] 20. static pod 생성
[Workloads & Scheduling] 특정 노드 선택해서 스케줄링
노드 셀렉터: disk: ssd 인 곳에 스케줄링
cat << EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: nginx-kusc00101
spec:
containers:
- name: nginx
image: nginx
nodeSelector:
disk: ssd
EOF
'Kubernetes > cert' 카테고리의 다른 글
cka feb 18 2025 (0) | 2025.02.24 |
---|---|
[CKA] taint (0) | 2025.02.13 |
[CKA] Node 유형 (0) | 2025.02.10 |
[CKA] 스토리지 유형 (0) | 2025.02.10 |
[CKA] Service 유형 (0) | 2025.02.09 |