前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >服务网格中立规范|SMI、SMP介绍

服务网格中立规范|SMI、SMP介绍

作者头像
CNCF
发布2022-03-28 14:19:41
1.1K0
发布2022-03-28 14:19:41
举报
文章被收录于专栏:CNCF

随着云原生环境中对服务网格的采用越来越多,服务网格抽象——服务网格中立规范——出现了。Service Mesh Performance[1]Service Mesh Interface[2]是两个开放的规范,它们解决了与任何类型的服务网格交互和管理的通用接口的需求。让我们了解一下每个规范都提供了什么。

Service Mesh Performance(SMP)标准化了服务网格值的指标,通过捕获基础设施容量、服务网格配置和工作负载元数据的细节来描述任何部署的性能。

Service Mesh Interface(SMI)为 Kubernetes 上的服务网格提供了一个标准接口。这(目前)四个规范提供了一组共同的接口,以支持大多数常见的服务网格用例,以及随着时间的推移,为支持新的服务网格功能而演化的灵活性。

作为一个服务网格无感的工具,Meshery[3]提供了大量(10+)服务网格[4]、Kubernetes 应用程序、服务网格模式和 WebAssembly 过滤器的生命周期和性能管理,是实现这些规范工作的理想工具。

Meshery 还提供了两个新的 GitHub Actions,使它很容易将 SMI 和 SMP 集成到你的 GitHub 工作流。Meshery SMI 一致性操作[5]使用一组标准一致性测试来验证你的服务网格部署是否符合SMI 标准[6]。一致性测试的输出显示在SMI 一致性仪表板[7]上。Meshery SMP 操作[8]集成到你的应用程序流水线中,根据你的负载需求和服务网格配置,在你的环境中执行SMP 兼容性能基准测试[9]

让我们仔细看看这些操作。

SMI 一致性 GitHub 操作

SMI 规范的一致性被定义为一系列测试断言(assertion)。这些测试断言按照 SMI 规范(目前有四个规范)进行分类,并组成完整的 SMI 一致性测试套件。一致性需求将随着 SMI 规范的每个新版本的发布而适当地变化。有关 Meshery 如何执行 SMI 一致性的详细信息,请参阅Meshery 文档[10]

使用 Meshery SMI 一致性 GitHub 操作

SMI 一致性 GitHub 操作[11]可在 GitHub 市场找到。你可以配置每次发布触发这个动作,每次拉请求。或任何 GitHub 工作流触发事件。

下面显示了在每个版本上运行的操作配置示例。该操作处理设置 Kubernetes 环境、部署服务网格(请参阅受支持的服务网格)、运行一致性测试并将结果报告给 Meshery 中的 SMI 一致性仪表板。

代码语言:javascript
复制
name: SMI Conformance with Meshery
 on:
   push:
     tags:
       - 'v*'

 jobs:
   smi-conformance:
     name: SMI Conformance
     runs-on: ubuntu-latest
     steps:

       - name: SMI conformance tests
         uses: layer5io/mesheryctl-smi-conformance-action@master
         with:
           provider_token: $
           service_mesh: open_service_mesh
           mesh_deployed: false

你还可以引入具有特定功能和已经安装服务网格的集群。

代码语言:javascript
复制
name: SMI Conformance with Meshery
on:
  push:
    branches:
      - 'master'

jobs:
  smi-conformance:
    name: SMI Conformance tests on master
    runs-on: ubuntu-latest
    steps:

      - name: Deploy k8s-minikube
        uses: manusa/actions-setup-minikube@v2.4.1
        with:
          minikube version: 'v1.21.0'
          kubernetes version: 'v1.20.7'
          driver: docker

      - name: Install OSM
        run: |
           curl -LO https://github.com/openservicemesh/
           osm/releases/download/v0.9.1/osm-v0.9.1-linux-amd64.tar.gz
           tar -xzf osm-v0.9.1-linux-amd64.tar.gz
           mkdir -p ~/osm/bin
           mv ./linux-amd64/osm ~/osm/bin/osm-bin
           PATH="$PATH:$HOME/osm/bin/"
           osm-bin install --osm-namespace default

      - name: SMI conformance tests
        uses: layer5io/mesheryctl-smi-conformance-action@master
        with:
          provider_token: $
          service_mesh: open_service_mesh
          mesh_deployed: true

你可以从 Meshery 下载一个令牌,并将其添加为一个 GitHub 秘密(在上面的例子中,这个秘密是 MESHERY_PROVIDER_TOKEN)。运行测试之后,你可以在 Meshery UI 的 Service Mesh Interface 仪表板中查看结果。

参与的服务网格项目还可以自动向 SMI 一致性仪表板报告它们的一致性测试结果。

SMP GitHub 操作

测量和管理服务网格的性能是任何服务网格高效运行的关键。Meshery 是 SMP 规范的规范实现。你可以从多个负载生成器中进行选择,并使用具有可变可调方面的一组高度可配置的负载概要文件来运行性能测试。Meshery 将所有这些特性打包成一个易于使用的 GitHub Action。

使用 Meshery SMP GitHub 操作

SMP GitHub 操作[12]可在 GitHub 市场找到。你可以创建自己的性能配置文件,以使用 Meshery 运行可重复的测试。你可以配置每次发布触发这个动作,每次拉请求。或任何 GitHub 工作流触发事件。该操作的示例配置如下所示。

代码语言:javascript
复制
 name: Meshery SMP Action
on:
  push:
    branches:
      'master'

jobs:
  performance-test:
    name: Performance Test
    runs-on: ubuntu-latest
    steps:
      - name: checkout
        uses: actions/checkout@v2
        with:
          ref: 'perf'

      - name: Deploy k8s-minikube
        uses: manusa/actions-setup-minikube@v2.4.1
        with:
          minikube version: 'v1.21.0'
          kubernetes version: 'v1.20.7'
          driver: docker

      - name: Run Performance Test
        uses: layer5io/meshery-smp-action@master
        with:
          provider_token: $
          platform: docker
          profile_name: soak-test

你还可以在 SMP 兼容的配置文件中定义你的测试配置,如下所示。

代码语言:javascript
复制
smp_version: v0.0.1
id:
name: Istio Performance Test
labels: {}
clients:
- internal: false
  load_generator: fortio
  protocol: 1
  connections: 2
  rps: 10
  headers: {}
  cookies: {}
  body: ""
  content_type: ""
  endpoint_urls:
  - http://localhost:2323/productpage
duration: "30m"

查看 GitHub 工作流示例(action.yml[13])了解更多配置细节。

测试的结果会在 Meshery 中的 Performance Management 仪表板上更新。要了解更多关于解释测试结果的信息,请查看本指南[14]。你可以参考Meshery 用户指南[15]来深入研究这些功能。

参考资料

[1]Service Mesh Performance: https://smp-spec.io/

[2]Service Mesh Interface: https://smi-spec.io/

[3]Meshery: https://meshery.io/

[4]大量(10+)服务网格: https://layer5.io/service-mesh-landscape

[5]Meshery SMI 一致性操作: https://github.com/layer5io/meshery-smi-conformance-action

[6]SMI 标准: https://meshery.io/blog/validating-smi-conformance-with-meshery

[7]SMI 一致性仪表板: https://meshery.io/service-mesh-interface

[8]Meshery SMP 操作: https://github.com/layer5io/meshery-smp-action

[9]SMP 兼容性能基准测试: https://docs.meshery.io/functionality/performance-management

[10]Meshery 文档: https://docs.meshery.io/functionality/service-mesh-interface

[11]SMI 一致性 GitHub 操作: https://github.com/marketplace/actions/service-mesh-interface-conformance-with-meshery

[12]SMP GitHub 操作: https://github.com/marketplace/actions/performance-testing-with-meshery

[13]action.yml: https://github.com/layer5io/meshery-smp-action/blob/master/action.yml

[14]指南: https://docs.meshery.io/guides/interpreting-performance-test-results

[15]Meshery 用户指南: https://docs.meshery.io/guides

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2022-02-22,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 CNCF 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • SMI 一致性 GitHub 操作
    • 使用 Meshery SMI 一致性 GitHub 操作
    • SMP GitHub 操作
      • 使用 Meshery SMP GitHub 操作
        • 参考资料
        相关产品与服务
        服务网格
        服务网格(Tencent Cloud Mesh, TCM),一致、可靠、透明的云原生应用通信网络管控基础平台。全面兼容 Istio,集成腾讯云基础设施,提供全托管服务化的支撑能力保障网格生命周期管理。IaaS 组网与监控组件开箱即用,跨集群、异构应用一致发现管理加速云原生迁移。
        领券
        问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档