34 lines
590 B
YAML
34 lines
590 B
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: nginx-deploy
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: nginx
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: nginx
|
|
spec:
|
|
containers:
|
|
- name: nginx
|
|
image: nginx:1.25
|
|
ports:
|
|
- containerPort: 80
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: nginx-service
|
|
spec:
|
|
type: NodePort
|
|
selector:
|
|
app: nginx
|
|
ports:
|
|
- port: 80 # 서비스 내부 포트
|
|
targetPort: 80 # 컨테이너 포트
|
|
nodePort: 30080 # 외부 노출 포트 (30000~32767 사이)
|
|
|