Author SHA1 Message Date
王野 e7a9d4a1a6 feat(agent): configure dedicated PostgreSQL runtime roles 2026-09-04 22:36:20 +08:00
薛佳帆 9499c2ac8d feat: 同步 basic-test 的 network-agent Application 与 values——与 develop/basic-test 170dc26 内容一致,随 develop 合入 master 2026-09-04 16:24:21 +08:00
ximenchuifeng bb5e699c77 feat(demo): 启用 audit Application(移出 disabled);audit-values 对齐 v2 chart;四服务开启 audit.publisher 2026-08-20 11:05:26 +08:00
薛佳帆 11d311748a feat: add opcua-diecast-params mock server 2026-08-11 14:31:11 +08:00
王野 699f4a6cb1 feat(audit): 审计服务配置更新为PostgreSQL数据库并添加MQTT支持
- 将审计服务从MongoDB迁移至PostgreSQL数据库
- 添加MQTT Broker (nanomq) 配置用于消息处理
- 配置JWT认证参数以集成SSO系统
- 增加数据库写入超时、并发消费等性能调优参数
- 更新平台配置文件中添加audit-nanomq数据存储组件
2026-08-06 18:33:37 +08:00
ximenchuifeng 44f382230e chore(agents): 移除 demo agent 实例(agent-demo postgres 卷满无法恢复)
agent-demo-postgres 的 5Gi Longhorn 卷满 + mxdev 磁盘异常导致
扩容卡住,postgres CrashLoop。移除该实例,保留 agent-demo-2。
2026-08-05 16:43:26 +08:00
ximenchuifeng fa73db2b9c chore(gitops): update agent image tags to develop-v.1.0.1-202608050748-25 [skip ci] 2026-08-05 07:50:03 +00:00
ximenchuifeng b007a2fde5 chore(gitops): update protocol image tags to develop-v.1.0.1-202608050747-15 [skip ci] 2026-08-05 07:47:57 +00:00
ximenchuifeng e35900f219 chore(gitops): update ultra image tags to develop-v.1.0.1-202608050746-12 [skip ci] 2026-08-05 07:46:57 +00:00
ximenchuifeng a0957377ab chore(gitops): update edge image tags to develop-v.1.0.1-202608050745-19 [skip ci] 2026-08-05 07:46:05 +00:00
ximenchuifeng 25ebffa020 chore(gitops): update image key images.gateway.tag to develop-v.1.0.1-202608050744-6 [skip ci] 2026-08-05 07:44:36 +00:00
ximenchuifeng d05b231e83 chore(gitops): update sso image tags to develop-v.1.0.1-202608050742-21 [skip ci] 2026-08-05 07:43:55 +00:00
王野 6b1e47804a feat(config): 添加MQTT配置支持并更新镜像配置格式
- 在agent-common-values.yaml中添加mqttCredentials配置项
- 在edge-common-values.yaml中添加mqtt服务配置
- 将镜像配置从简单字符串格式更新为包含repository和tag的对象格式
- 为开发环境和演示环境统一应用MQTT相关配置
2026-08-05 15:11:35 +08:00
ximenchuifeng 421a2e8e31 feat(edge): 去 PG edge values 适配 2026-08-05 15:11:08 +08:00
ximenchuifeng 83f5d28d79 chore(gitops): update sso image tags to develop-v.1.0.1-202608050627-19 [skip ci] 2026-08-05 06:28:16 +00:00
ximenchuifeng 073b3a3bf3 chore(gitops): update sso image tags to develop-v.1.0.1-202608050624-17 [skip ci] 2026-08-05 06:25:09 +00:00
ximenchuifeng 877e3f33bf chore(gitops): update sso image tags to develop-v.1.0.1-202608050622-16 [skip ci] 2026-08-05 06:23:36 +00:00
ximenchuifeng 3676fac91b chore(gitops): update image key images.gateway.tag to develop-v.1.0.1-202608050524-5 [skip ci] 2026-08-05 05:25:33 +00:00
ximenchuifeng 482134dfc9 chore(gitops): update edge image tags to develop-v.1.0.1-202608050522-18 [skip ci] 2026-08-05 05:24:14 +00:00
ximenchuifeng 6ece72f728 chore(gitops): update ultra image tags to develop-v.1.0.1-202608050519-11 [skip ci] 2026-08-05 05:21:38 +00:00
ximenchuifeng 99c95bbf01 chore(gitops): update sso image tags to develop-v.1.0.1-202608050516-15 [skip ci] 2026-08-05 05:18:15 +00:00
ximenchuifeng 5007cbaa21 chore(gitops): update protocol image tags to develop-v.1.0.1-202608050508-14 [skip ci] 2026-08-05 05:16:00 +00:00
ximenchuifeng 5779875cc1 chore(gitops): update agent image tags to develop-v.1.0.1-202608050403-24 [skip ci] 2026-08-05 04:34:16 +00:00
24 changed files with 227 additions and 46 deletions

