mirror of
https://github.com/alibaba/higress.git
synced 2026-05-26 05:37:25 +08:00
Feat: upgrade istio from 1.19.5 to 1.27.1 (#3066)
This commit is contained in:
@@ -12,21 +12,21 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// Updated based on Istio codebase by Higress
|
||||
|
||||
package istio
|
||||
|
||||
import (
|
||||
corev1 "k8s.io/api/core/v1"
|
||||
gateway "sigs.k8s.io/gateway-api/apis/v1beta1"
|
||||
|
||||
"github.com/alibaba/higress/v2/pkg/config/constants"
|
||||
higressconstants "github.com/alibaba/higress/v2/pkg/config/constants"
|
||||
)
|
||||
|
||||
// classInfo holds information about a gateway class
|
||||
type classInfo struct {
|
||||
// controller name for this class
|
||||
controller string
|
||||
// controller label for this class
|
||||
controllerLabel string
|
||||
// description for this class
|
||||
description string
|
||||
// The key in the templates to use for this class
|
||||
@@ -37,6 +37,15 @@ type classInfo struct {
|
||||
|
||||
// disableRouteGeneration, if set, will make it so the controller ignores this class.
|
||||
disableRouteGeneration bool
|
||||
|
||||
// supportsListenerSet declares whether a given class supports ListenerSet
|
||||
supportsListenerSet bool
|
||||
|
||||
// disableNameSuffix, if set, will avoid appending -<class> to names
|
||||
disableNameSuffix bool
|
||||
|
||||
// addressType is the default address type to report
|
||||
addressType gateway.AddressType
|
||||
}
|
||||
|
||||
var classInfos = getClassInfos()
|
||||
@@ -45,15 +54,25 @@ var builtinClasses = getBuiltinClasses()
|
||||
|
||||
func getBuiltinClasses() map[gateway.ObjectName]gateway.GatewayController {
|
||||
res := map[gateway.ObjectName]gateway.GatewayController{
|
||||
defaultClassName: constants.ManagedGatewayController,
|
||||
// Start - Commented by Higress
|
||||
// constants.RemoteGatewayClassName: constants.UnmanagedGatewayController,
|
||||
// End - Commented by Higress
|
||||
// Start - Updated by Higress
|
||||
//gateway.ObjectName(features.GatewayAPIDefaultGatewayClass): gateway.GatewayController(features.ManagedGatewayController),
|
||||
higressconstants.DefaultGatewayClass: higressconstants.ManagedGatewayController,
|
||||
// End - Updated by Higress
|
||||
}
|
||||
// Start - Commented by Higress
|
||||
//if features.EnableAmbientControllers {
|
||||
//if features.MultiNetworkGatewayAPI {
|
||||
// res[constants.RemoteGatewayClassName] = constants.UnmanagedGatewayController
|
||||
//}
|
||||
//
|
||||
//if features.EnableAmbientWaypoints {
|
||||
// res[constants.WaypointGatewayClassName] = constants.ManagedGatewayMeshController
|
||||
//}
|
||||
//
|
||||
//// N.B Ambient e/w gateways are just fancy waypoints, but we want a different
|
||||
//// GatewayClass for better UX
|
||||
//if features.EnableAmbientMultiNetwork {
|
||||
// res[constants.EastWestGatewayClassName] = constants.ManagedGatewayEastWestController
|
||||
//}
|
||||
// End - Commented by Higress
|
||||
return res
|
||||
}
|
||||
@@ -61,28 +80,55 @@ func getBuiltinClasses() map[gateway.ObjectName]gateway.GatewayController {
|
||||
func getClassInfos() map[gateway.GatewayController]classInfo {
|
||||
// Start - Updated by Higress
|
||||
m := map[gateway.GatewayController]classInfo{
|
||||
constants.ManagedGatewayController: {
|
||||
controller: constants.ManagedGatewayController,
|
||||
gateway.GatewayController(higressconstants.ManagedGatewayController): {
|
||||
controller: higressconstants.ManagedGatewayController,
|
||||
description: "The default Higress GatewayClass",
|
||||
templates: "kube-gateway",
|
||||
defaultServiceType: corev1.ServiceTypeLoadBalancer,
|
||||
//addressType: gateway.HostnameAddressType,
|
||||
//controllerLabel: constants.ManagedGatewayControllerLabel,
|
||||
//supportsListenerSet: true,
|
||||
},
|
||||
//UnmanagedGatewayController: {
|
||||
// // This represents a gateway that our control plane cannot discover directly via the API server.
|
||||
// // We shouldn't generate Istio resources for it. We aren't programming this gateway.
|
||||
// controller: UnmanagedGatewayController,
|
||||
// description: "Remote to this cluster. Does not deploy or affect configuration.",
|
||||
// disableRouteGeneration: true,
|
||||
//},
|
||||
}
|
||||
//if features.EnableAmbientControllers {
|
||||
// m[constants.ManagedGatewayMeshController] = classInfo{
|
||||
// controller: constants.ManagedGatewayMeshController,
|
||||
// description: "The default Istio waypoint GatewayClass",
|
||||
// templates: "waypoint",
|
||||
// defaultServiceType: corev1.ServiceTypeClusterIP,
|
||||
|
||||
//if features.MultiNetworkGatewayAPI {
|
||||
// m[constants.UnmanagedGatewayController] = classInfo{
|
||||
// // This represents a gateway that our control plane cannot discover directly via the API server.
|
||||
// // We shouldn't generate Istio resources for it. We aren't programming this gateway.
|
||||
// controller: constants.UnmanagedGatewayController,
|
||||
// description: "Remote to this cluster. Does not deploy or affect configuration.",
|
||||
// disableRouteGeneration: true,
|
||||
// addressType: gateway.HostnameAddressType,
|
||||
// supportsListenerSet: false,
|
||||
// }
|
||||
//}
|
||||
//if features.EnableAmbientWaypoints {
|
||||
// m[constants.ManagedGatewayMeshController] = classInfo{
|
||||
// controller: constants.ManagedGatewayMeshController,
|
||||
// description: "The default Istio waypoint GatewayClass",
|
||||
// templates: "waypoint",
|
||||
// disableNameSuffix: true,
|
||||
// defaultServiceType: corev1.ServiceTypeClusterIP,
|
||||
// supportsListenerSet: false,
|
||||
// // Report both. Consumers of the gateways can choose which they want.
|
||||
// // In particular, Istio across different versions consumes different address types, so this retains compat
|
||||
// addressType: "",
|
||||
// controllerLabel: constants.ManagedGatewayMeshControllerLabel,
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//if features.EnableAmbientMultiNetwork {
|
||||
// m[constants.ManagedGatewayEastWestController] = classInfo{
|
||||
// controller: constants.ManagedGatewayEastWestController,
|
||||
// description: "The default GatewayClass for Istio East West Gateways",
|
||||
// templates: "waypoint",
|
||||
// disableNameSuffix: true,
|
||||
// defaultServiceType: corev1.ServiceTypeLoadBalancer,
|
||||
// addressType: "",
|
||||
// controllerLabel: constants.ManagedGatewayEastWestControllerLabel,
|
||||
// }
|
||||
//}
|
||||
|
||||
// End - Updated by Higress
|
||||
return m
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user