• 카테고리

    질문 & 답변
  • 세부 분야

    데브옵스 · 인프라

  • 해결 여부

    미해결

ingress 실습 에러 발생

20.03.19 10:39 작성 조회수 167

1

ingress 실습 2-4) ingress 부분의 마지막 curl명령에 에러가 있습니다.

curl 192.168.0.30:30431/
curl 192.168.0.30:30431/order
curl 192.168.0.30:30431/customer

nginx 서비스를 확인해 보니, 아래와 같다.
"spec": {
"ports": [
{
"name": "http",
"protocol": "TCP",
"port": 80,
"targetPort": 80,
"nodePort": 30168
},
{
"name": "https",
"protocol": "TCP",
"port": 443,
"targetPort": 443,
"nodePort": 31423
}
],

이 명령에 변화가 있는 것인가요?
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.27.1/deploy/static/provider/baremetal/service-nodeport.yaml

알려주세요.

답변 2

·

답변을 작성해보세요.

0

Umi님의 프로필

Umi

2020.03.27

192.168.0.30으로 고정되게 요청을 보낼 것이 아니라, 자기 node의 내부 IP를 보내는 것으로 바꾸시면 되지 않을까싶은데요...? 태민님은 아니지만 조심스레 의견 내봅니당 ㅎㅎ...

0

안녕하세요.

실습 강의를 안보신거 같네요^^

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.27.1/deploy/static/provider/baremetal/service-nodeport.yaml

위 명령으로 Nodeport 타입에 서비스를 만들면 랜덤으로 nodePort 번호가 할당이 됩니다. 

지금 30168으로 자동할당 되셨기 때문에 curl 192.168.0.30:30168/customer 으로 호출을 하시면 되고요.

저는 실습 강의에서 서비스의 NodePort 번호를 30431로 수정했었습니다.