Day23 Load balance with Istio

昨天非常粗浅的介绍过 istio 後,今天我们要来实际将 Istio mesh 注入我们的 cluster。此外会将今天的内容独立为一篇,是因为笔者在尝试,将 Istio 与 Open-Match 结合的过程并不顺利,这边准备好了最後成功的范例,希望可以多少帮助大家。

部署流程

  1. 确认 Istio 核心已安装

    ~ kubectl get svc -n istio-system
    
    NAME                   TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                                      AGE
    istio-egressgateway    ClusterIP      10.97.46.6       <none>        80/TCP,443/TCP                                                               4h18m
    istio-ingressgateway   LoadBalancer   10.108.148.225   localhost     15021:31844/TCP,80:31864/TCP,443:31448/TCP,31400:31199/TCP,15443:30257/TCP   4h18m
    istiod                 ClusterIP      10.97.153.206    <none>        15010/TCP,15012/TCP,443/TCP,15014/TCP                                        4h18m
    
  2. Label open-match namespace

    kubectl label namespace open-match istio-injection=enabled
    
  3. Deploy Redis

    helm install -n open-match open-match-redis bitnami/redis \
      --set architecture=standalone \
      --set auth.enabled=false \
      --set auth.sentinel=false
    
  4. Deploy Open-Match core

    helm install open-match --namespace open-match open-match/open-match \
      --set open-match-customize.enabled=true \
      --set open-match-customize.evaluator.enabled=true \
      --set open-match-override.enabled=true \
      --set query.replicas=1 \
      --set frontend.replicas=1 \
      --set backend.replicas=1 \
      --set open-match-core.redis.enabled=false \
      --set open-match-core.redis.hostname=open-match-redis-master
    

注意到我们在 step.3 特别部署了一个简易的 redis,并且在 step.4 部署核心时,指定 Open-Match 使这个自订的 redis,会这麽做是因为,笔者在直接使用原本核心提供的 redis 设定时,如果套上 istio 便会无法成功连线,很遗憾的是,目前我还没有找到是哪个部分影响到。但透过自己指定 redis 的方式,目前测试起来是可以运作的。

测试

  1. 部署官方范例

    kubectl create namespace open-match-demo /
    kubectl label namespace open-match-demo istio-injection=enabled /
    kubectl apply -n open-match-demo -f https://open-match.dev/install/v1.3.0-rc.1/yaml/02-open-match-demo.yaml
    
  2. 增加核心 open-match-query 数量

    helm upgrade open-match --namespace open-match ./open-match \
      --set open-match-customize.enabled=true \
      --set open-match-customize.evaluator.enabled=true \
      --set open-match-override.enabled=true \
      --set query.replicas=2 \
      --set frontend.replicas=1 \
      --set backend.replicas=1 \
      --set open-match-core.redis.enabled=false \
      --set open-match-core.redis.hostname=open-match-redis-master
    
  3. 观察 2个 open-match-query 是否都有收到 queries

    kubectl logs -n open-match open-match-query-{POD_ID}
    

    都有持续触发由 demo MMF 发出来的 debug log 就可以了

    time="2021-10-01T01:14:06Z" level=debug msg="Ticket Cache update: Previous 2, Deleted 2, Fetched 3, Current 3" app=openmatch component=app.query
    time="2021-10-01T01:14:17Z" level=debug msg="Ticket Cache update: Previous 3, Deleted 2, Fetched 0, Current 1" app=openmatch component=app.query
    time="2021-10-01T01:14:28Z" level=debug msg="Ticket Cache update: Previous 1, Deleted 1, Fetched 1, Current 1" app=openmatch component=app.query
    

<<:  Day31 完赛心得

>>:  [Day17] Flutter with GetX binding (一) 元件与属性绑定

Day 27 - Rancher Fleet Kustomize 应用程序部署

本文将於赛後同步刊登於笔者部落格 有兴趣学习更多 Kubernetes/DevOps/Linux 相...

Day26. Blue Prism取号一把罩–BP自动取得订单编号

一般订购的程序都是由下订单开始, 接着取单号为依据来分批或批次采购相关物资, 因此订单编号有举足轻重...

Golang 程序码初读

Golang 程序码初读 按照惯例,怎麽能不先看看Hello, world呢!下面是Hello, w...

DAY 08 Nesting

嵌套 Nesting 当你在编辑一个 html 档案时,巢状结构的架构可以让你快速了解,每个区块里面...

30-10 之Presentation Layer - MVVM ( Model-View-ViewModel )

这个东东主要的概念来自 Martin Fowler 所写的 《 Presentation Model...