From ceeb5474a99d578152066d4855316b5c50318d81 Mon Sep 17 00:00:00 2001 From: ximenchuifeng Date: Wed, 9 Sep 2026 07:54:13 +0800 Subject: [PATCH] =?UTF-8?q?feat(gateway):=20=E6=9B=B4=E6=96=B0=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E9=9B=86=E7=BE=A4=E6=94=AF=E6=92=91=E2=80=94=E2=80=94?= =?UTF-8?q?prepull=20Role=20+=20ArgoCD=20=E9=85=8D=E7=BD=AE=E5=8F=AF?= =?UTF-8?q?=E9=80=89=E6=B3=A8=E5=85=A5(=E6=9A=82=E9=A9=BB=E5=88=86?= =?UTF-8?q?=E6=94=AF=E4=B8=8D=E5=90=88=E5=B9=B6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - gateway-rbac 追加 gateway-prepull-manager Role/RoleBinding(daemonsets 增删查 + pods 只读,挂既有 gateway-sa):更新中心预拉取 DS 编排所需 - gateway Deployment 支持可选注入 gateway.updateCenter.argocdUrl / argocdTokenSecret → env Update__ArgoCd__*(缺省不注入 = 清单功能 503 降级) --- .../templates/gateway-rbac.yaml | 30 +++++++++++++++++++ .../mixingx-gateway/templates/gateway.yaml | 14 +++++++++ 2 files changed, 44 insertions(+) diff --git a/release-charts/mixingx-gateway/templates/gateway-rbac.yaml b/release-charts/mixingx-gateway/templates/gateway-rbac.yaml index f13bb41..21dee94 100644 --- a/release-charts/mixingx-gateway/templates/gateway-rbac.yaml +++ b/release-charts/mixingx-gateway/templates/gateway-rbac.yaml @@ -33,4 +33,34 @@ roleRef: subjects: - kind: ServiceAccount name: gateway-sa +--- +# 更新中心(ADR-0074 决策 7):预拉取 DaemonSet 编排——镜像提前铺到各节点, +# 客户点更新时新 Pod 命中本地缓存秒级切换。权限只有 daemonsets 增删查 + pods 只读。 +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: gateway-prepull-manager + labels: + app.kubernetes.io/component: gateway +rules: + - apiGroups: ["apps"] + resources: ["daemonsets"] + verbs: ["create", "get", "list", "delete"] + - apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: gateway-prepull-manager-binding + labels: + app.kubernetes.io/component: gateway +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: gateway-prepull-manager +subjects: + - kind: ServiceAccount + name: gateway-sa {{- end }} diff --git a/release-charts/mixingx-gateway/templates/gateway.yaml b/release-charts/mixingx-gateway/templates/gateway.yaml index dfdaf34..2cc0bd5 100644 --- a/release-charts/mixingx-gateway/templates/gateway.yaml +++ b/release-charts/mixingx-gateway/templates/gateway.yaml @@ -52,6 +52,20 @@ spec: fieldRef: fieldPath: metadata.namespace {{- end }} + {{- /* 更新中心(ADR-0074):ArgoCD 只读访问(镜像清单);缺省不注入 = 清单功能 503 降级 */}} + {{- with .Values.gateway.updateCenter }} + {{- with .argocdUrl }} + - name: Update__ArgoCd__BaseUrl + value: {{ . | quote }} + {{- end }} + {{- with .argocdTokenSecret }} + - name: Update__ArgoCd__Token + valueFrom: + secretKeyRef: + name: {{ .name | quote }} + key: {{ .key | default "token" | quote }} + {{- end }} + {{- end }} livenessProbe: httpGet: path: /health