-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
mario pod 배포
apiVersion: apps/v1
kind: Deployment
metadata:
name: mario
labels:
app: mario
spec:
replicas: 1
selector:
matchLabels:
app: mario
template:
metadata:
labels:
app: mario
spec:
containers:
- name: mario
image: pengbai/docker-supermario
ports:
- containerPort: 8080
name: http
---
apiVersion: v1
kind: Service
metadata:
name: mario
spec:
ports:
- name: http
port: 80
targetPort: 8080
selector:
app: mario
type: NodePort
파드 및 서비스 객체 확인
curl 확인
svc.externalTrafficPolicy=Cluster 이기 때문에 master 노드 IP 를 사용해도 접속 가능
단, 클라이언트 IP 가 노드 IP 로 SNAT 된다. 외부 클라이언트 IP 를 알 수 없다.

외부 클라이언트 IP 를 보존하기 위해서 svc.externalTrafficPolicy=Local 로 변경했다. 파드가 떠있지 않는 노드인 master 노드 IP 로는 접속이 불가능하다.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels


