From 3cad414953c7c41f863d01b857f17864006043f4 Mon Sep 17 00:00:00 2001 From: ximenchuifeng Date: Fri, 3 Jul 2026 16:10:35 +0800 Subject: [PATCH] feat(edge): manage demo edges with applicationset --- README.md | 10 ++++- applications/edge-demo.yaml | 25 ----------- applications/edges.yaml | 44 +++++++++++++++++++ ...mo-values.yaml => edge-common-values.yaml} | 4 -- 4 files changed, 52 insertions(+), 31 deletions(-) delete mode 100644 applications/edge-demo.yaml create mode 100644 applications/edges.yaml rename environments/demo/{edge-demo-values.yaml => edge-common-values.yaml} (93%) diff --git a/README.md b/README.md index d6d873f..2bcaca2 100644 --- a/README.md +++ b/README.md @@ -17,11 +17,13 @@ Demo environment: 2. Apply or create `bootstrap/mixingx-demo-root.yaml`. 3. Argo CD will create/sync the applications under `applications/`. -Agent fleet: +Agent and edge fleets: - `applications/agents.yaml` is an Argo CD ApplicationSet. +- `applications/edges.yaml` is an Argo CD ApplicationSet. - `environments/demo/agent-common-values.yaml` contains shared Helm values for all agents. -- Add or remove agent instances by editing `spec.generators[0].list.elements` in `applications/agents.yaml`. +- `environments/demo/edge-common-values.yaml` contains shared Helm values for all edges. +- Add or remove agent or edge instances by editing `spec.generators[0].list.elements` in the matching ApplicationSet. - Prefer `nodeLabel` over `nodeName`; label the target node so Kubernetes scheduler can still bind local-path PVCs. Example: @@ -34,4 +36,8 @@ kubectl label node node1 mixingx.io/edge-node=shanghai - id: shanghai description: Shanghai Agent nodeLabel: shanghai + +- id: beijing + description: Beijing Edge + nodeLabel: beijing ``` diff --git a/applications/edge-demo.yaml b/applications/edge-demo.yaml deleted file mode 100644 index 0f965ed..0000000 --- a/applications/edge-demo.yaml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: mixingx-edge-demo - namespace: argocd -spec: - project: default - sources: - - repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git - targetRevision: master - path: release-charts/mixingx-edge-unit - helm: - releaseName: mixingx-edge-demo - valueFiles: - - $values/environments/demo/edge-demo-values.yaml - - repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git - targetRevision: master - ref: values - destination: - server: https://kubernetes.default.svc - namespace: mixingx - syncPolicy: - syncOptions: - - CreateNamespace=true - diff --git a/applications/edges.yaml b/applications/edges.yaml new file mode 100644 index 0000000..9b6894e --- /dev/null +++ b/applications/edges.yaml @@ -0,0 +1,44 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: mixingx-edges + namespace: argocd +spec: + goTemplate: true + goTemplateOptions: + - missingkey=error + generators: + - list: + elements: + - id: demo + description: Demo Edge + nodeLabel: "" + template: + metadata: + name: 'mixingx-edge-{{ .id }}' + spec: + project: default + sources: + - repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git + targetRevision: master + path: release-charts/mixingx-edge-unit + helm: + releaseName: 'mixingx-edge-{{ .id }}' + valueFiles: + - $values/environments/demo/edge-common-values.yaml + values: | + site: "{{ .id }}" + description: "{{ .description }}" + {{- if .nodeLabel }} + nodeSelector: + mixingx.io/edge-node: "{{ .nodeLabel }}" + {{- end }} + - repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git + targetRevision: master + ref: values + destination: + server: https://kubernetes.default.svc + namespace: mixingx + syncPolicy: + syncOptions: + - CreateNamespace=true diff --git a/environments/demo/edge-demo-values.yaml b/environments/demo/edge-common-values.yaml similarity index 93% rename from environments/demo/edge-demo-values.yaml rename to environments/demo/edge-common-values.yaml index e2034b0..c74148f 100644 --- a/environments/demo/edge-demo-values.yaml +++ b/environments/demo/edge-common-values.yaml @@ -2,9 +2,6 @@ registry: 192.168.1.105:8888/mixingx tag: kube-node-frontend-refactor-design-202607030337-36 timezone: Asia/Shanghai -site: demo -description: "Demo Edge" - storage: className: local-path size: 5Gi @@ -29,4 +26,3 @@ sharedInfra: port: 5672 username: guest password: guest -