当前位置: 首页 > news >正文

云原生网关部署新范式丨 Higress 发布 1.1 版本,支持脱离 K8s 部署

作者:澄潭

版本特性

Higress 1.1.0 版本已经 Release,K8s 环境下可以使用以下命令将 Higress 升级到最新版本:

kubectl apply -f https://github.com/alibaba/higress/releases/download/v1.1.0/customresourcedefinitions.gen.yaml
helm repo update
helm upgrade higress -n higress-system higress.io/higress

下面介绍该版本的核心特性:

支持非 K8s 部署

在 K8s 部署模式下,Higress 已经支持基于 Nacos 进行服务发现,可以打通 Spring Cloud/Dubbo 等微服务生态。Nacos 作为微服务生态的集大成者,既可以作为注册中心,又可以作为配置中心,在非 K8s 环境下,如果将路由、插件等配置存入 Nacos 中,用户只需一个 Higress 和一个 Nacos 即可搞定一切:

在这里插入图片描述

在 1.1 版本中,Higress 就实现了这个能力,如上图所示,在这个架构中,Nacos 同时可以作为路由配置来源和服务 IP 来源,因为在 Nacos 中存储路由配置也是用了 Ingress API 这套基础 API 抽象,目前 Higress 在 K8s 上可以实现的能力,基于这套架构一样可以搞定。

使用一行命令即可完成非 K8s 环境下的部署(兼容 macOS 和 Linux,Windows 需要安装 Cygwin):

curl -fsSL https://higress.io/standalone/get-higress.sh | bash -s -- -c nacos://<nacos_addr>:8848

-c 参数用于指定非 K8s 场景下的配置存储来源,以 Nacos 为例,通过 nacos:// 指定即可,这种模式下,Higress 的所有配置都将存储在 Nacos 中,后续还将支持 ETCD/Consul等配置来源。

更多的参数可以通过 -h 参数查看,具体如下:

Usage: bash [DIR] [OPTIONS...]
Install Higress (standalone version) into the DIR (the current directory by default).-c, --config-url=URL       URL of the Nacos serviceformat: nacos://192.168.0.1:8848--use-builtin-nacos    use the built-in Nacos service instead ofan external one--nacos-ns=NACOS-NAMESPACEthe ID of Nacos namespace to store configurationsdefault to "higress-system" if unspecified--nacos-username=NACOS-USERNAMEthe username used to access Nacosonly needed if auth is enabled in Nacos--nacos-password=NACOS-PASSWORDthe password used to access Nacosonly needed if auth is enabled in Nacos-k, --data-enc-key=KEY     the key used to encrypt sensitive configurationsMUST contain 32 charactersA random key will be generated if unspecified-p, --console-password=CONSOLE-PASSWORDthe password to be used to visit Higress Consoledefault to "admin" if unspecified-h, --help                 give this help list

