Author SHA1 Message Date
王野 6bb97211af feat(config): 添加MQTT配置支持并更新镜像配置格式
- 在agent-common-values.yaml中添加mqttCredentials配置项
- 在edge-common-values.yaml中添加mqtt服务配置
- 将镜像配置从简单字符串格式更新为包含repository和tag的对象格式
- 为开发环境和演示环境统一应用MQTT相关配置
2026-08-03 00:29:52 +08:00
24 changed files with 46 additions and 227 deletions

No files matched your search

@@ -1,25 +0,0 @@
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,11 +35,6 @@ spec:
site: "{{ .id }}"
description: "{{ .description }}"
phaseType: "{{ .phaseType }}"
sharedInfra:
postgres:
appUsername: "{{ .databaseUsername }}"
credentialsSecret:
name: "{{ .postgresCredentialsSecret }}"
{{- if hasKey . "nodeLabel" }}
nodeSelector:
mixingx.io/edge-node: "{{ .nodeLabel }}"
File renamed without changes.
-1
View File
@@ -33,7 +33,6 @@ spec:
- $values/environments/demo/edge-common-values.yaml
values: |
site: "{{ .id }}"
idWorkerId: {{ .idWorkerId }}
description: "{{ .description }}"
{{- if hasKey . "nodeLabel" }}
nodeSelector:
-5
View File
@@ -35,11 +35,6 @@ spec:
site: "{{ .id }}"
description: "{{ .description }}"
phaseType: "{{ .phaseType }}"
sharedInfra:
postgres:
appUsername: "{{ .databaseUsername }}"
credentialsSecret:
name: "{{ .postgresCredentialsSecret }}"
{{- if .nodeLabel }}
nodeSelector:
mixingx.io/edge-node: "{{ .nodeLabel }}"
-1
View File
@@ -33,7 +33,6 @@ spec:
- $values/environments/dev/edge-common-values.yaml
values: |
site: "{{ .id }}"
idWorkerId: {{ .idWorkerId }}
description: "{{ .description }}"
{{- if .nodeLabel }}
nodeSelector:
@@ -1,12 +0,0 @@
# 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
+2 -10
View File
@@ -16,13 +16,9 @@ images:
sharedInfra:
postgres:
adminUsername: postgres
username: postgres
password: "Admin12345"
port: 5432
idleInTransactionSessionTimeout: 60s
credentialsSecret:
adminPasswordKey: admin-password
appPasswordKey: app-password
connectionStringKey: connection-string
redis:
host: redis-service
port: 6379
@@ -40,7 +36,3 @@ mqttCredentials:
- credentialRef: "edge-demo-2-mqtt"
username: ""
password: ""
audit:
publisher:
enabled: true
@@ -1,56 +0,0 @@
# 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`.
+3 -2
View File
@@ -1,6 +1,7 @@
agents:
- id: demo
description: Demo Agent
phaseType: DieCasting
- id: demo-2
description: Demo Agent 2
phaseType: DieCasting
databaseUsername: agent_demo_2
postgresCredentialsSecret: agent-demo-2-postgres-credentials
+11 -24
View File
@@ -1,33 +1,20 @@
storage:
className: longhorn-platform
sharedInfra:
postgres:
image: 192.168.1.119:8888/docker-proxy/library/postgres:17
username: postgres
mongo:
host: mongo-service
port: 27017
username: admin
password: "Admin12345"
port: 5432
database: mixingx_audit
rabbitmq:
host: messaging-service
port: 5672
username: guest
password: guest
otlp:
endpoint: http://k8s-dashboard-service:18889
protocol: grpc
audit:
enabled: true
port: 5900
port: 5600
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
+7 -4
View File
@@ -10,8 +10,15 @@ images:
frontend:
repository: edge-web
tag: ""
postgres:
repository: 192.168.1.119:8888/docker-proxy/library/postgres
tag: "17"
sharedInfra:
postgres:
username: postgres
password: "Admin12345"
port: 5432
redis:
host: redis-service
port: 6379
@@ -26,7 +33,3 @@ mqtt:
image:
repository: emqx/nanomq
tag: 0.25.2-2
audit:
publisher:
enabled: true
-2
View File
@@ -1,7 +1,5 @@
edges:
- id: demo
idWorkerId: 17
description: Demo Edge
- id: demo-2
idWorkerId: 18
description: Demo Edge 2
+14 -14
View File
@@ -4,47 +4,47 @@ timezone: Asia/Shanghai
images:
gateway:
repository: gateway
tag: develop-v.1.0.1-202608050744-6
tag: master-202607130641-4
sso:
repository: sso
tag: develop-v.1.0.1-202608050742-21
tag: develop-v.1.0.1-202607141448-14
ssoWeb:
repository: sso-web
tag: develop-v.1.0.1-202608050742-21
tag: develop-v.1.0.1-202607141448-14
ultra:
repository: ultra
tag: develop-v.1.0.1-202608050746-12
tag: develop-v.1.0.1-202607141448-10
ultraWeb:
repository: ultra-web
tag: develop-v.1.0.1-202608050746-12
tag: develop-v.1.0.1-202607141448-10
audit:
repository: audit
tag: develop-v.1.0.1-202607100612-4
edge:
repository: edge
tag: develop-v.1.0.1-202608050745-19
tag: develop-v.1.0.1-202607141446-17
edgeWeb:
repository: edge-web
tag: develop-v.1.0.1-202608050745-19
tag: develop-v.1.0.1-202607141446-17
agent:
repository: agent
tag: develop-v.1.0.1-202608050748-25
tag: develop-v.1.0.1-202607141540-23
agentWeb:
repository: agent-web
tag: develop-v.1.0.1-202608050748-25
tag: develop-v.1.0.1-202607141540-23
protocol:
opcua:
repository: opcua
tag: develop-v.1.0.1-202608050747-15
tag: develop-v.1.0.1-202607141324-12
modbus:
repository: modbus
tag: develop-v.1.0.1-202608050747-15
tag: develop-v.1.0.1-202607141324-12
ads:
repository: ads
tag: develop-v.1.0.1-202608050747-15
tag: develop-v.1.0.1-202607141324-12
s7:
repository: s7
tag: develop-v.1.0.1-202608050747-15
tag: develop-v.1.0.1-202607141324-12
s7-diecast:
repository: s7-diecast
tag: develop-v.1.0.1-202608050747-15
tag: develop-v.1.0.1-202607141324-12
-6
View File
@@ -23,12 +23,6 @@ sharedDatastores:
port: 5672
storage: 2Gi
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:
postgres:
-5
View File
@@ -106,11 +106,6 @@ servers:
image: opcua
port: 4840
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
type: modbus
image: modbus
-4
View File
@@ -29,7 +29,3 @@ sso:
replicas: 2
description: "统一登录"
webBasePath: /sso/
audit:
publisher:
enabled: true
-4
View File
@@ -29,7 +29,3 @@ ultra:
replicas: 2
description: "Ultra 看板"
webBasePath: /ultra/
audit:
publisher:
enabled: true
+2 -6
View File
@@ -14,13 +14,9 @@ images:
sharedInfra:
postgres:
adminUsername: postgres
username: postgres
password: "Admin12345"
port: 5432
idleInTransactionSessionTimeout: 60s
credentialsSecret:
adminPasswordKey: admin-password
appPasswordKey: app-password
connectionStringKey: connection-string
redis:
host: redis-service
port: 6379
-2
View File
@@ -3,5 +3,3 @@ agents:
description: Dev Agent
phaseType: DieCasting # 工序类型(注入 AGENT_PHASE_TYPE),对应 apphost WithPhaseType
nodeLabel: node1
databaseUsername: agent_dev
postgresCredentialsSecret: agent-demo-postgres-credentials
+7
View File
@@ -8,8 +8,15 @@ images:
repository: edge
frontend:
repository: edge-web
postgres:
repository: 192.168.1.119:8888/docker-proxy/library/postgres
tag: "17"
sharedInfra:
postgres:
username: postgres
password: "Admin12345"
port: 5432
redis:
host: redis-service
port: 6379
-1
View File
@@ -1,5 +1,4 @@
edges:
- id: demo
idWorkerId: 17
description: Dev Edge
nodeLabel: node2
-6
View File
@@ -23,12 +23,6 @@ sharedDatastores:
port: 5672
storage: 2Gi
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:
postgres:
@@ -1,32 +0,0 @@
#!/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."