2016-10-13 2 views
0

kubernetes 배포를 만들고 loadbalancer 유형의 서비스를 만들 수 있습니다. kubectl로 포드를 설명 할 때 내 컨테이너가 내 도커 인터페이스에 바인드된다는 정보를 얻습니다. 나는 그들에 접근 할 수 없으며 eth0 인터페이스 ip의 호출을 docker 인터페이스 ip에 라우팅하지 않을 것이다.Kubernetes가 도커 인터페이스 IP를 노출합니다.

kubectl describe services 
Name:   fpgra 
Namespace:  default 
Labels:   run=fpgra 
Selector:  run=fpgra 
Type:   LoadBalancer 
IP:   10.254.138.121 
Port:   <unset> 3000/TCP 
NodePort:  <unset> 32547/TCP 
Endpoints:  172.17.2.3:3033,172.17.30.2:3033 
Session Affinity: None 
No events. 

난 그냥 내 응용 프로그램에 액세스 및 부하 분산 장치 및 자동 스케일러로는 Kubernetes의 동작을 테스트하려는.

내가 통근자에서이 도달 할 수 있도록 내 응용 프로그램을 노출시키는 서비스를 생성하는 방법입니다 kubectl port-forward 당신을 도울 수처럼

kubectl expose deployment fpgra --port=3000 --target-port=3033 --type=LoadBalancer 

답변

1

것 같습니다. 서비스 뒤에서 단일 끝점 (포드)에 도달해야하는 경우 다음 중 하나를 사용할 수 있습니다.

$ kubectl port-forward -h 
Forward one or more local ports to a pod. 

Examples: 
    # Listen on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod 
    kubectl port-forward mypod 5000 6000 

    # Listen on port 8888 locally, forwarding to 5000 in the pod 
    kubectl port-forward mypod 8888:5000 

    # Listen on a random port locally, forwarding to 5000 in the pod 
    kubectl port-forward mypod :5000 

    # Listen on a random port locally, forwarding to 5000 in the pod 
    kubectl port-forward mypod 0:5000 
관련 문제