Red Hat OpenShift on IBM Cloud(Classic Infrastructure): MZR 환경인데 일부 Zone에 액세스가 분산되지 않는 상태를 수정하는 방법

1. 소개



TOK02/TOK04/TOK5에 걸친 worker node를 작성했으므로, 이것으로 3 거점에 처리는 분산되네요!


라고 생각하면, 저것 Ingress subdomain을 정인해 보면 2 거점( 128.168.xx.xxx(TOK04)166.192.xx.xxx(TOK05) ) 밖에 할당되어 있지 않다!
$ ibmcloud oc nlb-dns ls -c myrokscluster43
OK
Hostname                                                                                         IP(s)                                          Health Monitor   SSL Cert Status   SSL Cert Secret Name                                           Secret Namespace
myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud   128.168.xx.xxx,128.168.xx.xxx,165.192.xx.xxx   enabled          created           myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000   openshift-ingress

$ dig A +noall +answer @1.1.1.1 myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud
myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud. 2 IN A 128.168.xx.xxx
myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud. 2 IN A 165.192.xx.xxx
myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud. 2 IN A 128.168.xx.xxx

확실히 Service를 확인해 보면 router-tok04 라든지 router-tok05 는 있는데, router-tok02 가 존재하지 않는다! 왜?
$ oc get services -n openshift-ingress
NAME                      TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)                      AGE
router-default            LoadBalancer   172.21.200.228   128.168.xx.xxx   80:31712/TCP,443:32543/TCP   64d
router-internal-default   ClusterIP      172.21.57.171    <none>           80/TCP,443/TCP,1936/TCP      64d
router-tok04              LoadBalancer   172.21.108.161   128.168.xx.xxx   80:31380/TCP,443:30034/TCP   64d
router-tok05              LoadBalancer   172.21.103.123   165.192.xx.xxx   80:32357/TCP,443:30142/TCP   64d


2. 원인



실은 FAQ 와 같습니다. 서비스를 작성하는 단계에서 아직 클러스터가 ready가 되어 있지 않은 경우 등, 타이밍에 따라서는 잘 만들 수 없는 일도 있다.

3. 수정 방법



위 문서에 따라 수동으로 router-tok02를 만듭니다.

router-tok02.yaml
apiVersion: v1
kind: Service
metadata:
  annotations:
    service.kubernetes.io/ibm-load-balancer-cloud-provider-ip-type: public
    service.kubernetes.io/ibm-load-balancer-cloud-provider-zone: tok02
  finalizers:
  - service.kubernetes.io/load-balancer-cleanup
  labels:
    app: router
    ingresscontroller.operator.openshift.io/owning-ingresscontroller: default
    router: router-default
  name: router-tok02
  namespace: openshift-ingress
spec:
  externalTrafficPolicy: Cluster
  selector:
    ingresscontroller.operator.openshift.io/deployment-ingresscontroller: default
  sessionAffinity: None
  type: LoadBalancer
  ports:
  - name: http
    port: 80
    protocol: TCP
    targetPort: 80
  - name: https
    port: 443
    protocol: TCP
    targetPort: 443
$ oc apply -f router-tok02.yaml
service/router-tok02 created

$ oc get services -n openshift-ingress
NAME                      TYPE           CLUSTER-IP       EXTERNAL-IP       PORT(S)                      AGE
router-default            LoadBalancer   172.21.200.228   128.168.xx.xxx    80:31712/TCP,443:32543/TCP   64d
router-internal-default   ClusterIP      172.21.57.171    <none>            80/TCP,443/TCP,1936/TCP      64d
router-tok02              LoadBalancer   172.21.205.181   161.202.xx.xxx    80:30370/TCP,443:32261/TCP   41s
router-tok04              LoadBalancer   172.21.108.161   128.168.xx.xxx    80:31380/TCP,443:30034/TCP   64d
router-tok05              LoadBalancer   172.21.103.123   165.192.xx.xxx    80:32357/TCP,443:30142/TCP   64d
router-tok02 가 생성되었으므로이 EXTERNAL-IP를 해당 Ingress domain에 등록합니다. 이렇게 하면 이 도메인의 DNS에서 할당 대상에 추가됩니다.
$ ibmcloud oc nlb-dns add -c myrokscluster43 --ip 161.202.xx.xxx --nlb-host myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud
Adding IP(s) 161.202.xx.xxx to NLB host name myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud in cluster myrokscluster43 ...
OK

4. 확인


161.202.xx.xxx(TOK02) , 128.168.xx.xxx(TOK04) , 165.192.xx.xxx(TOK05) 의 3개에 분산되게 되었습니다.

부하 분산 검증
$ ibmcloud oc nlb-dns ls -c myrokscluster43
OK
Hostname                                                                                         IP(s)                                                          Health Monitor   SSL Cert Status   SSL Cert Secret Name                                           Secret Namespace
myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud   128.168.xx.xxx,128.168.xx.xxx,161.202.xx.xxx,165.192.xx.xxx   enabled          created           myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000   openshift-ingress

$ dig A +noall +answer @1.1.1.1 myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud
myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud. 30 IN A 128.168.xx.xxx
myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud. 30 IN A 161.202.xx.xxx
myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud. 30 IN A 128.168.xx.xxx
myrokscluster43-xxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-0000.jp-tok.containers.appdomain.cloud. 30 IN A 165.192.xx.xxx

좋은 웹페이지 즐겨찾기