diff --git a/Makefile.core.mk b/Makefile.core.mk index a9e38a614..42cde6592 100644 --- a/Makefile.core.mk +++ b/Makefile.core.mk @@ -100,7 +100,28 @@ external/package/envoy.tar.gz: build-gateway: prebuild external/package/envoy.tar.gz cd external/istio; GOOS_LOCAL=linux TARGET_OS=linux TARGET_ARCH=amd64 BUILD_WITH_CONTAINER=1 DOCKER_BUILD_VARIANTS=default DOCKER_TARGETS="docker.proxyv2" make docker +pre-install: + cp api/kubernetes/customresourcedefinitions.gen.yaml helm/higress/crds + cd helm/istio; helm dependency update + cd helm/kind/higress; helm dependency update + cd helm/kind/istio; helm dependency update + +define create_ns + kubectl get namespace | grep $(1) || kubectl create namespace $(1) +endef + +install: pre-install + $(call create_ns,istio-system) + $(call create_ns,higress-system) + helm install istio helm/kind/istio -n istio-system + helm install higress helm/kind/higress -n higress-system + +upgrade: pre-install + helm upgrade istio helm/kind/istio -n istio-system + helm upgrade higress helm/kind/higress -n higress-system + helm-push: + cp api/kubernetes/customresourcedefinitions.gen.yaml helm/higress/crds cd helm; tar -zcf higress.tgz higress; helm push higress.tgz "oci://$(CHARTS)" helm-push-istio: diff --git a/helm/higress/Chart.yaml b/helm/higress/Chart.yaml index 6094aac54..2a19f9663 100644 --- a/helm/higress/Chart.yaml +++ b/helm/higress/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 0.5.2 +appVersion: 0.5.3 description: Helm chart for deploying higress gateways icon: https://higress.io/img/higress_logo_small.png keywords: @@ -9,4 +9,4 @@ name: higress sources: - http://github.com/alibaba/higress type: application -version: 0.5.2 +version: 0.5.3 diff --git a/helm/higress/crds/customresourcedefinitions.gen.yaml b/helm/higress/crds/customresourcedefinitions.gen.yaml new file mode 100644 index 000000000..77e5d4e86 --- /dev/null +++ b/helm/higress/crds/customresourcedefinitions.gen.yaml @@ -0,0 +1,71 @@ +# DO NOT EDIT - Generated by Cue OpenAPI generator based on Istio APIs. +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + "helm.sh/resource-policy": keep + name: mcpbridges.networking.higress.io +spec: + group: networking.higress.io + names: + categories: + - higress-io + kind: McpBridge + listKind: McpBridgeList + plural: mcpbridges + singular: mcpbridge + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + properties: + spec: + properties: + registries: + items: + properties: + consulNamespace: + type: string + domain: + type: string + nacosAccessKey: + type: string + nacosAddressServer: + type: string + nacosGroups: + items: + type: string + type: array + nacosNamespace: + type: string + nacosNamespaceId: + type: string + nacosRefreshInterval: + format: int64 + type: integer + nacosSecretKey: + type: string + name: + type: string + port: + type: integer + type: + type: string + zkServicesPath: + items: + type: string + type: array + type: object + type: array + type: object + status: + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + served: true + storage: true + subresources: + status: {} + +--- diff --git a/helm/higress/crds/mcp-bridge.yaml b/helm/higress/crds/mcp-bridge.yaml deleted file mode 100644 index 74e1c9979..000000000 --- a/helm/higress/crds/mcp-bridge.yaml +++ /dev/null @@ -1,97 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.7.0 - creationTimestamp: null - name: mcpbridges.istio.aliyun.cloud.com -spec: - group: istio.aliyun.cloud.com - names: - kind: McpBridge - listKind: McpBridgeList - plural: mcpbridges - singular: mcpbridge - scope: Namespaced - versions: - - name: v1 - schema: - openAPIV3Schema: - description: McpBridge is the Schema for the mcpbridges API - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: McpBridgeSpec defines the desired state of McpBridge - properties: - registries: - items: - properties: - consulNamespace: - type: string - domain: - type: string - nacosAccessKey: - type: string - nacosAddressServer: - type: string - nacosGroups: - items: - type: string - type: array - nacosNamespace: - type: string - nacosNamespaceId: - type: string - nacosRefreshInterval: - description: A Duration represents the elapsed time between - two instants as an int64 nanosecond count. The representation - limits the largest representable duration to approximately - 290 years. - format: int64 - type: integer - nacosScretKey: - type: string - name: - type: string - port: - format: int64 - type: integer - type: - type: string - zkServicesPath: - items: - type: string - type: array - required: - - domain - - port - - type - type: object - type: array - type: object - status: - description: McpBridgeStatus defines the observed state of McpBridge - type: object - type: object - served: true - storage: true - subresources: - status: {} -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/helm/higress/templates/controller-clusterrole.yaml b/helm/higress/templates/controller-clusterrole.yaml index 56b195397..e13b53479 100644 --- a/helm/higress/templates/controller-clusterrole.yaml +++ b/helm/higress/templates/controller-clusterrole.yaml @@ -38,7 +38,7 @@ rules: resources: ["secrets"] verbs: ["get", "watch", "list"] - - apiGroups: ["istio.aliyun.cloud.com"] + - apiGroups: ["networking.higress.io"] resources: ["mcpbridges"] verbs: ["get", "list", "watch", "create", "update", "patch", "delete"] diff --git a/helm/higress/values.yaml b/helm/higress/values.yaml index cb1dd0c61..6785a87fc 100644 --- a/helm/higress/values.yaml +++ b/helm/higress/values.yaml @@ -14,7 +14,7 @@ gateway: name: "higress-gateway" replicas: 2 image: gateway - tag: "268c73301e78514552fe0576fb0059c42c854a5c" + tag: "bf607ae5541ce5c1cc95b4f98b3fd50a83346d33" # revision declares which revision this gateway is a part of revision: "" @@ -111,7 +111,7 @@ controller: name: "higress-controller" replicas: 1 image: higress - tag: "268c73301e78514552fe0576fb0059c42c854a5c" + tag: "bf607ae5541ce5c1cc95b4f98b3fd50a83346d33" env: {} labels: {} diff --git a/helm/istio/Chart.yaml b/helm/istio/Chart.yaml index 37cd21bce..f596a3a88 100644 --- a/helm/istio/Chart.yaml +++ b/helm/istio/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 1.12.2 +appVersion: 1.12.3 description: Helm chart for deploying higress istio name: istio sources: @@ -12,4 +12,4 @@ dependencies: repository: "file://../istiod" version: 1.12.0 type: application -version: 1.12.2 +version: 1.12.3 diff --git a/helm/istiod/values.yaml b/helm/istiod/values.yaml index e6e7d2e58..061bd46a2 100644 --- a/helm/istiod/values.yaml +++ b/helm/istiod/values.yaml @@ -10,7 +10,7 @@ pilot: rollingMaxUnavailable: 25% hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress - tag: 268c73301e78514552fe0576fb0059c42c854a5c + tag: bf607ae5541ce5c1cc95b4f98b3fd50a83346d33 # Can be a full hub/image:tag image: pilot @@ -254,7 +254,7 @@ global: # Dev builds from prow are on gcr.io hub: higress-registry.cn-hangzhou.cr.aliyuncs.com/higress # Default tag for Istio images. - tag: 268c73301e78514552fe0576fb0059c42c854a5c + tag: bf607ae5541ce5c1cc95b4f98b3fd50a83346d33 # Specify image pull policy if default behavior isn't desired. # Default behavior: latest images will be Always else IfNotPresent. diff --git a/helm/kind/higress/Chart.lock b/helm/kind/higress/Chart.lock index 11754958a..2962749d7 100644 --- a/helm/kind/higress/Chart.lock +++ b/helm/kind/higress/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: higress repository: file://../../higress - version: 0.5.2 -digest: sha256:414ef7a78a25d8f25d1f643edf4c8e59f74ecaa51a5ae4e4bff3000472b08fdb -generated: "2022-11-13T13:39:25.948896+08:00" + version: 0.5.3 +digest: sha256:31fd001a558b73f3a5b86d607ccf2c4ff7f206fc232068cfc6722ccd02081031 +generated: "2022-12-16T17:21:23.630507+08:00" diff --git a/helm/kind/higress/Chart.yaml b/helm/kind/higress/Chart.yaml index 34452be1f..7962156d3 100644 --- a/helm/kind/higress/Chart.yaml +++ b/helm/kind/higress/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 0.5.2 +appVersion: 0.5.3 description: Helm chart for deploying higress gateways icon: https://higress.io/img/higress_logo_small.png keywords: @@ -11,6 +11,6 @@ sources: dependencies: - name: higress repository: "file://../../higress" - version: 0.5.2 + version: 0.5.3 type: application -version: 0.5.2 +version: 0.5.3 diff --git a/helm/kind/istio/Chart.yaml b/helm/kind/istio/Chart.yaml index 729013144..104652c83 100644 --- a/helm/kind/istio/Chart.yaml +++ b/helm/kind/istio/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -appVersion: 1.12.2 +appVersion: 1.12.3 description: Helm chart for deploying higress istio name: istio-local sources: @@ -12,4 +12,4 @@ dependencies: repository: "file://../../istiod" version: 1.12.0 type: application -version: 1.12.2 +version: 1.12.3 diff --git a/pkg/ingress/config/ingress_config.go b/pkg/ingress/config/ingress_config.go index 97d427748..4429b34fe 100644 --- a/pkg/ingress/config/ingress_config.go +++ b/pkg/ingress/config/ingress_config.go @@ -106,8 +106,9 @@ func NewIngressConfig(localKubeClient kube.Client, XDSUpdater model.XDSUpdater, clusterId: clusterId, globalGatewayName: namespace + "/" + common.CreateConvertedName(clusterId, "global"), - watchedSecretSet: sets.NewSet(), - namespace: namespace, + watchedSecretSet: sets.NewSet(), + namespace: namespace, + mcpbridgeReconciled: true, } mcpbridgeController := mcpbridge.NewController(localKubeClient, clusterId) mcpbridgeController.AddEventHandler(config.AddOrUpdateMcpBridge, config.DeleteMcpBridge) @@ -666,6 +667,9 @@ func (m *IngressConfig) AddOrUpdateMcpBridge(clusterNamespacedName util.ClusterN clusterNamespacedName.Namespace, clusterNamespacedName.Name) return } + m.mutex.Lock() + m.mcpbridgeReconciled = false + m.mutex.Unlock() if m.RegistryReconciler == nil { m.RegistryReconciler = reconcile.NewReconciler(func() { metadata := config.Meta{ diff --git a/pkg/ingress/kube/controller/model.go b/pkg/ingress/kube/controller/model.go index 8d08034bf..6828f8c5d 100644 --- a/pkg/ingress/kube/controller/model.go +++ b/pkg/ingress/kube/controller/model.go @@ -93,7 +93,7 @@ func (c *CommonController[lister]) Run(stop <-chan struct{}) { IngressLog.Errorf("Failed to sync %s controller cache", c.typeName) return } - IngressLog.Debugf("%s cache has synced") + IngressLog.Debugf("%s cache has synced", c.typeName) go wait.Until(c.worker, time.Second, stop) <-stop }