Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- MySQL
- minikube
- APM
- 공부
- CloudWatch
- CKA
- 코틀린 코루틴의 정석
- tucker의 go 언어 프로그래밍
- 티스토리챌린지
- Spring
- kotlin
- Pinpoint
- kotlin querydsl
- PETERICA
- go
- SRE
- golang
- 기록으로 실력을 쌓자
- aws
- Linux
- 정보처리기사 실기 기출문제
- kotlin coroutine
- AI
- 오블완
- CKA 기출문제
- 컨텍스트 엔지니어링
- AWS EKS
- Java
- 바이브코딩
- Kubernetes
Archives
- Today
- Total
피터의 개발이야기
[kubernetes] Deployments 기본 명령어 본문
반응형

ㅁ 들어가며
코어 리소스 중 Deployments에 관한 kubectl 명령어 정리
ㅁ Deployments 조회
$ kubectl get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
frontend-deployment 0/4 4 0 3m51s
# 상세조회
$ k get deployments.apps -o wide
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
frontend-deployment 0/4 4 0 6m11s busybox-container busybox888 name=busybox-pod


ㅁ Deployment가 ReplicaSet를 생성
k describe deployments.apps frontend-deployment
~~~~~~~~~~~~~~~
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 7m26s deployment-controller Scaled up replica set frontend-deployment-577494fd6f to 4
ㅇ Deployment의 Events를 보면 Replicaset의 scale을 4로 변경하였다는 이벤트가 있다.
ㅁ Deployment 생성
# deployment 생성 yaml
$ cat deployment-definition-1.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: deployment-1
spec:
replicas: 2
selector:
matchLabels:
name: busybox-pod
template:
metadata:
labels:
name: busybox-pod
spec:
containers:
- name: busybox-container
image: busybox888
command:
- sh
- "-c"
- echo Hello Kubernetes! && sleep 3600
# 배포
$ kubectl apply -f deployment-definition-1.yaml
deployment.apps/deployment-1 created
ㅁ Deployment 생성 2
name: httpd-frontend
Replicas: 3
Image: httpd:2.4-alpine
# yaml 파일 작성
$ cat replicaset.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: httpd-frontend
spec:
replicas: 3
selector:
matchLabels:
name: httpd-frontend
template:
metadata:
labels:
name: httpd-frontend
spec:
containers:
- name: httpd-frontend
image: httpd:2.4-alpine
# 배포
$ kubectl apply -f replicaset.yaml
deployment.apps/httpd-frontend created
반응형
'Kubernetes > 기초공부' 카테고리의 다른 글
| [kubernetes] Service 기본 명령어 (0) | 2024.01.16 |
|---|---|
| [kubernetes] NameSpace 기본 명령어 (0) | 2024.01.15 |
| [kubernetes] ReplicaSet 기본 명령어 (0) | 2024.01.15 |
| [kubernetes] Pod 기본 명령어 (0) | 2024.01.15 |
| [kubernetes] 쿠버네티스 컨트롤러 (0) | 2024.01.13 |
Comments