728x90
Deployment yaml 파일형식
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-deployment
labels:
app: myapp
type: front-end
spec:
template:
metadata:
name: myapp-pod
labels:
app: myapp
type: front-end
spec:
containers:
- name: nginx-container
image: nginx
replicas: 3
selector:
matchLabels:
type: front-end
※ kind 노드를 제외하고 ReplicaSet과 동일함
--dry-run 옵션으로 yaml 파일 생성 후 deployment 생성
kubectl create deployment httpd-frontend --replicas=6 --image=httpd:httpd:2.4-alpine --dry-run=client -o yaml > httpd-deployment.yaml
kubectl apply -f httpd-deployment.yaml
728x90
반응형
'데브옵스 > Orchestration' 카테고리의 다른 글
[Kubernetes] 10. Namespace, ResourceQuota (0) | 2024.11.05 |
---|---|
[Kubernetes] 9. Service (0) | 2024.11.05 |
[Kubernetes] 7. ReplicationController, ReplicaSet (0) | 2024.11.05 |
[Kubernetes] 6. 쿠버네티스 아키텍처와 yaml 파일 (0) | 2024.11.04 |
[Kubernetes] 5. 서비스 배포 및 확인 (0) | 2024.11.04 |