启动成功后,本机端口占用情况如下:

  • 80 端口:Higress Gateway 暴露,用于 HTTP 协议代理
  • 443 端口:Higress Gateway 暴露,用于 HTTPS 协议代理
  • 15020 端口:Higress Gateway 暴露,用于暴露 Prometheus 指标 (http://node_ip:15020/stats/prometheus)
  • 8080 端口:Higress Console 暴露,用于 Higress 控制台管理

让我们在本地启动一个 SpringCloud 服务注册到这个 Nacos 上:

在这里插入图片描述

在 Higress 控制台的服务列表也可以看到这个服务(Higress 默认配置监听启动参数指定的 Nacos 的 public 命名空间,可以在服务来源中新增其他命名空间):

在这里插入图片描述

创建路由指向这个服务:

在这里插入图片描述

测试路由成功:

在这里插入图片描述

Http to Dubbo 配置简化

在之前的版本里,使用 Http to Dubbo 的能力,需要开启 Istio CRD,然后通过 Envoyfilter 进行配置;新版本 Higress 增加了 Http2Rpc 这个 CRD,实现了 Http to Dubbo 的配置简化。

假设我们现在已经部署了如下一个 Dubbo 服务,其服务名为com.alibaba.nacos.example.dubbo.service.DemoService,并指定了该服务的 version 为“1.0.0”,group 为“dev”:

interface:

package com.alibaba.nacos.example.dubbo.service;public interface DemoService {String sayName(String name);
}

implement:

@DubboService(version = "${demo.service.version}", group = "${demo.service.group}")
public class DefaultService implements DemoService {@Value("${demo.service.name}")private String serviceName;public String sayName(String name) {RpcContext rpcContext = RpcContext.getContext();return String.format("Service [name :%s , port : %d] %s("%s") : Hello,%s",serviceName,rpcContext.getLocalPort(),rpcContext.getMethodName(),name,name);}
}

创建 Http2Rpc CRD

apiVersion: networking.higress.io/v1
kind: Http2Rpc
metadata:name: httproute-http2rpc-demonamespace: higress-system
spec:dubbo: service: com.alibaba.nacos.example.dubbo.service.DemoServiceversion: 1.0.0group: devmethods: - serviceMethod: sayNameheadersAttach: "*"httpMethods: - "GET"httpPath: "/dubbo/sayName"params:- paramKey: nameparamSource: QUERYparamType: "java.lang.String"

创建 Ingress 关联 Http2Rpc

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:annotations:higress.io/destination: providers:com.alibaba.nacos.example.dubbo.service.DemoService:1.0.0:dev.DEFAULT-GROUP.public.nacoshigress.io/rpc-destination-name: httproute-http2rpc-demoname: httproute-http2rpc-demo-ingressnamespace: higress-system
spec:ingressClassName: higressrules:- http:paths:- backend:resource:apiGroup: networking.higress.iokind: McpBridgename: defaultpath: /dubbopathType: Prefix

通过以上配置,我们就可以执行以下 curl 命令来调用这个 dubbo 服务了:

$curl "localhost/dubbo/sayName?name=abc" {"result":"Service [name :demoService , port : 20880] sayName("abc") : Hello,abc"}

支持 SkyWalking Tracing 配置

对 Higress 的全局配置 ConfigMap 对象 higress-config 做如下配置即可开启 SkyWalking Tracing:

apiVersion: v1
data:higress: |-tracing:enable: truesampling: 100timeout: 500skywalking:service: skywalking-oap-server.op-system.svc.cluster.localport: 11800
...
...
kind: ConfigMap
metadata:name: higress-confignamespace: higress-system

调用链路:

在这里插入图片描述

调用链路拓扑:

在这里插入图片描述

后续版本 Roadmap

目前确定的后续版本核心功能如下,欢迎在:https://github.com/alibaba/higress/issues/425 下提出你期待的功能,我们将实时更新后续 Roadmap。

在这里插入图片描述

社区近期活动

Wasm 插件编程挑战赛,赢取 12w 奖金池

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

了解详情:https://tianchi.aliyun.com/competition/entrance/532104/information

http://www.lryc.cn/news/98620.html

相关文章:

  • 【通讯录】--C语言
  • 通过两种实现方式理解CANoe TC8 demo是如何判断接收的以太网报文里的字段的
  • Mysql- 存储引擎
  • vite / nuxt3 项目使用define配置/自定义,可以使用process.env.xxx获取的环境变量
  • 在Linux、Ubuntu中跨平台编译ARM(AARCH64)平台的binutils
  • SpringCloudAlibaba微服务实战系列(五)Sentinel1.8.5+Nacos持久化
  • pytest中conftest的用法以及钩子基本使用
  • 数据结构---顺序栈、链栈
  • 我的MacBook Pro:维护心得与实用技巧
  • Higress非K8S安装
  • QT--day4(定时器事件、鼠标事件、键盘事件、绘制事件、实现画板、QT实现TCP服务器)
  • hjm家族信托科技研究报告
  • [SQL挖掘机] - 视图相关操作
  • 【Quartus FPGA】EMIF DDR3 读写带宽测试
  • Flutter:flutter_local_notifications——消息推送的学习
  • Spring AOP (面向切面编程)原理与代理模式—实例演示
  • 什么是SCRUM认证体系 ?
  • DoIP学习笔记系列:(二)VN5620 DoIP测试配置实践笔记
  • Grafana - TDEngine搭建数据监测报警系统
  • ES6基础知识二:ES6中数组新增了哪些扩展?
  • 使用CRM分析数据有哪些功能?
  • 大数据课程综合实验案例---课设问题汇总
  • 基于Vue+Element Plus实现表格组件
  • MYSQL 主从复制
  • 网络安全领域关键信息泄露事件引发关注
  • AI 绘画Stable Diffusion 研究(一)sd整合包v4.2 版本安装说明
  • 夯实数字化转型安全地基,华东某农商行开源安全治理经验
  • 第G3周:CGAN|生成手势图像
  • wireshark导出H264裸流
  • Sentinel针对IP限流