Default set ingress class as higress and enable ingress status. (#155)

This commit is contained in:
Yang
2023-02-02 15:18:04 +08:00
committed by GitHub
parent 5ae9151d37
commit 1092402516
6 changed files with 47 additions and 12 deletions

View File

@@ -28,6 +28,7 @@ import (
"istio.io/pkg/version" "istio.io/pkg/version"
"github.com/alibaba/higress/pkg/bootstrap" "github.com/alibaba/higress/pkg/bootstrap"
innerconstants "github.com/alibaba/higress/pkg/config/constants"
) )
var ( var (
@@ -93,8 +94,8 @@ func init() {
serveCmd.PersistentFlags().StringVar(&serverArgs.GatewaySelectorKey, "gatewaySelectorKey", "higress", "gateway resource selector label key") serveCmd.PersistentFlags().StringVar(&serverArgs.GatewaySelectorKey, "gatewaySelectorKey", "higress", "gateway resource selector label key")
serveCmd.PersistentFlags().StringVar(&serverArgs.GatewaySelectorValue, "gatewaySelectorValue", "higress-gateway", "gateway resource selector label value") serveCmd.PersistentFlags().StringVar(&serverArgs.GatewaySelectorValue, "gatewaySelectorValue", "higress-gateway", "gateway resource selector label value")
serveCmd.PersistentFlags().BoolVar(&serverArgs.EnableStatus, "enableStatus", false, "enable the ingress status syncer which use to update the ip in ingress's status") serveCmd.PersistentFlags().BoolVar(&serverArgs.EnableStatus, "enableStatus", true, "enable the ingress status syncer which use to update the ip in ingress's status")
serveCmd.PersistentFlags().StringVar(&serverArgs.IngressClass, "ingressClass", "", "if not empty, only watch the ingresses have the specified class, otherwise watch all ingresses") serveCmd.PersistentFlags().StringVar(&serverArgs.IngressClass, "ingressClass", innerconstants.DefaultIngressClass, "if not empty, only watch the ingresses have the specified class, otherwise watch all ingresses")
serveCmd.PersistentFlags().StringVar(&serverArgs.WatchNamespace, "watchNamespace", "", "if not empty, only wath the ingresses in the specified namespace, otherwise watch in all namespacees") serveCmd.PersistentFlags().StringVar(&serverArgs.WatchNamespace, "watchNamespace", "", "if not empty, only wath the ingresses in the specified namespace, otherwise watch in all namespacees")
serveCmd.PersistentFlags().BoolVar(&serverArgs.Debug, "debug", serverArgs.Debug, "if true, enables more debug http api") serveCmd.PersistentFlags().BoolVar(&serverArgs.Debug, "debug", serverArgs.Debug, "if true, enables more debug http api")
serveCmd.PersistentFlags().StringVar(&serverArgs.HttpAddress, "httpAddress", serverArgs.HttpAddress, "the http address") serveCmd.PersistentFlags().StringVar(&serverArgs.HttpAddress, "httpAddress", serverArgs.HttpAddress, "the http address")

View File

@@ -169,10 +169,10 @@ spec:
- "serve" - "serve"
- --gatewaySelectorKey=higress - --gatewaySelectorKey=higress
- --gatewaySelectorValue={{ .Release.Namespace }}-{{ include "gateway.name" . }} - --gatewaySelectorValue={{ .Release.Namespace }}-{{ include "gateway.name" . }}
{{- if not .Values.enableStatus }}
- --enableStatus={{ .Values.enableStatus }} - --enableStatus={{ .Values.enableStatus }}
{{- if .Values.ingressClass }}
- --ingressClass={{ .Values.ingressClass }}
{{- end }} {{- end }}
- --ingressClass={{ .Values.ingressClass }}
{{- if .Values.watchNamespace }} {{- if .Values.watchNamespace }}
- --watchNamespace={{ .Values.watchNamespace }} - --watchNamespace={{ .Values.watchNamespace }}
{{- end }} {{- end }}

View File

@@ -318,9 +318,17 @@ global:
# mechanisms (e.g., environmental variable CA_PROVIDER). # mechanisms (e.g., environmental variable CA_PROVIDER).
caName: "" caName: ""
hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress
ingressClass: ""
# IngressClass filters which ingress resources the higress controller watches.
# The default ingress class is higress.
# There are some special cases for special ingress class.
# 1. When the ingress class is set as nginx, the higress controller will watch ingress
# resources with the nginx ingress class or without any ingress class.
# 2. When the ingress class is set empty, the higress controller will watch all ingress
# resources in the k8s cluster.
ingressClass: "higress"
watchNamespace: "" watchNamespace: ""
enableStatus: false enableStatus: true
clusterName: "" clusterName: ""
# meshConfig defines runtime configuration of components, including Istiod and istio-agent behavior # meshConfig defines runtime configuration of components, including Istiod and istio-agent behavior
# See https://istio.io/docs/reference/config/istio.mesh.v1alpha1/ for all available options # See https://istio.io/docs/reference/config/istio.mesh.v1alpha1/ for all available options

View File

@@ -88,12 +88,20 @@ type RegistryOptions struct {
} }
type ServerArgs struct { type ServerArgs struct {
Debug bool Debug bool
MeshId string MeshId string
RegionId string RegionId string
NativeIstio bool NativeIstio bool
HttpAddress string HttpAddress string
GrpcAddress string GrpcAddress string
// IngressClass filters which ingress resources the higress controller watches.
// The default ingress class is higress.
// There are some special cases for special ingress class.
// 1. When the ingress class is set as nginx, the higress controller will watch ingress
// resources with the nginx ingress class or without any ingress class.
// 2. When the ingress class is set empty, the higress controller will watch all ingress
// resources in the k8s cluster.
IngressClass string IngressClass string
EnableStatus bool EnableStatus bool
WatchNamespace string WatchNamespace string

View File

@@ -0,0 +1,17 @@
// Copyright (c) 2022 Alibaba Group Holding Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package constants
const DefaultIngressClass = "higress"

View File

@@ -18,6 +18,7 @@ metadata:
name: higress-conformance-infra-test name: higress-conformance-infra-test
namespace: higress-conformance-infra namespace: higress-conformance-infra
spec: spec:
ingressClassName: higress
rules: rules:
- http: - http:
paths: paths: