728x90
kuernetes cluster 구성
Master Node(Control plane Node)
- kube-apiserver
- controller manager
- etcd
- kube-scheduler
Worker Node
- kubelet
- kube-proxy
- container runtime engine
yaml 파일 구성
apiVersion:
kind:
metadata:
spec:
yaml 예제
※ 들여쓰기 주의 ※
apiVersion: v1
kind: Pod
metadata:
name: myapp-pod
labels:
app: myapp
type: front-end
spec:
containers:
- name: nginx-container
image: nginx
※ labels: dictionary (key-value)
※ containers: array/list (-로 구분하는 object)
yaml 파일 빠르게 생성하기 : --dry-run
kubectl run redis --image=reids --dry-run=client -o yaml > redis-pod.yaml
kubectl apply -f redis-pod.yaml
kubectl create deployment --image=nginx nginx --replicas=4 --dry-run=client -o yaml > nginx-deployment.yaml
kubectl apply -f nginx-deployment.yaml
command
kubectl --help
kubectl get --help
kubectl api-resources
kubectl explain rs
kubectl get pod
# o: outfut
kubectl get pod -o wide
kubectl get pod -o yaml
kubectl get pod -o json
kubectl run [pod name] --image=nginx
kubectl run [pod name] --image=nginx --dry-run=client -o yaml > [yaml file name]
kubectl describe pod [pod name]
kubectl delete [resource type] [resource name]
## Pod 수정(1) - 직접 수정
kubectl edit [resource type] [resource name]
## Pod 수정(2) - yaml 파일 수정 후
# f: file
kubectl apply -f [yaml file name]
728x90
반응형
'데브옵스 > Orchestration' 카테고리의 다른 글
[Kubernetes] 8. Deployment (0) | 2024.11.05 |
---|---|
[Kubernetes] 7. ReplicationController, ReplicaSet (0) | 2024.11.05 |
[Kubernetes] 5. 서비스 배포 및 확인 (0) | 2024.11.04 |
[Kubernetes] 4. 서비스 배포 환경 구성 - HELM, Ingress NGINX, metalLB 설치 (1) | 2024.10.31 |
[Kubernetes] 3. 도커 및 쿠버네티스 설치, 클러스터 구성 (0) | 2024.10.31 |