๋กœ์ผ“๐Ÿพ
article thumbnail

 

Kubernetes์—์„œ ์„œ๋น„์Šค ์—ฐ๊ฒฐ์„ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” port ์œ ํ˜•์„ ์ •๋ฆฌ

 

Port ์œ ํ˜• ์ •๋ฆฌ

 

NodePort

์™ธ๋ถ€์—์„œ ์ ‘์†ํ•˜๊ธฐ ์œ„ํ•ด ์‚ฌ์šฉํ•˜๋Š” ํฌํŠธ

port

Cluster ๋‚ด๋ถ€์—์„œ ์‚ฌ์šฉํ•  Service ๊ฐ์ฒด์˜ ํฌํŠธ

targetPort

Service๊ฐ์ฒด๋กœ ์ „๋‹ฌ๋œ ์š”์ฒญ์„ Pod(deployment)๋กœ ์ „๋‹ฌํ• ๋•Œ ์‚ฌ์šฉํ•˜๋Š” ํฌํŠธ

โ€‹

์ „์ฒด ์„œ๋น„์Šค ํ๋ฆ„์œผ๋กœ ๋ณด๋ฉด NodePort --> Port --> targetPort

โ€‹

์˜ˆ์‹œ

- ์•„๋ž˜ Service ๋ฆฌ์†Œ์Šค์—์„œ ์ •์˜ํ•œ port์˜ ํ๋ฆ„์„ ๊ทธ๋ฆผ๊ณผ ๊ฐ™์ด ํ‘œํ˜„ ๊ฐ€๋Šฅํ•จ.

apiVersion: v1 kind: Service metadata: name: helloworld-service spec: ports: - nodePort: 31001 port: 8080 targetPort: 80 protocol: TCP selector: app: helloworld type: NodePort

port๋ฅผ ํ†ตํ•ด ์—ฐ๊ฒฐ๋˜๋Š” ํ๋ฆ„ ์ •๋ฆฌ

profile on loading

Loading...