No files matched your search

@@ -0,0 +1,25 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: mixingx-network-agent
namespace: argocd
spec:
project: default
sources:
- repoURL: https://gitee.com/mixing-tech/mixingx.hub.chart.git
targetRevision: master
path: release-charts/mixingx-network-agent
helm:
releaseName: mixingx-network-agent
valueFiles:
- $values/environments/basic-test/image-version.yaml
- $values/environments/basic-test/network-agent-values.yaml
- repoURL: https://gitee.com/mixing-tech/mixingx.deploy.git
targetRevision: develop/basic-test
ref: values
destination:
server: https://kubernetes.default.svc
namespace: mixingx
syncPolicy:
syncOptions:
- CreateNamespace=true
+5
View File
@@ -35,6 +35,11 @@ spec:
site: "{{ .id }}" site: "{{ .id }}"
description: "{{ .description }}" description: "{{ .description }}"
phaseType: "{{ .phaseType }}" phaseType: "{{ .phaseType }}"
sharedInfra:
postgres:
appUsername: "{{ .databaseUsername }}"
credentialsSecret:
name: "{{ .postgresCredentialsSecret }}"
{{- if hasKey . "nodeLabel" }} {{- if hasKey . "nodeLabel" }}
nodeSelector: nodeSelector:
mixingx.io/edge-node: "{{ .nodeLabel }}" mixingx.io/edge-node: "{{ .nodeLabel }}"
File renamed without changes.
+1
View File
@@ -33,6 +33,7 @@ spec:
- $values/environments/demo/edge-common-values.yaml - $values/environments/demo/edge-common-values.yaml
values: | values: |
site: "{{ .id }}" site: "{{ .id }}"
idWorkerId: {{ .idWorkerId }}
description: "{{ .description }}" description: "{{ .description }}"
{{- if hasKey . "nodeLabel" }} {{- if hasKey . "nodeLabel" }}
nodeSelector: nodeSelector:
+5
View File
@@ -35,6 +35,11 @@ spec:
site: "{{ .id }}" site: "{{ .id }}"
description: "{{ .description }}" description: "{{ .description }}"
phaseType: "{{ .phaseType }}" phaseType: "{{ .phaseType }}"
sharedInfra:
postgres:
appUsername: "{{ .databaseUsername }}"
credentialsSecret:
name: "{{ .postgresCredentialsSecret }}"
{{- if .nodeLabel }} {{- if .nodeLabel }}
nodeSelector: nodeSelector:
mixingx.io/edge-node: "{{ .nodeLabel }}" mixingx.io/edge-node: "{{ .nodeLabel }}"
+1
View File
@@ -33,6 +33,7 @@ spec:
- $values/environments/dev/edge-common-values.yaml - $values/environments/dev/edge-common-values.yaml
values: | values: |
site: "{{ .id }}" site: "{{ .id }}"
idWorkerId: {{ .idWorkerId }}
description: "{{ .description }}" description: "{{ .description }}"
{{- if .nodeLabel }} {{- if .nodeLabel }}
nodeSelector: nodeSelector:
@@ -0,0 +1,12 @@
# network-agent(设备网络控制台):每节点 DaemonSet,提供主机网口与 WiFi 配置 API(:9750)
# 前置条件:节点已执行 chart 仓 scripts/provision-host.sh(安装并托管 NetworkManager)
image:
tag: develop-v.1.0.1-202609040715-3
# 鉴权令牌:为空 = 不鉴权(仅限内网联调)。
# 配置后前端弹窗请求头需带 Authorization: Bearer <token>(当前前端未实现,保持为空)
authToken: ""
corsOrigins: "*"
rollbackTimeoutSeconds: 60
k3sRestartOnIpChange: true
+10 -2
View File
@@ -16,9 +16,13 @@ images:
sharedInfra: sharedInfra:
postgres: postgres:
username: postgres adminUsername: postgres
password: "Admin12345"
port: 5432 port: 5432
idleInTransactionSessionTimeout: 60s
credentialsSecret:
adminPasswordKey: admin-password
appPasswordKey: app-password
connectionStringKey: connection-string
redis: redis:
host: redis-service host: redis-service
port: 6379 port: 6379
@@ -36,3 +40,7 @@ mqttCredentials:
- credentialRef: "edge-demo-2-mqtt" - credentialRef: "edge-demo-2-mqtt"
username: "" username: ""
password: "" password: ""
audit:
publisher:
enabled: true
@@ -0,0 +1,56 @@
# Agent PostgreSQL runtime role rollout
The demo Agent uses a dedicated PostgreSQL login. Passwords and the complete
connection string are stored only in a Kubernetes Secret and are not committed.
## Prepare the Secret
Load the administrator password already used by the Agent PostgreSQL instance
and a distinct application password from the approved vault into the operator
shell environment, then run:
```bash
AGENT_POSTGRES_ADMIN_PASSWORD='<from-vault>' \
AGENT_POSTGRES_APP_PASSWORD='<from-vault>' \
./scripts/upsert-agent-postgres-credentials.sh mixingx demo-2 agent_demo_2
```
The script is idempotent. Do not place either value in a values file, command
argument, or shell history. It writes short-lived mode-`0700` input files and
removes them on exit, so the values are not exposed through `kubectl` process
arguments. The generated Secret contains `admin-password`, `app-password`, and
a `connection-string` whose username is `agent_demo_2`.
## Roll out
1. Sync `mixingx-agent-demo-2` in Argo CD. The PostgreSQL StatefulSet consumes
the administrator password; the Agent init container waits for PostgreSQL,
provisions the runtime role, transfers existing `public` objects, and applies
the database-local timeout.
2. When rotating an existing Secret, restart the Agent deployment explicitly:
```bash
kubectl --namespace mixingx rollout restart deployment/agent-demo-2-deployment
kubectl --namespace mixingx rollout status deployment/agent-demo-2-deployment --timeout=300s
```
3. Verify the backend container receives only the application connection string.
The administrator login remains reserved for provisioning, backup, and manual
maintenance. Startup EF Core migrations run as the database-owning application
role; `statement_timeout` and `lock_timeout` are explicitly left unset.
## Verify
Run the following through a temporary `psql` Pod or an approved database client,
using the application credential from the Secret:
```sql
SHOW idle_in_transaction_session_timeout;
SHOW statement_timeout;
SHOW lock_timeout;
SELECT rolname, rolsuper, rolcreatedb, rolcreaterole
FROM pg_roles
WHERE rolname = current_user;
```
Expected values are `1min`, `0`, `0`, and all three privilege flags `false`.
+2 -3
View File
@@ -1,7 +1,6 @@
agents: agents:
- id: demo
description: Demo Agent
phaseType: DieCasting
- id: demo-2 - id: demo-2
description: Demo Agent 2 description: Demo Agent 2
phaseType: DieCasting phaseType: DieCasting
databaseUsername: agent_demo_2
postgresCredentialsSecret: agent-demo-2-postgres-credentials
+24 -11
View File
@@ -1,20 +1,33 @@
storage:
className: longhorn-platform
sharedInfra: sharedInfra:
mongo: postgres:
host: mongo-service image: 192.168.1.119:8888/docker-proxy/library/postgres:17
port: 27017 username: postgres
username: admin
password: "Admin12345" password: "Admin12345"
database: mixingx_audit port: 5432
rabbitmq:
host: messaging-service
port: 5672
username: guest
password: guest
otlp: otlp:
endpoint: http://k8s-dashboard-service:18889 endpoint: http://k8s-dashboard-service:18889
protocol: grpc protocol: grpc
audit: audit:
enabled: true enabled: true
port: 5600 port: 5900
replicas: 2 replicas: 2
database: audit-db
pgStorage: 5Gi
jwt:
ssoBaseUrl: "http://sso-service:8080"
mqtt:
image: "emqx/nanomq:0.25.2-2"
brokerHost: "audit-nanomq-service"
brokerPort: 1883
managementPort: 8081
managementUsername: "admin"
managementPassword: "public"
consume:
queueCapacity: 128
queueMaxWaitMs: 5000
dbWriteTimeoutMs: 3000
concurrency: 4
+4 -7
View File
@@ -10,15 +10,8 @@ images:
frontend: frontend:
repository: edge-web repository: edge-web
tag: "" tag: ""
postgres:
repository: 192.168.1.119:8888/docker-proxy/library/postgres
tag: "17"
sharedInfra: sharedInfra:
postgres:
username: postgres
password: "Admin12345"
port: 5432
redis: redis:
host: redis-service host: redis-service
port: 6379 port: 6379
@@ -33,3 +26,7 @@ mqtt:
image: image:
repository: emqx/nanomq repository: emqx/nanomq
tag: 0.25.2-2 tag: 0.25.2-2
audit:
publisher:
enabled: true
+2
View File
@@ -1,5 +1,7 @@
edges: edges:
- id: demo - id: demo
idWorkerId: 17
description: Demo Edge description: Demo Edge
- id: demo-2 - id: demo-2
idWorkerId: 18
description: Demo Edge 2 description: Demo Edge 2
+14 -14
View File
@@ -4,47 +4,47 @@ timezone: Asia/Shanghai
images: images:
gateway: gateway:
repository: gateway repository: gateway
tag: master-202607130641-4 tag: develop-v.1.0.1-202608050744-6
sso: sso:
repository: sso repository: sso
tag: develop-v.1.0.1-202607141448-14 tag: develop-v.1.0.1-202608050742-21
ssoWeb: ssoWeb:
repository: sso-web repository: sso-web
tag: develop-v.1.0.1-202607141448-14 tag: develop-v.1.0.1-202608050742-21
ultra: ultra:
repository: ultra repository: ultra
tag: develop-v.1.0.1-202607141448-10 tag: develop-v.1.0.1-202608050746-12
ultraWeb: ultraWeb:
repository: ultra-web repository: ultra-web
tag: develop-v.1.0.1-202607141448-10 tag: develop-v.1.0.1-202608050746-12
audit: audit:
repository: audit repository: audit
tag: develop-v.1.0.1-202607100612-4 tag: develop-v.1.0.1-202607100612-4
edge: edge:
repository: edge repository: edge
tag: develop-v.1.0.1-202607141446-17 tag: develop-v.1.0.1-202608050745-19
edgeWeb: edgeWeb:
repository: edge-web repository: edge-web
tag: develop-v.1.0.1-202607141446-17 tag: develop-v.1.0.1-202608050745-19
agent: agent:
repository: agent repository: agent
tag: develop-v.1.0.1-202607141540-23 tag: develop-v.1.0.1-202608050748-25
agentWeb: agentWeb:
repository: agent-web repository: agent-web
tag: develop-v.1.0.1-202607141540-23 tag: develop-v.1.0.1-202608050748-25
protocol: protocol:
opcua: opcua:
repository: opcua repository: opcua
tag: develop-v.1.0.1-202607141324-12 tag: develop-v.1.0.1-202608050747-15
modbus: modbus:
repository: modbus repository: modbus
tag: develop-v.1.0.1-202607141324-12 tag: develop-v.1.0.1-202608050747-15
ads: ads:
repository: ads repository: ads
tag: develop-v.1.0.1-202607141324-12 tag: develop-v.1.0.1-202608050747-15
s7: s7:
repository: s7 repository: s7
tag: develop-v.1.0.1-202607141324-12 tag: develop-v.1.0.1-202608050747-15
s7-diecast: s7-diecast:
repository: s7-diecast repository: s7-diecast
tag: develop-v.1.0.1-202607141324-12 tag: develop-v.1.0.1-202608050747-15
+6
View File
@@ -23,6 +23,12 @@ sharedDatastores:
port: 5672 port: 5672
storage: 2Gi storage: 2Gi
mountPath: /var/lib/rabbitmq mountPath: /var/lib/rabbitmq
- name: audit-nanomq
image: emqx/nanomq:0.25.2-2
port: 1883
storage: 1Gi
mountPath: /var/lib/nanomq
managementPort: 8081
sharedInfra: sharedInfra:
postgres: postgres:
+5
View File
@@ -106,6 +106,11 @@ servers:
image: opcua image: opcua
port: 4840 port: 4840
scene: /scenes/opcua/equipment-status-2.json scene: /scenes/opcua/equipment-status-2.json
- id: opcua-diecast-params
type: opcua
image: opcua
port: 4840
scene: /scenes/opcua/diecast-parameters.json
- id: modbus-basic-1 - id: modbus-basic-1
type: modbus type: modbus
image: modbus image: modbus
+4
View File
@@ -29,3 +29,7 @@ sso:
replicas: 2 replicas: 2
description: "统一登录" description: "统一登录"
webBasePath: /sso/ webBasePath: /sso/
audit:
publisher:
enabled: true
+4
View File
@@ -29,3 +29,7 @@ ultra:
replicas: 2 replicas: 2
description: "Ultra 看板" description: "Ultra 看板"
webBasePath: /ultra/ webBasePath: /ultra/
audit:
publisher:
enabled: true
+6 -2
View File
@@ -14,9 +14,13 @@ images:
sharedInfra: sharedInfra:
postgres: postgres:
username: postgres adminUsername: postgres
password: "Admin12345"
port: 5432 port: 5432
idleInTransactionSessionTimeout: 60s
credentialsSecret:
adminPasswordKey: admin-password
appPasswordKey: app-password
connectionStringKey: connection-string
redis: redis:
host: redis-service host: redis-service
port: 6379 port: 6379
+2
View File
@@ -3,3 +3,5 @@ agents:
description: Dev Agent description: Dev Agent
phaseType: DieCasting # 工序类型(注入 AGENT_PHASE_TYPE),对应 apphost WithPhaseType phaseType: DieCasting # 工序类型(注入 AGENT_PHASE_TYPE),对应 apphost WithPhaseType
nodeLabel: node1 nodeLabel: node1
databaseUsername: agent_dev
postgresCredentialsSecret: agent-demo-postgres-credentials
-7
View File
@@ -8,15 +8,8 @@ images:
repository: edge repository: edge
frontend: frontend:
repository: edge-web repository: edge-web
postgres:
repository: 192.168.1.119:8888/docker-proxy/library/postgres
tag: "17"
sharedInfra: sharedInfra:
postgres:
username: postgres
password: "Admin12345"
port: 5432
redis: redis:
host: redis-service host: redis-service
port: 6379 port: 6379
+1
View File
@@ -1,4 +1,5 @@
edges: edges:
- id: demo - id: demo
idWorkerId: 17
description: Dev Edge description: Dev Edge
nodeLabel: node2 nodeLabel: node2
+6
View File
@@ -23,6 +23,12 @@ sharedDatastores:
port: 5672 port: 5672
storage: 2Gi storage: 2Gi
mountPath: /var/lib/rabbitmq mountPath: /var/lib/rabbitmq
- name: audit-nanomq
image: emqx/nanomq:0.25.2-2
port: 1883
storage: 1Gi
mountPath: /var/lib/nanomq
managementPort: 8081
sharedInfra: sharedInfra:
postgres: postgres:
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -euo pipefail
namespace="${1:?usage: $0 <namespace> <site> <app-username>}"
site="${2:?usage: $0 <namespace> <site> <app-username>}"
app_username="${3:?usage: $0 <namespace> <site> <app-username>}"
: "${AGENT_POSTGRES_ADMIN_PASSWORD:?set AGENT_POSTGRES_ADMIN_PASSWORD}"
: "${AGENT_POSTGRES_APP_PASSWORD:?set AGENT_POSTGRES_APP_PASSWORD}"
database_name="agent-db-${site}"
postgres_host="agent-${site}-postgres-service"
secret_name="agent-${site}-postgres-credentials"
escaped_app_password=${AGENT_POSTGRES_APP_PASSWORD//\"/\"\"}
connection_string="Host=${postgres_host};Port=5432;Username=${app_username};Password=\"${escaped_app_password}\";Database=${database_name}"
credentials_directory=$(mktemp -d)
trap 'rm -rf -- "${credentials_directory}"' EXIT
chmod 700 "${credentials_directory}"
printf '%s' "${AGENT_POSTGRES_ADMIN_PASSWORD}" > "${credentials_directory}/admin-password"
printf '%s' "${AGENT_POSTGRES_APP_PASSWORD}" > "${credentials_directory}/app-password"
printf '%s' "${connection_string}" > "${credentials_directory}/connection-string"
kubectl --namespace "${namespace}" create secret generic "${secret_name}" \
--from-file=admin-password="${credentials_directory}/admin-password" \
--from-file=app-password="${credentials_directory}/app-password" \
--from-file=connection-string="${credentials_directory}/connection-string" \
--dry-run=client \
--output=yaml \
| kubectl apply --filename=-
echo "Updated ${namespace}/${secret_name}; restart the Agent Deployment to consume changed values."