支持 Gateway API 状态同步
1.Kubernetes Service 同步状态时,会校验服务是否存在
2.对于 Higress 支持的服务来源(group 为 networking.higress.io)同步状态时,不会校验服务是否存在
3.不支持 ServiceImport 和 Hostname
支持 Gateway API 状态同步
1.Kubernetes Service 同步状态时,会校验服务是否存在
2.对于 Higress 支持的服务来源(group 为 networking.higress.io)同步状态时,不会校验服务是否存在
3.不支持 ServiceImport 和 Hostname
当前进度:
待解决问题:
conversion_test.go中的三个单元测试问题pkg/ingress/kube/gateway/istio/context.go中的GetService()方法需支持ServiceEntry查询待确认问题:
networking.higress.io)的状态同步功能
@hanxiantao 支持 serviceEntry parent 是 Service Mesh 场景,higress这侧不需要实现
尝试将 Higress 中的 sigs.k8s.io/gateway-api 升级至 v1.1.0,目前可能暂时无法独立升级
gateway 包下新增 schema/a/collections 对应 istio 的 pkg/config/schema/collections 目录
pkg/ingress/kube/gateway/schema/collections/collections.go 文件对应 istio 的 pkg/config/schema/collections/collections.gen.go
将其中 gateway-api 相关资源进行替换,如:
老版本 HTTPRoute:
HTTPRoute = resource.Builder{
Identifier: "HTTPRoute",
Group: "gateway.networking.k8s.io",
Kind: "HTTPRoute",
Plural: "httproutes",
Version: "v1beta1",
VersionAliases: []string{
"v1alpha2",
},
Proto: "k8s.io.gateway_api.api.v1alpha1.HTTPRouteSpec", StatusProto: "k8s.io.gateway_api.api.v1alpha1.HTTPRouteStatus",
ReflectType: reflect.TypeOf(&sigsk8siogatewayapiapisv1beta1.HTTPRouteSpec{}).Elem(), StatusType: reflect.TypeOf(&sigsk8siogatewayapiapisv1beta1.HTTPRouteStatus{}).Elem(),
ProtoPackage: "sigs.k8s.io/gateway-api/apis/v1beta1", StatusPackage: "sigs.k8s.io/gateway-api/apis/v1beta1",
ClusterScoped: false,
Synthetic: false,
Builtin: false,
ValidateProto: validation.ValidateHTTPRoute,
}.MustBuild()
新版本 HTTPRoute:
HTTPRoute = resource.Builder{
Identifier: "HTTPRoute",
Group: "gateway.networking.k8s.io",
Kind: "HTTPRoute",
Plural: "httproutes",
Version: "v1beta1",
VersionAliases: []string{
"v1alpha2",
"v1",
},
Proto: "k8s.io.gateway_api.api.v1alpha1.HTTPRouteSpec", StatusProto: "k8s.io.gateway_api.api.v1alpha1.HTTPRouteStatus",
ReflectType: reflect.TypeOf(&sigsk8siogatewayapiapisv1beta1.HTTPRouteSpec{}).Elem(), StatusType: reflect.TypeOf(&sigsk8siogatewayapiapisv1beta1.HTTPRouteStatus{}).Elem(),
ProtoPackage: "sigs.k8s.io/gateway-api/apis/v1beta1", StatusPackage: "sigs.k8s.io/gateway-api/apis/v1beta1",
ClusterScoped: false,
Synthetic: false,
Builtin: false,
ValidateProto: nil,
}.MustBuild()
pkg/ingress/kube/gateway/controller.go 中对应 pkg/ingress/kube/gateway/schema/collections 的引用调整为 github.com/alibaba/higress/pkg/ingress/kube/gateway/schema/collections
相关代码见:
https://github.com/hanxiantao/higress/commit/eafb82783df274bd5abb676ab54430820490edb1
主要问题目前使用的 Istio 版本中 sigs.k8s.io/gateway-api/apis/v1alpha2/validation 中引用了 sigs.k8s.io/gateway-api/apis/v1alpha2/validation(低版本 gateway-api 中包含,新版本中不包含),Higress 中很多地方间接引用了 sigs.k8s.io/gateway-api/apis/v1alpha2/validation(例如引用 istio.io/istio/pilot/pkg/model),导致 gateway-api 目前无法独立升级
@hanxiantao 我还是倾向于 higress 独立与 istio 依赖,可以独立更新 gateway api,你说的这处依赖看能否直接调整这个fork仓库中的逻辑来解决 https://github.com/higress-group/pkg
通过 patch 这种方式修改 istio 代码的应该是可以的,这个我后续尝试下