Compare commits
23
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7a9d4a1a6 | ||
|
|
9499c2ac8d | ||
|
|
bb5e699c77 | ||
|
|
11d311748a | ||
|
|
699f4a6cb1 | ||
|
|
44f382230e | ||
|
|
fa73db2b9c | ||
|
|
b007a2fde5 | ||
|
|
e35900f219 | ||
|
|
a0957377ab | ||
|
|
25ebffa020 | ||
|
|
d05b231e83 | ||
|
|
6b1e47804a | ||
|
|
421a2e8e31 | ||
|
|
83f5d28d79 | ||
|
|
073b3a3bf3 | ||
|
|
877e3f33bf | ||
|
|
3676fac91b | ||
|
|
482134dfc9 | ||
|
|
6ece72f728 | ||
|
|
99c95bbf01 | ||
|
|
5007cbaa21 | ||
|
|
5779875cc1 |
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
|
||||
@@ -35,6 +35,11 @@ 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.
@@ -33,6 +33,7 @@ spec:
|
||||
- $values/environments/demo/edge-common-values.yaml
|
||||
values: |
|
||||
site: "{{ .id }}"
|
||||
idWorkerId: {{ .idWorkerId }}
|
||||
description: "{{ .description }}"
|
||||
{{- if hasKey . "nodeLabel" }}
|
||||
nodeSelector:
|
||||
|
||||
@@ -35,6 +35,11 @@ spec:
|
||||
site: "{{ .id }}"
|
||||
description: "{{ .description }}"
|
||||
phaseType: "{{ .phaseType }}"
|
||||
sharedInfra:
|
||||
postgres:
|
||||
appUsername: "{{ .databaseUsername }}"
|
||||
credentialsSecret:
|
||||
name: "{{ .postgresCredentialsSecret }}"
|
||||
{{- if .nodeLabel }}
|
||||
nodeSelector:
|
||||
mixingx.io/edge-node: "{{ .nodeLabel }}"
|
||||
|
||||
@@ -33,6 +33,7 @@ spec:
|
||||
- $values/environments/dev/edge-common-values.yaml
|
||||
values: |
|
||||
site: "{{ .id }}"
|
||||
idWorkerId: {{ .idWorkerId }}
|
||||
description: "{{ .description }}"
|
||||
{{- if .nodeLabel }}
|
||||
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
|
||||
@@ -16,9 +16,13 @@ images:
|
||||
|
||||
sharedInfra:
|
||||
postgres:
|
||||
username: postgres
|
||||
password: "Admin12345"
|
||||
adminUsername: postgres
|
||||
port: 5432
|
||||
idleInTransactionSessionTimeout: 60s
|
||||
credentialsSecret:
|
||||
adminPasswordKey: admin-password
|
||||
appPasswordKey: app-password
|
||||
connectionStringKey: connection-string
|
||||
redis:
|
||||
host: redis-service
|
||||
port: 6379
|
||||
@@ -28,3 +32,15 @@ sharedInfra:
|
||||
port: 5672
|
||||
username: guest
|
||||
password: guest
|
||||
|
||||
mqttCredentials:
|
||||
- credentialRef: "edge-demo-mqtt"
|
||||
username: ""
|
||||
password: ""
|
||||
- credentialRef: "edge-demo-2-mqtt"
|
||||
username: ""
|
||||
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`.
|
||||
@@ -1,7 +1,6 @@
|
||||
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
|
||||
@@ -1,20 +1,33 @@
|
||||
storage:
|
||||
className: longhorn-platform
|
||||
|
||||
sharedInfra:
|
||||
mongo:
|
||||
host: mongo-service
|
||||
port: 27017
|
||||
username: admin
|
||||
postgres:
|
||||
image: 192.168.1.119:8888/docker-proxy/library/postgres:17
|
||||
username: postgres
|
||||
password: "Admin12345"
|
||||
database: mixingx_audit
|
||||
rabbitmq:
|
||||
host: messaging-service
|
||||
port: 5672
|
||||
username: guest
|
||||
password: guest
|
||||
port: 5432
|
||||
otlp:
|
||||
endpoint: http://k8s-dashboard-service:18889
|
||||
protocol: grpc
|
||||
|
||||
audit:
|
||||
enabled: true
|
||||
port: 5600
|
||||
port: 5900
|
||||
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
|
||||
@@ -10,15 +10,8 @@ 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
|
||||
@@ -28,3 +21,12 @@ sharedInfra:
|
||||
port: 5672
|
||||
username: guest
|
||||
password: guest
|
||||
|
||||
mqtt:
|
||||
image:
|
||||
repository: emqx/nanomq
|
||||
tag: 0.25.2-2
|
||||
|
||||
audit:
|
||||
publisher:
|
||||
enabled: true
|
||||
@@ -1,5 +1,7 @@
|
||||
edges:
|
||||
- id: demo
|
||||
idWorkerId: 17
|
||||
description: Demo Edge
|
||||
- id: demo-2
|
||||
idWorkerId: 18
|
||||
description: Demo Edge 2
|
||||
@@ -4,47 +4,47 @@ timezone: Asia/Shanghai
|
||||
images:
|
||||
gateway:
|
||||
repository: gateway
|
||||
tag: master-202607130641-4
|
||||
tag: develop-v.1.0.1-202608050744-6
|
||||
sso:
|
||||
repository: sso
|
||||
tag: develop-v.1.0.1-202607141448-14
|
||||
tag: develop-v.1.0.1-202608050742-21
|
||||
ssoWeb:
|
||||
repository: sso-web
|
||||
tag: develop-v.1.0.1-202607141448-14
|
||||
tag: develop-v.1.0.1-202608050742-21
|
||||
ultra:
|
||||
repository: ultra
|
||||
tag: develop-v.1.0.1-202607141448-10
|
||||
tag: develop-v.1.0.1-202608050746-12
|
||||
ultraWeb:
|
||||
repository: ultra-web
|
||||
tag: develop-v.1.0.1-202607141448-10
|
||||
tag: develop-v.1.0.1-202608050746-12
|
||||
audit:
|
||||
repository: audit
|
||||
tag: develop-v.1.0.1-202607100612-4
|
||||
edge:
|
||||
repository: edge
|
||||
tag: develop-v.1.0.1-202607141446-17
|
||||
tag: develop-v.1.0.1-202608050745-19
|
||||
edgeWeb:
|
||||
repository: edge-web
|
||||
tag: develop-v.1.0.1-202607141446-17
|
||||
tag: develop-v.1.0.1-202608050745-19
|
||||
agent:
|
||||
repository: agent
|
||||
tag: develop-v.1.0.1-202607141540-23
|
||||
tag: develop-v.1.0.1-202608050748-25
|
||||
agentWeb:
|
||||
repository: agent-web
|
||||
tag: develop-v.1.0.1-202607141540-23
|
||||
tag: develop-v.1.0.1-202608050748-25
|
||||
protocol:
|
||||
opcua:
|
||||
repository: opcua
|
||||
tag: develop-v.1.0.1-202607141324-12
|
||||
tag: develop-v.1.0.1-202608050747-15
|
||||
modbus:
|
||||
repository: modbus
|
||||
tag: develop-v.1.0.1-202607141324-12
|
||||
tag: develop-v.1.0.1-202608050747-15
|
||||
ads:
|
||||
repository: ads
|
||||
tag: develop-v.1.0.1-202607141324-12
|
||||
tag: develop-v.1.0.1-202608050747-15
|
||||
s7:
|
||||
repository: s7
|
||||
tag: develop-v.1.0.1-202607141324-12
|
||||
tag: develop-v.1.0.1-202608050747-15
|
||||
s7-diecast:
|
||||
repository: s7-diecast
|
||||
tag: develop-v.1.0.1-202607141324-12
|
||||
tag: develop-v.1.0.1-202608050747-15
|
||||
@@ -23,6 +23,12 @@ 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:
|
||||
|
||||
@@ -106,6 +106,11 @@ 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
|
||||
|
||||
@@ -29,3 +29,7 @@ sso:
|
||||
replicas: 2
|
||||
description: "统一登录"
|
||||
webBasePath: /sso/
|
||||
|
||||
audit:
|
||||
publisher:
|
||||
enabled: true
|
||||
@@ -29,3 +29,7 @@ ultra:
|
||||
replicas: 2
|
||||
description: "Ultra 看板"
|
||||
webBasePath: /ultra/
|
||||
|
||||
audit:
|
||||
publisher:
|
||||
enabled: true
|
||||
@@ -4,15 +4,23 @@ storage:
|
||||
keep: true
|
||||
|
||||
images:
|
||||
backend: agent
|
||||
frontend: agent-web
|
||||
postgres: 192.168.1.119:8888/docker-proxy/library/postgres:17
|
||||
backend:
|
||||
repository: agent
|
||||
frontend:
|
||||
repository: agent-web
|
||||
postgres:
|
||||
repository: 192.168.1.119:8888/docker-proxy/library/postgres
|
||||
tag: "17"
|
||||
|
||||
sharedInfra:
|
||||
postgres:
|
||||
username: postgres
|
||||
password: "Admin12345"
|
||||
adminUsername: postgres
|
||||
port: 5432
|
||||
idleInTransactionSessionTimeout: 60s
|
||||
credentialsSecret:
|
||||
adminPasswordKey: admin-password
|
||||
appPasswordKey: app-password
|
||||
connectionStringKey: connection-string
|
||||
redis:
|
||||
host: redis-service
|
||||
port: 6379
|
||||
@@ -22,3 +30,8 @@ sharedInfra:
|
||||
port: 5672
|
||||
username: guest
|
||||
password: guest
|
||||
|
||||
mqttCredentials:
|
||||
- credentialRef: "edge-demo-mqtt"
|
||||
username: ""
|
||||
password: ""
|
||||
@@ -3,3 +3,5 @@ agents:
|
||||
description: Dev Agent
|
||||
phaseType: DieCasting # 工序类型(注入 AGENT_PHASE_TYPE),对应 apphost WithPhaseType
|
||||
nodeLabel: node1
|
||||
databaseUsername: agent_dev
|
||||
postgresCredentialsSecret: agent-demo-postgres-credentials
|
||||
@@ -4,15 +4,12 @@ storage:
|
||||
keep: true
|
||||
|
||||
images:
|
||||
backend: edge
|
||||
frontend: edge-web
|
||||
postgres: 192.168.1.119:8888/docker-proxy/library/postgres:17
|
||||
backend:
|
||||
repository: edge
|
||||
frontend:
|
||||
repository: edge-web
|
||||
|
||||
sharedInfra:
|
||||
postgres:
|
||||
username: postgres
|
||||
password: "Admin12345"
|
||||
port: 5432
|
||||
redis:
|
||||
host: redis-service
|
||||
port: 6379
|
||||
@@ -22,3 +19,8 @@ sharedInfra:
|
||||
port: 5672
|
||||
username: guest
|
||||
password: guest
|
||||
|
||||
mqtt:
|
||||
image:
|
||||
repository: emqx/nanomq
|
||||
tag: 0.25.2-2
|
||||
@@ -1,4 +1,5 @@
|
||||
edges:
|
||||
- id: demo
|
||||
idWorkerId: 17
|
||||
description: Dev Edge
|
||||
nodeLabel: node2
|
||||
@@ -23,6 +23,12 @@ 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:
|
||||
|
||||
Executable
+32
@@ -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."
|
||||
Reference in new issue
Block a user