feat(agent): manage demo agents with applicationset
This commit is contained in:
1 parent
144398029f
commit
a67c251486
4 files changed
+62
-29
No files matched your search
@@ -17,3 +17,21 @@ Demo environment:
|
|||||||
2. Apply or create `bootstrap/mixingx-demo-root.yaml`.
|
2. Apply or create `bootstrap/mixingx-demo-root.yaml`.
|
||||||
3. Argo CD will create/sync the applications under `applications/`.
|
3. Argo CD will create/sync the applications under `applications/`.
|
||||||
|
|
||||||
|
Agent fleet:
|
||||||
|
|
||||||
|
- `applications/agents.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`.
|
||||||
|
- Prefer `nodeLabel` over `nodeName`; label the target node so Kubernetes scheduler can still bind local-path PVCs.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl label node node1 mixingx.io/edge-node=shanghai
|
||||||
|
```
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- id: shanghai
|
||||||
|
description: Shanghai Agent
|
||||||
|
nodeLabel: shanghai
|
||||||
|
```
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
apiVersion: argoproj.io/v1alpha1
|
|
||||||
kind: Application
|
|
||||||
metadata:
|
|
||||||
name: mixingx-agent-demo
|
|
||||||
namespace: argocd
|
|
||||||
spec:
|
|
||||||
project: default
|
|
||||||
sources:
|
|
||||||
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
|
||||||
targetRevision: master
|
|
||||||
path: release-charts/mixingx-agent-unit
|
|
||||||
helm:
|
|
||||||
releaseName: mixingx-agent-demo
|
|
||||||
valueFiles:
|
|
||||||
- $values/environments/demo/agent-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
|
|
||||||
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: ApplicationSet
|
||||||
|
metadata:
|
||||||
|
name: mixingx-agents
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
goTemplate: true
|
||||||
|
goTemplateOptions:
|
||||||
|
- missingkey=error
|
||||||
|
generators:
|
||||||
|
- list:
|
||||||
|
elements:
|
||||||
|
- id: demo
|
||||||
|
description: Demo Agent
|
||||||
|
nodeLabel: ""
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
name: 'mixingx-agent-{{ .id }}'
|
||||||
|
spec:
|
||||||
|
project: default
|
||||||
|
sources:
|
||||||
|
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
|
||||||
|
targetRevision: master
|
||||||
|
path: release-charts/mixingx-agent-unit
|
||||||
|
helm:
|
||||||
|
releaseName: 'mixingx-agent-{{ .id }}'
|
||||||
|
valueFiles:
|
||||||
|
- $values/environments/demo/agent-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
|
||||||
@@ -2,9 +2,6 @@ registry: 192.168.1.105:8888/mixingx
|
|||||||
tag: kube-node-frontend-refactor-design-202607030337-36
|
tag: kube-node-frontend-refactor-design-202607030337-36
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
|
||||||
site: demo
|
|
||||||
description: "Demo Agent"
|
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
className: local-path
|
className: local-path
|
||||||
size: 5Gi
|
size: 5Gi
|
||||||
@@ -29,4 +26,3 @@ sharedInfra:
|
|||||||
port: 5672
|
port: 5672
|
||||||
username: guest
|
username: guest
|
||||||
password: guest
|
password: guest
|
||||||
|
|
||||||
Reference in new issue
Block a user