Red Hat OpenShift on IBM Cloud(VPC): Service(type:LoadBalancer) 만들기

결론


  • type:LoadBalancer 서비스를 만들 때마다 VPC Load Balancer가 하나씩 주문됩니다 (별도 비용 발생).
  • VPC Load Balancer는 각 노드의 NodePort에 할당합니다.
  • (Classic Infrastructure 때와는 달리) VPC Load Balancer가 제공하는 FQDN이 Zone 나중에 할당할 수 있다. 즉, VPC Load Balancer=Multizone Load Balancer이다.

  • 참고 자료
    htps : // c ぉ d. 이 bm. 코 m/도 cs/오페시 ft? 토피 c = 오펜시 ft ぉ 아 d 바 펜 세 r qs # lb_qs_vpc
    h tps : // c ぉ d. 이 bm. 코 m/도 cs/오페시 ft? 토피 c = 오펜시 ftvpcl 바아 s

    확인


    $ oc new-app --name hello-world https://github.com/IBM/container-service-getting-started-wt --context-dir="Lab 1"
    $ oc expose service hello-world
    

    와 같이 route를 작성한 상태에서 type:LoadBalancer 의 Service를 만들어 보았다.
    $ oc expose dc  hello-world --port=80 --target-port=8080 --type=LoadBalancer --name hello-world-lb
    $ oc expose dc  hello-world --port=8080 --target-port=8080 --type=LoadBalancer --name hello-world-lb
    4e5d1726
    
    
    #しばらく待って再度確認した結果
    $ oc get services
    NAME              TYPE           CLUSTER-IP      EXTERNAL-IP                            PORT(S)          AGE
    hello-world       ClusterIP      172.21.14.37    <none>                                 8080/TCP         36h
    hello-world-lb    LoadBalancer   172.21.82.182   xxxxxxxx-us-south.lb.appdomain.cloud   80:32737/TCP     54m
    hello-world-lb2   LoadBalancer   172.21.93.55    yyyyyyyy-us-south.lb.appdomain.cloud   8080:32532/TCP   31s
    
    $ oc describe service hello-world-lb
    Name:                     hello-world-lb
    Namespace:                syasuda
    Labels:                   app=hello-world
                              app.kubernetes.io/component=hello-world
                              app.kubernetes.io/instance=hello-world
    Annotations:              <none>
    Selector:                 deploymentconfig=hello-world
    Type:                     LoadBalancer
    IP:                       172.21.82.182
    LoadBalancer Ingress:     xxxxxxxx-us-south.lb.appdomain.cloud
    Port:                     <unset>  80/TCP
    TargetPort:               8080/TCP
    NodePort:                 <unset>  32737/TCP
    Endpoints:                172.17.111.9:8080,172.17.115.137:8080,172.17.123.76:8080 + 2 more...
    Session Affinity:         None
    External Traffic Policy:  Cluster
    Events:
      Type    Reason                           Age   From                Message
      ----    ------                           ----  ----                -------
      Normal  EnsuringLoadBalancer             17m   service-controller  Ensuring load balancer
      Normal  EnsuredLoadBalancer              17m   service-controller  Ensured load balancer
      Normal  CloudVPCLoadBalancerNormalEvent  11m   ibm-cloud-provider  Event on cloud load balancer hello-world-lb for service syasuda/hello-world-lb with UID 12b7ca92-aad5-42d7-b0fa-eac967b1192d: The VPC load balancer that routes requests to this Kubernetes LoadBalancer service is currently online/active.
    
    

    위의 이벤트 로그에 설명 된대로 ibm-cloud-provider가 VPC Load Balancer를 작성했습니다.
    실제로 IBM Cloud Portal에서 확인해 보면 ... 확실히 새롭게 VPC Load Balancer가 작성되고 있다! (다른 Load Balancer는 Route용입니다)






    액세스 테스트
    $ curl xxxxxx-us-south.lb.appdomain.cloud:80
    Hello world from hello-world-1-rb8nt! Your app is up and running in a cluster!
    $ curl yyyyyy-us-south.lb.appdomain.cloud:8080
    Hello world from hello-world-1-rb8nt! Your app is up and running in a cluster!
    

    좋은 웹페이지 즐겨찾기