728x90
반응형
앞서 만들어 두었던 spring 프로젝트가 있다.
그것을 열어서 manifest 파일을 연다. 그러면 아래와 같은 것일텐데
apiVersion: v1
kind: Pod
metadata:
name: spring-pod-1
spec:
containers:
- name: spring-container
image: spring-server:latest
ports:
- containerPort: 8080
imagePullPolicy: IfNotPresent
위에 것 아래와 같이 바꿔준다
apiVersion: v1
kind: Pod
metadata:
name: spring-pod-1
spec:
containers:
- name: spring-container
image: spring-server:latest
ports:
- containerPort: 8080
imagePullPolicy: IfNotPresent
---
apiVersion: v1
kind: Pod
metadata:
name: spring-pod-2
spec:
containers:
- name: spring-container
image: spring-server:latest
ports:
- containerPort: 8080
imagePullPolicy: IfNotPresent
---
apiVersion: v1
kind: Pod
metadata:
name: spring-pod-3
spec:
containers:
- name: spring-container
image: spring-server:latest
ports:
- containerPort: 8080
imagePullPolicy: IfNotPresent
위와 같이 작성 후
kubectl apply -f spring-pod.yaml
을 터미널에 입력해준다.
그럼

이렇게 뜬다.
1개의 파드는 1개의 프로그램을 실행시키는 단위라고 보면 된다.
잘 되었는지 알기 위해
kubectl get pods
입력해주면

스프링 서버가 3개 띄워져 있음을 알게 된다.
728x90
반응형
'쿠버네티스' 카테고리의 다른 글
| !!!중간점검!!! 명령어 정리!!! (0) | 2026.01.30 |
|---|---|
| 파드(Pod) 디버깅 하는 방법 (0) | 2026.01.30 |
| 프론트엔드(Next.js) 서버를 파드(Pod)로 띄워보기 (0) | 2026.01.30 |
| 프론트엔드(HTML, CSS, Nginx) 서버를 파드(Pod)로 띄워보기 (0) | 2026.01.30 |
| 백엔드(Nest.js) 서버를 파드(Pod)로 띄워보기 (0) | 2026.01.30 |