Compare commits
60
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd0f20af0b | ||
|
|
ef0e2b5ce1 | ||
|
|
e6ada86374 | ||
|
|
33908b6955 | ||
|
|
f623c56853 | ||
|
|
1a1847ba7e | ||
|
|
c698fe14cc | ||
|
|
ee378168c0 | ||
|
|
41ccb587a9 | ||
|
|
84ddff1776 | ||
|
|
02583981cb | ||
|
|
bfec34fc70 | ||
|
|
b42271b704 | ||
|
|
3decc0f1a2 | ||
|
|
3bc2c6a1b4 | ||
|
|
1632267279 | ||
|
|
51123401a1 | ||
|
|
04e0105b91 | ||
|
|
3c5dff3857 | ||
|
|
cf0cf6080f | ||
|
|
e5bf7090b4 | ||
|
|
943b045cad | ||
|
|
e988974374 | ||
|
|
224afb71f1 | ||
|
|
981be3e23f | ||
|
|
4613388d0c | ||
|
|
2ba8f83f2e | ||
|
|
0ece6b12b2 | ||
|
|
b6c35f28e3 | ||
|
|
d4b84bb886 | ||
|
|
05a476d932 | ||
|
|
9035f9eb96 | ||
|
|
869754606e | ||
|
|
405eef034a | ||
|
|
9b3a61eb49 | ||
|
|
322411955e | ||
|
|
4716a40c3a | ||
|
|
9ab9b5c97e | ||
|
|
6707dbe28f | ||
|
|
8b70d43953 | ||
|
|
70c85011db | ||
|
|
34e108dbbc | ||
|
|
4395e900e9 | ||
|
|
0aea949b49 | ||
|
|
798735a0a8 | ||
|
|
5e9b92f507 | ||
|
|
b21fb1ac92 | ||
|
|
f2e6683a44 | ||
|
|
c4f962d120 | ||
|
|
352aa78a8f | ||
|
|
e5f1ba44c8 | ||
|
|
4e517797e1 | ||
|
|
5bc1b52721 | ||
|
|
90d8838e15 | ||
|
|
2e7d079f65 | ||
|
|
a567579ab2 | ||
|
|
3433a6d945 | ||
|
|
befbfee653 | ||
|
|
07f22f5eb4 | ||
|
|
601151bfae |
No files matched your search
@@ -27,32 +27,14 @@
|
|||||||
CI 只对 `release-charts/` 做 lint/template(见 hub `.drone.yml`):
|
CI 只对 `release-charts/` 做 lint/template(见 hub `.drone.yml`):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
helm lint release-charts/mixingx-edge-unit \
|
helm lint release-charts/mixingx-edge-unit
|
||||||
--set global.imageRegistry=registry.invalid/mixingx \
|
helm template ci-edge release-charts/mixingx-edge-unit
|
||||||
--set images.edge.tag=ci \
|
|
||||||
--set images.edgeWeb.tag=ci
|
|
||||||
helm template ci-edge release-charts/mixingx-edge-unit \
|
|
||||||
--set global.imageRegistry=registry.invalid/mixingx \
|
|
||||||
--set images.edge.tag=ci \
|
|
||||||
--set images.edgeWeb.tag=ci
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### ArgoCD 部署
|
### ArgoCD 部署
|
||||||
|
|
||||||
`mixingx-deploy` 的 ApplicationSet 按 unit chart 逐个发布,每个 edge/agent 一个独立 Helm release。详见 `mixingx-deploy/`。
|
`mixingx-deploy` 的 ApplicationSet 按 unit chart 逐个发布,每个 edge/agent 一个独立 Helm release。详见 `mixingx-deploy/`。
|
||||||
|
|
||||||
## 镜像地址约定
|
|
||||||
|
|
||||||
所有部署到 K3s 的运行镜像统一按下面的结构拼接:
|
|
||||||
|
|
||||||
```text
|
|
||||||
<global.imageRegistry>/<images.*.repository>:<images.*.tag>
|
|
||||||
```
|
|
||||||
|
|
||||||
`global.imageRegistry` 必须由 `mixingx-deploy` 的环境 values 提供,Chart 不保存 AL ACR、Harbor、内网 IP 或公网镜像仓库地址。业务镜像和 PostgreSQL、Redis、RabbitMQ、MongoDB、NanoMQ 等基础镜像遵守同一规则。
|
|
||||||
|
|
||||||
生产环境必须传入明确且不可变的 tag,不使用 `latest`。AL ACR 与现场 Harbor 必须保持相同的 repository/tag,只切换 `global.imageRegistry`。
|
|
||||||
|
|
||||||
## 关联文档
|
## 关联文档
|
||||||
|
|
||||||
- hub [AGENTS.md](https://gitee.com/mixing-tech/mixingx.hub) — 全项目指南
|
- hub [AGENTS.md](https://gitee.com/mixing-tech/mixingx.hub) — 全项目指南
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
# 交付镜像清单(Delivery Image Manifest)— ADR-0066
|
||||||
|
#
|
||||||
|
# 用途:release 前核对 ACR 上第三方镜像齐备(发布流水线 Step 2 读取,缺失即 fail fast)。
|
||||||
|
# 规则:
|
||||||
|
# - acr 路径统一收进 library/*(显式引用不依赖上游路径对齐)
|
||||||
|
# - pushed: false = 尚未推到 ACR 的缺口,release 前必须补推(cr_temp_user 临时 token 手工作业)
|
||||||
|
# - optional: true = 客户默认不部署,缺了不阻塞
|
||||||
|
#
|
||||||
|
# 业务镜像(mixingx/*)不在本清单:它们由发布流水线从交付基线 retag 产出,天然齐备。
|
||||||
|
|
||||||
|
thirdParty:
|
||||||
|
# ── 平台核心依赖(缺一不可) ──
|
||||||
|
- { upstream: docker.io/library/postgres:17, acr: library/postgres:17, pushed: true }
|
||||||
|
- { upstream: docker.io/library/redis:8.6, acr: library/redis:8.6, pushed: true }
|
||||||
|
- { upstream: docker.io/library/rabbitmq:4.3-management, acr: library/rabbitmq:4.3-management, pushed: true }
|
||||||
|
# ── edge 单元 + audit broker 硬依赖 ──
|
||||||
|
- { upstream: docker.io/emqx/nanomq:0.25.2-2, acr: library/nanomq:0.25.2-2, pushed: true } # D2 已补推(2026-08-22)
|
||||||
|
# ── 工具类(现场无组件直接依赖,备查;tag 以 ACR 实存为准,2026-08-22 盘点) ──
|
||||||
|
- { upstream: docker.io/library/busybox:1.36, acr: library/busybox:1.36, pushed: true, optional: true }
|
||||||
|
- { upstream: docker.io/library/alpine:3.19, acr: library/alpine:3.19, pushed: true, optional: true }
|
||||||
|
# ── 可选(客户默认不部署) ──
|
||||||
|
- { upstream: docker.io/emqx/mqttx-web:latest, acr: library/mqttx-web:latest, pushed: true, optional: true } # mxlexus 已部署(2026-08-22)
|
||||||
|
- { upstream: docker.io/library/mongo:7.0, acr: library/mongo:7.0, pushed: true, optional: true } # v2 audit 已去 mongo,存量备用
|
||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-agent-unit
|
name: mixingx-agent-unit
|
||||||
description: "One MixingX agent unit release: agent backend, agent web, and agent PostgreSQL."
|
description: "One MixingX agent unit release: agent backend, agent web, and agent PostgreSQL."
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.1
|
version: 1.0.44
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.44"
|
||||||
@@ -6,12 +6,11 @@ Deploys one agent site as one Helm release:
|
|||||||
- `agent-web-<site>` frontend
|
- `agent-web-<site>` frontend
|
||||||
- `agent-<site>-postgres` StatefulSet and retained PVC
|
- `agent-<site>-postgres` StatefulSet and retained PVC
|
||||||
|
|
||||||
The release requires a pre-created PostgreSQL credentials Secret. By default its
|
Agent PostgreSQL sessions set `idle_in_transaction_session_timeout` through the
|
||||||
name is `agent-<site>-postgres-credentials`; the required keys are
|
connection string. The default is `60s`, configurable with
|
||||||
`admin-password`, `app-password`, and `connection-string`. The Agent connection
|
`sharedInfra.postgres.idleInTransactionSessionTimeout`. This is a database-side
|
||||||
string must use `sharedInfra.postgres.appUsername`, while the init container uses
|
safety net for leaked idle transactions and does not change database users,
|
||||||
the administrator credential only to idempotently provision the non-superuser
|
passwords, roles, or the PostgreSQL StatefulSet credential model.
|
||||||
application role and its database-local idle transaction timeout.
|
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
@@ -21,6 +20,5 @@ helm upgrade --install mixingx-agent-workshop-a ./charts/mixingx-agent-unit \
|
|||||||
--set site=workshop-a \
|
--set site=workshop-a \
|
||||||
--set nodeName=agent-node-01 \
|
--set nodeName=agent-node-01 \
|
||||||
--set storage.className=longhorn \
|
--set storage.className=longhorn \
|
||||||
--set sharedInfra.postgres.appUsername=agent_workshop_a \
|
|
||||||
--set tag=2026.07.02-abc1234
|
--set tag=2026.07.02-abc1234
|
||||||
```
|
```
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
\set ON_ERROR_STOP on
|
|
||||||
\getenv agent_username AGENT_DB_USERNAME
|
|
||||||
\getenv agent_password AGENT_DB_PASSWORD
|
|
||||||
\getenv database_name POSTGRESQL_DATABASENAME
|
|
||||||
\getenv idle_timeout IDLE_IN_TRANSACTION_SESSION_TIMEOUT
|
|
||||||
|
|
||||||
SELECT format(
|
|
||||||
'CREATE ROLE %I LOGIN PASSWORD %L NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION NOBYPASSRLS',
|
|
||||||
:'agent_username',
|
|
||||||
:'agent_password')
|
|
||||||
WHERE NOT EXISTS (
|
|
||||||
SELECT 1
|
|
||||||
FROM pg_roles
|
|
||||||
WHERE rolname = :'agent_username')
|
|
||||||
\gexec
|
|
||||||
|
|
||||||
SELECT format(
|
|
||||||
'ALTER ROLE %I WITH LOGIN PASSWORD %L NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION NOBYPASSRLS',
|
|
||||||
:'agent_username',
|
|
||||||
:'agent_password')
|
|
||||||
\gexec
|
|
||||||
|
|
||||||
SELECT format('GRANT CONNECT ON DATABASE %I TO %I', :'database_name', :'agent_username')
|
|
||||||
\gexec
|
|
||||||
|
|
||||||
SELECT format('ALTER DATABASE %I OWNER TO %I', :'database_name', :'agent_username')
|
|
||||||
\gexec
|
|
||||||
|
|
||||||
SELECT format('ALTER SCHEMA public OWNER TO %I', :'agent_username')
|
|
||||||
\gexec
|
|
||||||
|
|
||||||
SELECT format('GRANT ALL ON SCHEMA public TO %I', :'agent_username')
|
|
||||||
\gexec
|
|
||||||
|
|
||||||
-- Existing installations may have objects created by the former postgres application login.
|
|
||||||
-- Transfer only user objects in public; extension-owned objects remain with their extension owner.
|
|
||||||
SELECT format(
|
|
||||||
'ALTER %s %I.%I OWNER TO %I',
|
|
||||||
CASE c.relkind
|
|
||||||
WHEN 'r' THEN 'TABLE'
|
|
||||||
WHEN 'p' THEN 'TABLE'
|
|
||||||
WHEN 'S' THEN 'SEQUENCE'
|
|
||||||
WHEN 'v' THEN 'VIEW'
|
|
||||||
WHEN 'm' THEN 'MATERIALIZED VIEW'
|
|
||||||
WHEN 'f' THEN 'FOREIGN TABLE'
|
|
||||||
END,
|
|
||||||
n.nspname,
|
|
||||||
c.relname,
|
|
||||||
:'agent_username')
|
|
||||||
FROM pg_class c
|
|
||||||
JOIN pg_namespace n ON n.oid = c.relnamespace
|
|
||||||
WHERE n.nspname = 'public'
|
|
||||||
AND c.relkind IN ('r', 'p', 'S', 'v', 'm', 'f')
|
|
||||||
AND pg_get_userbyid(c.relowner) <> :'agent_username'
|
|
||||||
AND NOT EXISTS (
|
|
||||||
SELECT 1
|
|
||||||
FROM pg_depend d
|
|
||||||
WHERE d.classid = 'pg_class'::regclass
|
|
||||||
AND d.objid = c.oid
|
|
||||||
AND d.deptype = 'e')
|
|
||||||
\gexec
|
|
||||||
|
|
||||||
SELECT format(
|
|
||||||
'ALTER %s %I.%I(%s) OWNER TO %I',
|
|
||||||
CASE p.prokind
|
|
||||||
WHEN 'p' THEN 'PROCEDURE'
|
|
||||||
ELSE 'FUNCTION'
|
|
||||||
END,
|
|
||||||
n.nspname,
|
|
||||||
p.proname,
|
|
||||||
pg_get_function_identity_arguments(p.oid),
|
|
||||||
:'agent_username')
|
|
||||||
FROM pg_proc p
|
|
||||||
JOIN pg_namespace n ON n.oid = p.pronamespace
|
|
||||||
WHERE n.nspname = 'public'
|
|
||||||
AND p.prokind IN ('f', 'p', 'w')
|
|
||||||
AND pg_get_userbyid(p.proowner) <> :'agent_username'
|
|
||||||
AND NOT EXISTS (
|
|
||||||
SELECT 1
|
|
||||||
FROM pg_depend d
|
|
||||||
WHERE d.classid = 'pg_proc'::regclass
|
|
||||||
AND d.objid = p.oid
|
|
||||||
AND d.deptype = 'e')
|
|
||||||
\gexec
|
|
||||||
|
|
||||||
SELECT format(
|
|
||||||
'ALTER ROLE %I IN DATABASE %I SET idle_in_transaction_session_timeout TO %L',
|
|
||||||
:'agent_username',
|
|
||||||
:'database_name',
|
|
||||||
:'idle_timeout')
|
|
||||||
\gexec
|
|
||||||
|
|
||||||
-- Startup migrations run as the database owner. Keep active migration and maintenance work
|
|
||||||
-- unbounded here; only idle transactions receive the safety timeout.
|
|
||||||
SELECT format('ALTER ROLE %I IN DATABASE %I RESET statement_timeout', :'agent_username', :'database_name')
|
|
||||||
\gexec
|
|
||||||
|
|
||||||
SELECT format('ALTER ROLE %I IN DATABASE %I RESET lock_timeout', :'agent_username', :'database_name')
|
|
||||||
\gexec
|
|
||||||
@@ -14,21 +14,10 @@
|
|||||||
{{- .Values.serviceId | default (include "mixingx-unit.name" .) -}}
|
{{- .Values.serviceId | default (include "mixingx-unit.name" .) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mixingx-unit.postgresCredentialsSecretName" -}}
|
|
||||||
{{- .Values.sharedInfra.postgres.credentialsSecret.name | default (printf "%s-postgres-credentials" (include "mixingx-unit.name" .)) -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "mixingx-unit.basePath" -}}
|
{{- define "mixingx-unit.basePath" -}}
|
||||||
{{- printf "/%s-%s" .Values.role (.Values.site | toString) -}}
|
{{- printf "/%s-%s" .Values.role (.Values.site | toString) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mixingx-agent-unit.image" -}}
|
|
||||||
{{- $registry := required "global.imageRegistry is required" .registry -}}
|
|
||||||
{{- $repository := required "image.repository is required" .image.repository -}}
|
|
||||||
{{- $tag := required "image.tag is required" .image.tag -}}
|
|
||||||
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "mixingx-unit.storageClassName" -}}
|
{{- define "mixingx-unit.storageClassName" -}}
|
||||||
{{- .Values.storage.className | default "local-path" -}}
|
{{- .Values.storage.className | default "local-path" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@@ -70,8 +59,7 @@ REDIS_HOST: "{{ .Values.sharedInfra.redis.host }}"
|
|||||||
REDIS_PORT: "{{ .Values.sharedInfra.redis.port }}"
|
REDIS_PORT: "{{ .Values.sharedInfra.redis.port }}"
|
||||||
POSTGRESQL_HOST: "{{ $pgHost }}"
|
POSTGRESQL_HOST: "{{ $pgHost }}"
|
||||||
POSTGRESQL_PORT: "{{ .Values.sharedInfra.postgres.port }}"
|
POSTGRESQL_PORT: "{{ .Values.sharedInfra.postgres.port }}"
|
||||||
POSTGRESQL_USERNAME: "{{ .Values.sharedInfra.postgres.appUsername }}"
|
POSTGRESQL_USERNAME: "{{ .Values.sharedInfra.postgres.username }}"
|
||||||
POSTGRESQL_DATABASENAME: "{{ include "mixingx-unit.database" . }}"
|
|
||||||
MESSAGING_HOST: "{{ .Values.sharedInfra.rabbitmq.host }}"
|
MESSAGING_HOST: "{{ .Values.sharedInfra.rabbitmq.host }}"
|
||||||
MESSAGING_PORT: "{{ .Values.sharedInfra.rabbitmq.port }}"
|
MESSAGING_PORT: "{{ .Values.sharedInfra.rabbitmq.port }}"
|
||||||
MESSAGING_USERNAME: "{{ .Values.sharedInfra.rabbitmq.username }}"
|
MESSAGING_USERNAME: "{{ .Values.sharedInfra.rabbitmq.username }}"
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
{{- $name := include "mixingx-unit.name" . -}}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: {{ $name }}-postgres-role-provisioning
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/name: mixingx
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
app.kubernetes.io/component: {{ $name }}-postgres
|
|
||||||
data:
|
|
||||||
provision-agent-role.sql: |
|
|
||||||
{{ .Files.Get "files/provision-agent-role.sql" | nindent 4 }}
|
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
{{- $serviceId := include "mixingx-unit.serviceId" . -}}
|
{{- $serviceId := include "mixingx-unit.serviceId" . -}}
|
||||||
{{- $basePath := include "mixingx-unit.basePath" . -}}
|
{{- $basePath := include "mixingx-unit.basePath" . -}}
|
||||||
{{- $pgHost := printf "%s-postgres-service" $name -}}
|
{{- $pgHost := printf "%s-postgres-service" $name -}}
|
||||||
{{- $pgCredentialsSecretName := include "mixingx-unit.postgresCredentialsSecretName" . -}}
|
|
||||||
---
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
@@ -25,65 +24,20 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $name }}
|
app.kubernetes.io/component: {{ $name }}
|
||||||
annotations:
|
annotations:
|
||||||
checksum/config: {{ include "mixingx-unit.backendConfigData" . | sha256sum }}
|
checksum/config: {{ include "mixingx-unit.backendConfigData" . | sha256sum }}
|
||||||
checksum/postgres-role-sql: {{ .Files.Get "files/provision-agent-role.sql" | sha256sum }}
|
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-unit.backendScheduling" . | nindent 6 }}
|
{{ include "mixingx-unit.backendScheduling" . | nindent 6 }}
|
||||||
initContainers:
|
{{- with $.Values.imagePullSecrets }}
|
||||||
- name: provision-postgres-role
|
imagePullSecrets:
|
||||||
image: {{ .Values.images.postgres.repository }}:{{ .Values.images.postgres.tag | default "latest" }}
|
{{- toYaml . | nindent 8 }}
|
||||||
imagePullPolicy: IfNotPresent
|
{{- end }}
|
||||||
command: ["/bin/sh", "-ec"]
|
|
||||||
args:
|
|
||||||
- |
|
|
||||||
attempt=0
|
|
||||||
until pg_isready --host="$POSTGRESQL_HOST" --port="$POSTGRESQL_PORT" --username="$POSTGRES_ADMIN_USERNAME" --dbname="$POSTGRESQL_DATABASENAME"; do
|
|
||||||
attempt=$((attempt + 1))
|
|
||||||
if [ "$attempt" -ge 60 ]; then
|
|
||||||
echo "PostgreSQL did not become ready within 120 seconds" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
sleep 2
|
|
||||||
done
|
|
||||||
exec psql \
|
|
||||||
--host="$POSTGRESQL_HOST" \
|
|
||||||
--port="$POSTGRESQL_PORT" \
|
|
||||||
--username="$POSTGRES_ADMIN_USERNAME" \
|
|
||||||
--dbname="$POSTGRESQL_DATABASENAME" \
|
|
||||||
--file=/opt/mixingx/postgres/provision-agent-role.sql
|
|
||||||
env:
|
|
||||||
- name: POSTGRESQL_HOST
|
|
||||||
value: "{{ $pgHost }}"
|
|
||||||
- name: POSTGRESQL_PORT
|
|
||||||
value: "{{ .Values.sharedInfra.postgres.port }}"
|
|
||||||
- name: POSTGRESQL_DATABASENAME
|
|
||||||
value: "{{ $database }}"
|
|
||||||
- name: POSTGRES_ADMIN_USERNAME
|
|
||||||
value: "{{ .Values.sharedInfra.postgres.adminUsername }}"
|
|
||||||
- name: AGENT_DB_USERNAME
|
|
||||||
value: "{{ .Values.sharedInfra.postgres.appUsername }}"
|
|
||||||
- name: IDLE_IN_TRANSACTION_SESSION_TIMEOUT
|
|
||||||
value: "{{ .Values.sharedInfra.postgres.idleInTransactionSessionTimeout }}"
|
|
||||||
- name: PGPASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ $pgCredentialsSecretName }}
|
|
||||||
key: {{ .Values.sharedInfra.postgres.credentialsSecret.adminPasswordKey }}
|
|
||||||
- name: AGENT_DB_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ $pgCredentialsSecretName }}
|
|
||||||
key: {{ .Values.sharedInfra.postgres.credentialsSecret.appPasswordKey }}
|
|
||||||
volumeMounts:
|
|
||||||
- name: postgres-role-provisioning
|
|
||||||
mountPath: /opt/mixingx/postgres
|
|
||||||
readOnly: true
|
|
||||||
containers:
|
containers:
|
||||||
- name: {{ $name }}
|
- name: {{ $name }}
|
||||||
image: {{ include "mixingx-agent-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.agent) | quote }}
|
{{ $backendImg := .Values.images.backend }}
|
||||||
|
{{ $agentImg := .Values.images.agent | default dict }}
|
||||||
|
{{ $backendRepo := $agentImg.repository | default $backendImg.repository }}
|
||||||
|
{{ $backendTag := $agentImg.tag | default $backendImg.tag | default .Values.tag | default "latest" }}
|
||||||
|
image: {{ .Values.registry }}/{{ $backendRepo }}:{{ $backendTag }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
|
||||||
appArmorProfile:
|
|
||||||
type: Unconfined
|
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.ports.backend }}
|
containerPort: {{ .Values.ports.backend }}
|
||||||
@@ -96,16 +50,6 @@ spec:
|
|||||||
env:
|
env:
|
||||||
- name: TZ
|
- name: TZ
|
||||||
value: "{{ .Values.timezone | default "Asia/Shanghai" }}"
|
value: "{{ .Values.timezone | default "Asia/Shanghai" }}"
|
||||||
- name: ConnectionStrings__PostgreSQL
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ $pgCredentialsSecretName }}
|
|
||||||
key: {{ .Values.sharedInfra.postgres.credentialsSecret.connectionStringKey }}
|
|
||||||
- name: POSTGRESQL_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ $pgCredentialsSecretName }}
|
|
||||||
key: {{ .Values.sharedInfra.postgres.credentialsSecret.appPasswordKey }}
|
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /health
|
path: /health
|
||||||
@@ -122,10 +66,6 @@ spec:
|
|||||||
periodSeconds: 30
|
periodSeconds: 30
|
||||||
timeoutSeconds: 10
|
timeoutSeconds: 10
|
||||||
failureThreshold: 8
|
failureThreshold: 8
|
||||||
volumes:
|
|
||||||
- name: postgres-role-provisioning
|
|
||||||
configMap:
|
|
||||||
name: {{ $name }}-postgres-role-provisioning
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
@@ -163,6 +103,10 @@ stringData:
|
|||||||
ConnectionStrings__redis: "{{ .Values.sharedInfra.redis.host }}:{{ .Values.sharedInfra.redis.port }},password={{ .Values.sharedInfra.redis.password }}"
|
ConnectionStrings__redis: "{{ .Values.sharedInfra.redis.host }}:{{ .Values.sharedInfra.redis.port }},password={{ .Values.sharedInfra.redis.password }}"
|
||||||
REDIS_PASSWORD: "{{ .Values.sharedInfra.redis.password }}"
|
REDIS_PASSWORD: "{{ .Values.sharedInfra.redis.password }}"
|
||||||
REDIS_URI: "redis://:{{ .Values.sharedInfra.redis.password }}@{{ .Values.sharedInfra.redis.host }}:{{ .Values.sharedInfra.redis.port }}"
|
REDIS_URI: "redis://:{{ .Values.sharedInfra.redis.password }}@{{ .Values.sharedInfra.redis.host }}:{{ .Values.sharedInfra.redis.port }}"
|
||||||
|
ConnectionStrings__PostgreSQL: "Host={{ $pgHost }};Port={{ .Values.sharedInfra.postgres.port }};Username={{ .Values.sharedInfra.postgres.username }};Password={{ .Values.sharedInfra.postgres.password }};Database={{ $database }};Options=-c idle_in_transaction_session_timeout={{ .Values.sharedInfra.postgres.idleInTransactionSessionTimeout }}"
|
||||||
|
POSTGRESQL_PASSWORD: "{{ .Values.sharedInfra.postgres.password }}"
|
||||||
|
POSTGRESQL_URI: "postgresql://{{ .Values.sharedInfra.postgres.username }}:{{ .Values.sharedInfra.postgres.password }}@{{ $pgHost }}:{{ .Values.sharedInfra.postgres.port }}/{{ $database }}"
|
||||||
|
POSTGRESQL_DATABASENAME: "{{ $database }}"
|
||||||
ConnectionStrings__messaging: "amqp://{{ .Values.sharedInfra.rabbitmq.username }}:{{ .Values.sharedInfra.rabbitmq.password }}@{{ .Values.sharedInfra.rabbitmq.host }}:{{ .Values.sharedInfra.rabbitmq.port }}"
|
ConnectionStrings__messaging: "amqp://{{ .Values.sharedInfra.rabbitmq.username }}:{{ .Values.sharedInfra.rabbitmq.password }}@{{ .Values.sharedInfra.rabbitmq.host }}:{{ .Values.sharedInfra.rabbitmq.port }}"
|
||||||
MESSAGING_PASSWORD: "{{ .Values.sharedInfra.rabbitmq.password }}"
|
MESSAGING_PASSWORD: "{{ .Values.sharedInfra.rabbitmq.password }}"
|
||||||
MESSAGING_URI: "amqp://{{ .Values.sharedInfra.rabbitmq.username }}:{{ .Values.sharedInfra.rabbitmq.password }}@{{ .Values.sharedInfra.rabbitmq.host }}:{{ .Values.sharedInfra.rabbitmq.port }}"
|
MESSAGING_URI: "amqp://{{ .Values.sharedInfra.rabbitmq.username }}:{{ .Values.sharedInfra.rabbitmq.password }}@{{ .Values.sharedInfra.rabbitmq.host }}:{{ .Values.sharedInfra.rabbitmq.port }}"
|
||||||
@@ -190,9 +134,17 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $webName }}
|
app.kubernetes.io/component: {{ $webName }}
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-unit.followerScheduling" . | nindent 6 }}
|
{{ include "mixingx-unit.followerScheduling" . | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ $webName }}
|
- name: {{ $webName }}
|
||||||
image: {{ include "mixingx-agent-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.agentWeb) | quote }}
|
{{ $frontendImg := .Values.images.frontend }}
|
||||||
|
{{ $agentWebImg := .Values.images.agentWeb | default dict }}
|
||||||
|
{{ $frontendRepo := $agentWebImg.repository | default $frontendImg.repository }}
|
||||||
|
{{ $frontendTag := $agentWebImg.tag | default $frontendImg.tag | default .Values.tag | default "latest" }}
|
||||||
|
image: {{ .Values.registry }}/{{ $frontendRepo }}:{{ $frontendTag }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
@@ -256,29 +208,21 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $name }}-postgres
|
app.kubernetes.io/component: {{ $name }}-postgres
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-unit.followerScheduling" . | nindent 6 }}
|
{{ include "mixingx-unit.followerScheduling" . | nindent 6 }}
|
||||||
# postgres 以专用用户直跑,绕过镜像内 gosu(新内核下 gosu 用户态死循环,
|
{{- with $.Values.imagePullSecrets }}
|
||||||
# 见 ADR/工单:kernel 7.0.0-39+ × gosu 兼容 bug;三件套缺一不可)
|
imagePullSecrets:
|
||||||
securityContext:
|
{{- toYaml . | nindent 8 }}
|
||||||
runAsUser: 999
|
{{- end }}
|
||||||
runAsGroup: 999
|
|
||||||
fsGroup: 999
|
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
command: ["docker-entrypoint.sh", "postgres"]
|
image: {{ .Values.images.postgres.repository }}:{{ .Values.images.postgres.tag | default "latest" }}
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
image: {{ include "mixingx-agent-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.postgres) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
valueFrom:
|
value: "{{ .Values.sharedInfra.postgres.password }}"
|
||||||
secretKeyRef:
|
|
||||||
name: {{ $pgCredentialsSecretName }}
|
|
||||||
key: {{ .Values.sharedInfra.postgres.credentialsSecret.adminPasswordKey }}
|
|
||||||
- name: POSTGRES_DB
|
- name: POSTGRES_DB
|
||||||
value: "{{ $database }}"
|
value: "{{ $database }}"
|
||||||
- name: POSTGRES_USER
|
- name: POSTGRES_USER
|
||||||
value: "{{ .Values.sharedInfra.postgres.adminUsername }}"
|
value: "{{ .Values.sharedInfra.postgres.username }}"
|
||||||
- name: PGDATA
|
- name: PGDATA
|
||||||
value: /var/lib/postgresql/data/pgdata
|
value: /var/lib/postgresql/data/pgdata
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
global:
|
registry: 192.168.1.105:8888/mixingx
|
||||||
imageRegistry: ""
|
tag: latest
|
||||||
|
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
# 客户环境由 environments/_common 注入 imagePullSecrets(ADR-0066);内网留空=匿名拉取,行为不变
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
|
||||||
role: agent
|
role: agent
|
||||||
site: "0"
|
site: "0"
|
||||||
@@ -11,9 +13,17 @@ phaseType: "" # 工序类型(对应 apphost 的 AGENT_PHASE_TYPE,如 DieC
|
|||||||
database: ""
|
database: ""
|
||||||
|
|
||||||
images:
|
images:
|
||||||
agent: { repository: agent, tag: "" }
|
backend:
|
||||||
agentWeb: { repository: agent-web, tag: "" }
|
repository: agent
|
||||||
postgres: { repository: postgres, tag: "17" }
|
tag: ""
|
||||||
|
frontend:
|
||||||
|
repository: agent-web
|
||||||
|
tag: ""
|
||||||
|
postgres:
|
||||||
|
repository: docker.io/library/postgres
|
||||||
|
tag: "17"
|
||||||
|
agent: {}
|
||||||
|
agentWeb: {}
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
backend: 8080
|
backend: 8080
|
||||||
@@ -35,16 +45,10 @@ sharedInfra:
|
|||||||
host: ultra-service
|
host: ultra-service
|
||||||
port: 8080
|
port: 8080
|
||||||
postgres:
|
postgres:
|
||||||
adminUsername: postgres
|
username: postgres
|
||||||
appUsername: agent_runtime
|
password: "Admin12345"
|
||||||
port: 5432
|
port: 5432
|
||||||
idleInTransactionSessionTimeout: 60s
|
idleInTransactionSessionTimeout: 60s
|
||||||
credentialsSecret:
|
|
||||||
# Leave empty to use <role>-<site>-postgres-credentials.
|
|
||||||
name: ""
|
|
||||||
adminPasswordKey: admin-password
|
|
||||||
appPasswordKey: app-password
|
|
||||||
connectionStringKey: connection-string
|
|
||||||
redis:
|
redis:
|
||||||
host: redis-service
|
host: redis-service
|
||||||
port: 6379
|
port: 6379
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-audit
|
name: mixingx-audit
|
||||||
description: MixingX audit service.
|
description: MixingX audit service.
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 1.0.44
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.44"
|
||||||
@@ -2,13 +2,6 @@
|
|||||||
{{- .Values.storage.className | default "local-path" -}}
|
{{- .Values.storage.className | default "local-path" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mixingx-audit.image" -}}
|
|
||||||
{{- $registry := required "global.imageRegistry is required" .registry -}}
|
|
||||||
{{- $repository := required "image.repository is required" .image.repository -}}
|
|
||||||
{{- $tag := required "image.tag is required" .image.tag -}}
|
|
||||||
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "mixingx-audit.tierAffinity" -}}
|
{{- define "mixingx-audit.tierAffinity" -}}
|
||||||
{{- $root := .root -}}
|
{{- $root := .root -}}
|
||||||
{{- $role := .role -}}
|
{{- $role := .role -}}
|
||||||
|
|||||||
@@ -32,18 +32,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ .Values.audit.database }}-postgres
|
app.kubernetes.io/component: {{ .Values.audit.database }}-postgres
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-audit.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
{{ include "mixingx-audit.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||||
# postgres 以专用用户直跑,绕过镜像内 gosu(新内核下 gosu 用户态死循环,
|
{{- with $.Values.imagePullSecrets }}
|
||||||
# 见 ADR/工单:kernel 7.0.0-39+ × gosu 兼容 bug;三件套缺一不可)
|
imagePullSecrets:
|
||||||
securityContext:
|
{{- toYaml . | nindent 8 }}
|
||||||
runAsUser: 999
|
{{- end }}
|
||||||
runAsGroup: 999
|
|
||||||
fsGroup: 999
|
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
command: ["docker-entrypoint.sh", "postgres"]
|
image: {{ $root.Values.sharedInfra.postgres.image | default "docker.io/library/postgres:17" }}
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
image: {{ include "mixingx-audit.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.postgres) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
|
|||||||
@@ -22,9 +22,13 @@ spec:
|
|||||||
app.kubernetes.io/component: audit-nanomq
|
app.kubernetes.io/component: audit-nanomq
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-audit.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
{{ include "mixingx-audit.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: nanomq
|
- name: nanomq
|
||||||
image: {{ include "mixingx-audit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.nanomq) | quote }}
|
image: {{ .Values.audit.mqtt.image | default "emqx/nanomq:0.25.2-2" }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
command: ["/bin/sh"]
|
command: ["/bin/sh"]
|
||||||
args:
|
args:
|
||||||
|
|||||||
@@ -20,9 +20,13 @@ spec:
|
|||||||
app.kubernetes.io/component: audit-web
|
app.kubernetes.io/component: audit-web
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-audit.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
{{ include "mixingx-audit.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: audit-web
|
- name: audit-web
|
||||||
image: {{ include "mixingx-audit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.auditWeb) | quote }}
|
image: "{{ .Values.registry }}/{{ .Values.images.auditWeb.repository | default "audit-web" }}:{{ .Values.images.auditWeb.tag | default .Values.tag | default "latest" }}"
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
@@ -19,9 +19,13 @@ spec:
|
|||||||
app.kubernetes.io/component: audit
|
app.kubernetes.io/component: audit
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-audit.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
{{ include "mixingx-audit.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: audit
|
- name: audit
|
||||||
image: {{ include "mixingx-audit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.audit) | quote }}
|
image: "{{ .Values.registry }}/{{ .Values.images.audit.repository | default "audit" }}:{{ .Values.images.audit.tag | default .Values.tag | default "latest" }}"
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
global:
|
registry: 192.168.1.105:8888/mixingx
|
||||||
imageRegistry: ""
|
tag: latest
|
||||||
|
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
# 客户环境由 environments/_common 注入 imagePullSecrets(ADR-0066);内网留空=匿名拉取,行为不变
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
className: local-path
|
className: local-path
|
||||||
|
|
||||||
sharedInfra:
|
sharedInfra:
|
||||||
postgres:
|
postgres:
|
||||||
|
image: docker.io/library/postgres:17
|
||||||
username: postgres
|
username: postgres
|
||||||
password: "Admin12345"
|
password: "Admin12345"
|
||||||
port: 5432
|
port: 5432
|
||||||
@@ -28,6 +31,7 @@ audit:
|
|||||||
ssoBaseUrl: "http://sso-service:8080"
|
ssoBaseUrl: "http://sso-service:8080"
|
||||||
# 中心 Audit Broker(ADR-0048)与 audit 专属 PostgreSQL 随本 chart 发布(ADR-0065)
|
# 中心 Audit Broker(ADR-0048)与 audit 专属 PostgreSQL 随本 chart 发布(ADR-0065)
|
||||||
mqtt:
|
mqtt:
|
||||||
|
image: "emqx/nanomq:0.25.2-2"
|
||||||
brokerHost: "audit-nanomq-service"
|
brokerHost: "audit-nanomq-service"
|
||||||
brokerPort: 1883
|
brokerPort: 1883
|
||||||
managementPort: 8081
|
managementPort: 8081
|
||||||
@@ -41,10 +45,12 @@ audit:
|
|||||||
concurrency: 4
|
concurrency: 4
|
||||||
|
|
||||||
images:
|
images:
|
||||||
audit: { repository: audit, tag: "" }
|
audit:
|
||||||
auditWeb: { repository: audit-web, tag: "" }
|
repository: audit
|
||||||
postgres: { repository: postgres, tag: "17" }
|
tag: ""
|
||||||
nanomq: { repository: nanomq, tag: "0.25.2-2" }
|
auditWeb:
|
||||||
|
repository: audit-web
|
||||||
|
tag: ""
|
||||||
|
|
||||||
tier:
|
tier:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-edge-unit
|
name: mixingx-edge-unit
|
||||||
description: "One MixingX edge unit release with durable local revision storage."
|
description: "One MixingX edge unit release with durable local revision storage."
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 1.0.44
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.44"
|
||||||
@@ -43,13 +43,6 @@ AuditMqttPublisher__NodeId: "{{ .Values.audit.publisher.nodeId | default $name }
|
|||||||
{{- printf "/%s-%s" .Values.role (.Values.site | toString) -}}
|
{{- printf "/%s-%s" .Values.role (.Values.site | toString) -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mixingx-edge-unit.image" -}}
|
|
||||||
{{- $registry := required "global.imageRegistry is required" .registry -}}
|
|
||||||
{{- $repository := required "image.repository is required" .image.repository -}}
|
|
||||||
{{- $tag := required "image.tag is required" .image.tag -}}
|
|
||||||
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "mixingx-unit.storageClassName" -}}
|
{{- define "mixingx-unit.storageClassName" -}}
|
||||||
{{- .Values.storage.className | default "local-path" -}}
|
{{- .Values.storage.className | default "local-path" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|||||||
@@ -23,9 +23,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $brokerName }}
|
app.kubernetes.io/component: {{ $brokerName }}
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-unit.backendScheduling" . | nindent 6 }}
|
{{ include "mixingx-unit.backendScheduling" . | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: nanomq
|
- name: nanomq
|
||||||
image: {{ include "mixingx-edge-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.nanomq) | quote }}
|
image: "{{ .Values.mqtt.image.repository }}:{{ .Values.mqtt.image.tag }}"
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: mqtt
|
- name: mqtt
|
||||||
|
|||||||
@@ -55,13 +55,18 @@ spec:
|
|||||||
secret:
|
secret:
|
||||||
secretName: {{ required "edgeSecrets.mounts[].secretName is required" $secret.secretName | quote }}
|
secretName: {{ required "edgeSecrets.mounts[].secretName is required" $secret.secretName | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ $name }}
|
- name: {{ $name }}
|
||||||
image: {{ include "mixingx-edge-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.edge) | quote }}
|
{{ $backendImg := .Values.images.backend }}
|
||||||
|
{{ $edgeImg := .Values.images.edge | default dict }}
|
||||||
|
{{ $backendRepo := $edgeImg.repository | default $backendImg.repository }}
|
||||||
|
{{ $backendTag := $edgeImg.tag | default $backendImg.tag | default .Values.tag | default "latest" }}
|
||||||
|
image: {{ .Values.registry }}/{{ $backendRepo }}:{{ $backendTag }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
|
||||||
appArmorProfile:
|
|
||||||
type: Unconfined
|
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.ports.backend }}
|
containerPort: {{ .Values.ports.backend }}
|
||||||
@@ -166,9 +171,17 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $webName }}
|
app.kubernetes.io/component: {{ $webName }}
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-unit.followerScheduling" . | nindent 6 }}
|
{{ include "mixingx-unit.followerScheduling" . | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ $webName }}
|
- name: {{ $webName }}
|
||||||
image: {{ include "mixingx-edge-unit.image" (dict "registry" .Values.global.imageRegistry "image" .Values.images.edgeWeb) | quote }}
|
{{ $frontendImg := .Values.images.frontend }}
|
||||||
|
{{ $edgeWebImg := .Values.images.edgeWeb | default dict }}
|
||||||
|
{{ $frontendRepo := $edgeWebImg.repository | default $frontendImg.repository }}
|
||||||
|
{{ $frontendTag := $edgeWebImg.tag | default $frontendImg.tag | default .Values.tag | default "latest" }}
|
||||||
|
image: {{ .Values.registry }}/{{ $frontendRepo }}:{{ $frontendTag }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
global:
|
registry: 192.168.1.105:8888/mixingx
|
||||||
imageRegistry: ""
|
tag: latest
|
||||||
|
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
# 客户环境由 environments/_common 注入 imagePullSecrets(ADR-0066);内网留空=匿名拉取,行为不变
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
|
||||||
role: edge
|
role: edge
|
||||||
site: "0"
|
site: "0"
|
||||||
@@ -10,9 +12,14 @@ serviceId: ""
|
|||||||
idWorkerId: 17
|
idWorkerId: 17
|
||||||
|
|
||||||
images:
|
images:
|
||||||
edge: { repository: edge, tag: "" }
|
backend:
|
||||||
edgeWeb: { repository: edge-web, tag: "" }
|
repository: edge
|
||||||
nanomq: { repository: nanomq, tag: "0.25.2-2" }
|
tag: ""
|
||||||
|
frontend:
|
||||||
|
repository: edge-web
|
||||||
|
tag: ""
|
||||||
|
edge: {}
|
||||||
|
edgeWeb: {}
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
backend: 8080
|
backend: 8080
|
||||||
@@ -58,6 +65,9 @@ sharedInfra:
|
|||||||
|
|
||||||
mqtt:
|
mqtt:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
image:
|
||||||
|
repository: emqx/nanomq
|
||||||
|
tag: 0.25.2-2
|
||||||
port: 1883
|
port: 1883
|
||||||
wsPort: 8083 # WebSocket listener(NanoMQ 镜像默认开启,路径 /mqtt),供 MQTTX Web 连接
|
wsPort: 8083 # WebSocket listener(NanoMQ 镜像默认开启,路径 /mqtt),供 MQTTX Web 连接
|
||||||
credentialRef: "" # 默认空,模板内 default 为 {name}-mqtt
|
credentialRef: "" # 默认空,模板内 default 为 {name}-mqtt
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-gateway
|
name: mixingx-gateway
|
||||||
description: MixingX gateway service, RBAC, and root ingress.
|
description: MixingX gateway service, RBAC, and root ingress.
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 1.0.44
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.44"
|
||||||
@@ -2,13 +2,6 @@
|
|||||||
{{- .Values.storage.className | default "local-path" -}}
|
{{- .Values.storage.className | default "local-path" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mixingx-gateway.image" -}}
|
|
||||||
{{- $registry := required "global.imageRegistry is required" .registry -}}
|
|
||||||
{{- $repository := required "image.repository is required" .image.repository -}}
|
|
||||||
{{- $tag := required "image.tag is required" .image.tag -}}
|
|
||||||
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "mixingx-gateway.tierAffinity" -}}
|
{{- define "mixingx-gateway.tierAffinity" -}}
|
||||||
{{- $root := .root -}}
|
{{- $root := .root -}}
|
||||||
{{- $role := .role -}}
|
{{- $role := .role -}}
|
||||||
|
|||||||
@@ -26,13 +26,14 @@ spec:
|
|||||||
serviceAccountName: gateway-sa
|
serviceAccountName: gateway-sa
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ include "mixingx-gateway.tierAffinity" (dict "role" "gateway" "root" $) | nindent 6 }}
|
{{ include "mixingx-gateway.tierAffinity" (dict "role" "gateway" "root" $) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: gateway
|
- name: gateway
|
||||||
image: {{ include "mixingx-gateway.image" (dict "registry" .Values.global.imageRegistry "image" $gatewayImage) | quote }}
|
image: {{ .Values.registry }}/{{ $gatewayImage.repository | default "gateway" }}:{{ $gatewayImage.tag | default .Values.tag | default "latest" }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
|
||||||
appArmorProfile:
|
|
||||||
type: Unconfined
|
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ .Values.gateway.port | default 8080 }}
|
containerPort: {{ .Values.gateway.port | default 8080 }}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
global:
|
registry: 192.168.1.119:8888/mixingx
|
||||||
imageRegistry: ""
|
tag: latest
|
||||||
|
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
# 客户环境由 environments/_common 注入 imagePullSecrets(ADR-0066);内网留空=匿名拉取,行为不变
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
className: local-path
|
className: local-path
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-infra
|
name: mixingx-infra
|
||||||
description: MixingX shared infrastructure services (Redis, MongoDB, RabbitMQ).
|
description: MixingX shared infrastructure services (Redis, MongoDB, RabbitMQ).
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 1.0.44
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.44"
|
||||||
@@ -2,13 +2,6 @@
|
|||||||
{{- .Values.storage.className | default "local-path" -}}
|
{{- .Values.storage.className | default "local-path" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mixingx-infra.image" -}}
|
|
||||||
{{- $registry := required "global.imageRegistry is required" .registry -}}
|
|
||||||
{{- $repository := required "image.repository is required" .image.repository -}}
|
|
||||||
{{- $tag := required "image.tag is required" .image.tag -}}
|
|
||||||
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "mixingx-infra.tierAffinity" -}}
|
{{- define "mixingx-infra.tierAffinity" -}}
|
||||||
{{- $root := .root -}}
|
{{- $root := .root -}}
|
||||||
{{- $role := .role -}}
|
{{- $role := .role -}}
|
||||||
|
|||||||
@@ -31,10 +31,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ .name }}
|
app.kubernetes.io/component: {{ .name }}
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-infra.tierAffinity" (dict "role" "sharedDatastores" "root" $root) | nindent 6 }}
|
{{ include "mixingx-infra.tierAffinity" (dict "role" "sharedDatastores" "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
{{ $image := index $root.Values.images .image }}
|
image: {{ .image }}
|
||||||
image: {{ include "mixingx-infra.image" (dict "registry" $root.Values.global.imageRegistry "image" $image) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: tcp
|
- name: tcp
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
global:
|
registry: 192.168.1.105:8888/mixingx
|
||||||
imageRegistry: ""
|
tag: latest
|
||||||
|
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
# 客户环境由 environments/_common 注入 imagePullSecrets(ADR-0066);内网留空=匿名拉取,行为不变
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
className: local-path
|
className: local-path
|
||||||
|
|
||||||
sharedInfra:
|
sharedInfra:
|
||||||
postgres:
|
postgres:
|
||||||
|
image: docker.io/library/postgres:17
|
||||||
username: postgres
|
username: postgres
|
||||||
password: "Admin12345"
|
password: "Admin12345"
|
||||||
port: 5432
|
port: 5432
|
||||||
@@ -36,25 +39,19 @@ tier:
|
|||||||
services:
|
services:
|
||||||
sharedDatastores: { mode: required, tiers: [infra] }
|
sharedDatastores: { mode: required, tiers: [infra] }
|
||||||
|
|
||||||
images:
|
|
||||||
postgres: { repository: postgres, tag: "17" }
|
|
||||||
redis: { repository: redis, tag: "8.6" }
|
|
||||||
mongo: { repository: mongo, tag: "8.3" }
|
|
||||||
rabbitmq: { repository: rabbitmq, tag: "4.3-management" }
|
|
||||||
|
|
||||||
sharedDatastores:
|
sharedDatastores:
|
||||||
- name: redis
|
- name: redis
|
||||||
image: redis
|
image: docker.io/library/redis:8.6
|
||||||
port: 6379
|
port: 6379
|
||||||
storage: 2Gi
|
storage: 2Gi
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
- name: mongo
|
- name: mongo
|
||||||
image: mongo
|
image: docker.io/library/mongo:8.3
|
||||||
port: 27017
|
port: 27017
|
||||||
storage: 5Gi
|
storage: 5Gi
|
||||||
mountPath: /data/db
|
mountPath: /data/db
|
||||||
- name: messaging
|
- name: messaging
|
||||||
image: rabbitmq
|
image: docker.io/library/rabbitmq:4.3-management
|
||||||
port: 5672
|
port: 5672
|
||||||
storage: 2Gi
|
storage: 2Gi
|
||||||
mountPath: /var/lib/rabbitmq
|
mountPath: /var/lib/rabbitmq
|
||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-mqttx
|
name: mixingx-mqttx
|
||||||
description: MixingX MQTTX Web — 浏览器端 MQTT 客户端,用于监控/调试各 Edge 的 NanoMQ broker。
|
description: MixingX MQTTX Web — 浏览器端 MQTT 客户端,用于监控/调试各 Edge 的 NanoMQ broker。
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 1.0.44
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.44"
|
||||||
@@ -4,10 +4,3 @@
|
|||||||
{{- define "mixingx-mqttx.name" -}}
|
{{- define "mixingx-mqttx.name" -}}
|
||||||
{{- .Values.mqttx.name | default "mqttx" -}}
|
{{- .Values.mqttx.name | default "mqttx" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mixingx-mqttx.image" -}}
|
|
||||||
{{- $registry := required "global.imageRegistry is required" .registry -}}
|
|
||||||
{{- $repository := required "image.repository is required" .image.repository -}}
|
|
||||||
{{- $tag := required "image.tag is required" .image.tag -}}
|
|
||||||
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -19,9 +19,13 @@ spec:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/component: {{ $name }}
|
app.kubernetes.io/component: {{ $name }}
|
||||||
spec:
|
spec:
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ $name }}
|
- name: {{ $name }}
|
||||||
image: {{ include "mixingx-mqttx.image" (dict "registry" .Values.global.imageRegistry "image" .Values.mqttx.image) | quote }}
|
image: "{{ .Values.mqttx.image.repository }}:{{ .Values.mqttx.image.tag | default "latest" }}"
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
# emqx/mqttx-web 镜像默认 http-server 未显式绑 0.0.0.0,导致只听 loopback、
|
# emqx/mqttx-web 镜像默认 http-server 未显式绑 0.0.0.0,导致只听 loopback、
|
||||||
# Service/Pod IP 进不来。显式覆盖启动参数,强制监听所有接口。
|
# Service/Pod IP 进不来。显式覆盖启动参数,强制监听所有接口。
|
||||||
|
|||||||
@@ -9,17 +9,17 @@
|
|||||||
#
|
#
|
||||||
# Ingress:demo 环境有 *.mixingx.local DNS,用 host 暴露;无 DNS 的现场改用 NodePort。
|
# Ingress:demo 环境有 *.mixingx.local DNS,用 host 暴露;无 DNS 的现场改用 NodePort。
|
||||||
|
|
||||||
global:
|
|
||||||
imageRegistry: ""
|
|
||||||
|
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
# 客户环境由 environments/_common 注入 imagePullSecrets(ADR-0066);内网留空=匿名拉取,行为不变
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
|
||||||
mqttx:
|
mqttx:
|
||||||
name: mqttx
|
name: mqttx
|
||||||
replicas: 1
|
replicas: 1
|
||||||
image:
|
image:
|
||||||
repository: mqttx-web
|
repository: emqx/mqttx-web
|
||||||
tag: ""
|
tag: latest
|
||||||
description: "MQTT 监控客户端"
|
description: "MQTT 监控客户端"
|
||||||
|
|
||||||
ingress:
|
ingress:
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-network-agent
|
name: mixingx-network-agent
|
||||||
description: "MixingX network console agent: 每节点常驻,提供主机网口(IP/掩码/网关/DNS)与 WiFi 的可视化配置 API。"
|
description: "MixingX network console agent: 每节点常驻,提供主机网口(IP/掩码/网关/DNS)与 WiFi 的可视化配置 API。"
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 1.0.44
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.44"
|
||||||
@@ -29,6 +29,10 @@ spec:
|
|||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ toYaml .Values.nodeSelector | indent 8 }}
|
{{ toYaml .Values.nodeSelector | indent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: network-agent
|
- name: network-agent
|
||||||
image: {{ .Values.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default "latest" }}
|
image: {{ .Values.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default "latest" }}
|
||||||
@@ -51,13 +55,10 @@ spec:
|
|||||||
- name: K3S_RESTART_ON_IP_CHANGE
|
- name: K3S_RESTART_ON_IP_CHANGE
|
||||||
value: {{ .Values.k3sRestartOnIpChange | quote }}
|
value: {{ .Values.k3sRestartOnIpChange | quote }}
|
||||||
securityContext:
|
securityContext:
|
||||||
# 只需 root + D-Bus socket,无需 privileged
|
# 只需 root + D-Bus socket,无需 privileged 与额外 capability:
|
||||||
# NET_ADMIN: 清除切换静态后残留的动态地址(ip addr del 需要此能力)
|
# nmcli 经 D-Bus 操作主机 NM,特权动作(改 IP/路由)全部由 NM 进程执行
|
||||||
runAsUser: 0
|
runAsUser: 0
|
||||||
allowPrivilegeEscalation: false
|
allowPrivilegeEscalation: false
|
||||||
capabilities:
|
|
||||||
add:
|
|
||||||
- NET_ADMIN
|
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /api/network/health
|
path: /api/network/health
|
||||||
@@ -80,15 +81,15 @@ spec:
|
|||||||
# 主机 system bus: nmcli 与 systemd 重启都走它
|
# 主机 system bus: nmcli 与 systemd 重启都走它
|
||||||
- name: dbus
|
- name: dbus
|
||||||
mountPath: /run/dbus/system_bus_socket
|
mountPath: /run/dbus/system_bus_socket
|
||||||
- name: nm-run
|
# 网卡别名持久化: aliases.json 落宿主机,重启/重建 Pod 均保留
|
||||||
mountPath: /run/NetworkManager
|
- name: alias-store
|
||||||
readOnly: true
|
mountPath: /var/lib/mixingx/network-agent
|
||||||
volumes:
|
volumes:
|
||||||
- name: dbus
|
- name: dbus
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /run/dbus/system_bus_socket
|
path: /run/dbus/system_bus_socket
|
||||||
type: Socket
|
type: Socket
|
||||||
- name: nm-run
|
- name: alias-store
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /run/NetworkManager
|
path: /var/lib/mixingx/network-agent
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
# Headless 诊断服务: DNS network-agent 返回各节点 agent 的全部地址。
|
# Headless 诊断服务: DNS network-agent 返回各节点 agent 的全部地址。
|
||||||
# 注意: 每个 agent 只管理自己所在节点,不要用普通 ClusterIP Service 访问
|
# 注意: 每个 agent 只管理自己所在节点,不要用普通 ClusterIP Service 访问
|
||||||
# (会在节点间随机负载均衡导致操作到错误的主机)。前端弹窗始终直连节点 IP。
|
# (会在节点间随机负载均衡导致操作到错误的主机)。前端弹窗始终直连节点 IP。
|
||||||
|
# mixingx.io/role 标签让 Gateway 发现该服务并生成 /api/network/** 透传路由,
|
||||||
|
# 前端网络设置弹窗经 Gateway 同源转发访问(消除跨域)。
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
@@ -8,6 +10,8 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: mixingx
|
app.kubernetes.io/name: mixingx
|
||||||
app.kubernetes.io/component: network-agent
|
app.kubernetes.io/component: network-agent
|
||||||
|
mixingx.io/role: network-agent
|
||||||
|
mixingx.io/node-id: network-agent
|
||||||
spec:
|
spec:
|
||||||
clusterIP: None
|
clusterIP: None
|
||||||
selector:
|
selector:
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-platform
|
name: mixingx-platform
|
||||||
description: MixingX central platform services without customer edge/agent instances.
|
description: MixingX central platform services without customer edge/agent instances.
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 1.0.44
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.44"
|
||||||
@@ -2,13 +2,6 @@
|
|||||||
{{- .Values.storage.className | default "local-path" -}}
|
{{- .Values.storage.className | default "local-path" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mixingx-platform.image" -}}
|
|
||||||
{{- $registry := required "global.imageRegistry is required" .registry -}}
|
|
||||||
{{- $repository := required "image.repository is required" .image.repository -}}
|
|
||||||
{{- $tag := required "image.tag is required" .image.tag -}}
|
|
||||||
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "mixingx-platform.tierAffinity" -}}
|
{{- define "mixingx-platform.tierAffinity" -}}
|
||||||
{{- $root := .root -}}
|
{{- $root := .root -}}
|
||||||
{{- $role := .role -}}
|
{{- $role := .role -}}
|
||||||
|
|||||||
@@ -25,14 +25,14 @@ spec:
|
|||||||
serviceAccountName: gateway-sa
|
serviceAccountName: gateway-sa
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ include "mixingx-platform.tierAffinity" (dict "role" .role "root" $root) | nindent 6 }}
|
{{ include "mixingx-platform.tierAffinity" (dict "role" .role "root" $root) | nindent 6 }}
|
||||||
|
{{- with $root.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
{{ $image := index $root.Values.images .image }}
|
image: {{ $root.Values.registry }}/{{ .image }}:{{ $root.Values.tag | default "latest" }}
|
||||||
image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $image) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
|
||||||
appArmorProfile:
|
|
||||||
type: Unconfined
|
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ $port }}
|
containerPort: {{ $port }}
|
||||||
@@ -160,10 +160,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ .name }}
|
app.kubernetes.io/component: {{ .name }}
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-platform.tierAffinity" (dict "role" .tierRole "root" $root) | nindent 6 }}
|
{{ include "mixingx-platform.tierAffinity" (dict "role" .tierRole "root" $root) | nindent 6 }}
|
||||||
|
{{- with $root.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
{{ $image := index $root.Values.images .image }}
|
image: {{ $root.Values.registry }}/{{ .image }}:{{ $root.Values.tag | default "latest" }}
|
||||||
image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $image) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
@@ -229,9 +232,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ .name }}-postgres
|
app.kubernetes.io/component: {{ .name }}-postgres
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-platform.tierAffinity" (dict "role" .tierRole "root" $root) | nindent 6 }}
|
{{ include "mixingx-platform.tierAffinity" (dict "role" .tierRole "root" $root) | nindent 6 }}
|
||||||
|
{{- with $root.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.postgres) | quote }}
|
image: {{ $root.Values.sharedInfra.postgres.image | default "docker.io/library/postgres:17" }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
|
|||||||
@@ -20,10 +20,13 @@ spec:
|
|||||||
app.kubernetes.io/component: audit
|
app.kubernetes.io/component: audit
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: audit
|
- name: audit
|
||||||
{{ $auditImage := index .Values.images .Values.audit.image }}
|
image: "{{ .Values.registry }}/{{ .Values.audit.image }}:{{ .Values.tag | default "latest" }}"
|
||||||
image: {{ include "mixingx-platform.image" (dict "registry" .Values.global.imageRegistry "image" $auditImage) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
@@ -142,10 +145,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ .Values.audit.webName }}
|
app.kubernetes.io/component: {{ .Values.audit.webName }}
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .Values.audit.webName }}
|
- name: {{ .Values.audit.webName }}
|
||||||
{{ $auditWebImage := index .Values.images .Values.audit.webImage }}
|
image: "{{ .Values.registry }}/{{ .Values.audit.webImage }}:{{ .Values.tag | default "latest" }}"
|
||||||
image: {{ include "mixingx-platform.image" (dict "registry" .Values.global.imageRegistry "image" $auditWebImage) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
@@ -208,18 +214,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ .Values.audit.database }}-postgres
|
app.kubernetes.io/component: {{ .Values.audit.database }}-postgres
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
{{ include "mixingx-platform.tierAffinity" (dict "role" "audit" "root" $root) | nindent 6 }}
|
||||||
# postgres 以专用用户直跑,绕过镜像内 gosu(新内核下 gosu 用户态死循环,
|
{{- with $.Values.imagePullSecrets }}
|
||||||
# 见 ADR/工单:kernel 7.0.0-39+ × gosu 兼容 bug;三件套缺一不可)
|
imagePullSecrets:
|
||||||
securityContext:
|
{{- toYaml . | nindent 8 }}
|
||||||
runAsUser: 999
|
{{- end }}
|
||||||
runAsGroup: 999
|
|
||||||
fsGroup: 999
|
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
command: ["docker-entrypoint.sh", "postgres"]
|
image: {{ $root.Values.sharedInfra.postgres.image | default "docker.io/library/postgres:17" }}
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.postgres) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
|
|||||||
@@ -31,10 +31,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ .name }}
|
app.kubernetes.io/component: {{ .name }}
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-platform.tierAffinity" (dict "role" "sharedDatastores" "root" $root) | nindent 6 }}
|
{{ include "mixingx-platform.tierAffinity" (dict "role" "sharedDatastores" "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ .name }}
|
- name: {{ .name }}
|
||||||
{{ $image := index $root.Values.images .image }}
|
image: {{ .image }}
|
||||||
image: {{ include "mixingx-platform.image" (dict "registry" $root.Values.global.imageRegistry "image" $image) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: tcp
|
- name: tcp
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
global:
|
registry: 192.168.1.105:8888/mixingx
|
||||||
imageRegistry: ""
|
tag: latest
|
||||||
|
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
# 客户环境由 environments/_common 注入 imagePullSecrets(ADR-0066);内网留空=匿名拉取,行为不变
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
className: local-path
|
className: local-path
|
||||||
|
|
||||||
sharedInfra:
|
sharedInfra:
|
||||||
postgres:
|
postgres:
|
||||||
|
image: docker.io/library/postgres:17
|
||||||
username: postgres
|
username: postgres
|
||||||
password: "Admin12345"
|
password: "Admin12345"
|
||||||
port: 5432
|
port: 5432
|
||||||
@@ -40,26 +43,12 @@ tier:
|
|||||||
audit: { mode: required, tiers: [infra] }
|
audit: { mode: required, tiers: [infra] }
|
||||||
sharedDatastores: { mode: required, tiers: [infra] }
|
sharedDatastores: { mode: required, tiers: [infra] }
|
||||||
|
|
||||||
images:
|
|
||||||
gateway: { repository: gateway, tag: "" }
|
|
||||||
sso: { repository: sso, tag: "" }
|
|
||||||
ssoWeb: { repository: sso-web, tag: "" }
|
|
||||||
ultra: { repository: ultra, tag: "" }
|
|
||||||
ultraWeb: { repository: ultra-web, tag: "" }
|
|
||||||
audit: { repository: audit, tag: "" }
|
|
||||||
auditWeb: { repository: audit-web, tag: "" }
|
|
||||||
postgres: { repository: postgres, tag: "17" }
|
|
||||||
redis: { repository: redis, tag: "8.6" }
|
|
||||||
mongo: { repository: mongo, tag: "8.3" }
|
|
||||||
rabbitmq: { repository: rabbitmq, tag: "4.3-management" }
|
|
||||||
nanomq: { repository: nanomq, tag: "0.25.2-2" }
|
|
||||||
|
|
||||||
standalones:
|
standalones:
|
||||||
- name: sso
|
- name: sso
|
||||||
image: sso
|
image: sso
|
||||||
role: sso
|
role: sso
|
||||||
webName: sso-web
|
webName: sso-web
|
||||||
webImage: ssoWeb
|
webImage: sso-web
|
||||||
webBasePath: /sso/
|
webBasePath: /sso/
|
||||||
serviceId: sso
|
serviceId: sso
|
||||||
database: sso-db
|
database: sso-db
|
||||||
@@ -71,7 +60,7 @@ standalones:
|
|||||||
image: ultra
|
image: ultra
|
||||||
role: ultra
|
role: ultra
|
||||||
webName: ultra-web
|
webName: ultra-web
|
||||||
webImage: ultraWeb
|
webImage: ultra-web
|
||||||
webBasePath: /ultra/
|
webBasePath: /ultra/
|
||||||
serviceId: ultra
|
serviceId: ultra
|
||||||
database: ultra-db
|
database: ultra-db
|
||||||
@@ -91,7 +80,7 @@ audit:
|
|||||||
port: 5900
|
port: 5900
|
||||||
replicas: 2
|
replicas: 2
|
||||||
webName: audit-web
|
webName: audit-web
|
||||||
webImage: auditWeb
|
webImage: audit-web
|
||||||
webBasePath: /audit/
|
webBasePath: /audit/
|
||||||
webPort: 8900
|
webPort: 8900
|
||||||
database: audit-db
|
database: audit-db
|
||||||
@@ -110,22 +99,22 @@ audit:
|
|||||||
|
|
||||||
sharedDatastores:
|
sharedDatastores:
|
||||||
- name: redis
|
- name: redis
|
||||||
image: redis
|
image: docker.io/library/redis:8.6
|
||||||
port: 6379
|
port: 6379
|
||||||
storage: 2Gi
|
storage: 2Gi
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
- name: mongo
|
- name: mongo
|
||||||
image: mongo
|
image: docker.io/library/mongo:8.3
|
||||||
port: 27017
|
port: 27017
|
||||||
storage: 5Gi
|
storage: 5Gi
|
||||||
mountPath: /data/db
|
mountPath: /data/db
|
||||||
- name: messaging
|
- name: messaging
|
||||||
image: rabbitmq
|
image: docker.io/library/rabbitmq:4.3-management
|
||||||
port: 5672
|
port: 5672
|
||||||
storage: 2Gi
|
storage: 2Gi
|
||||||
mountPath: /var/lib/rabbitmq
|
mountPath: /var/lib/rabbitmq
|
||||||
- name: audit-nanomq
|
- name: audit-nanomq
|
||||||
image: nanomq
|
image: emqx/nanomq:0.25.2-2
|
||||||
port: 1883
|
port: 1883
|
||||||
storage: 1Gi
|
storage: 1Gi
|
||||||
mountPath: /var/lib/nanomq
|
mountPath: /var/lib/nanomq
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-protocol-server-unit
|
name: mixingx-protocol-server-unit
|
||||||
description: Deploy one MixingX edge protocol test server instance.
|
description: Deploy one MixingX edge protocol test server instance.
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 1.0.44
|
||||||
appVersion: "1.0.0"
|
appVersion: "1.0.44"
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{{- define "mixingx-protocol-server-unit.image" -}}
|
|
||||||
{{- $registry := required "global.imageRegistry is required" .registry -}}
|
|
||||||
{{- $repository := required "image.repository is required" .image.repository -}}
|
|
||||||
{{- $tag := required "image.tag is required" .image.tag -}}
|
|
||||||
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
|
|
||||||
{{- end -}}
|
|
||||||
@@ -24,9 +24,13 @@ spec:
|
|||||||
{{ toYaml . | nindent 8 }}
|
{{ toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- $proto := index .Values.images.protocol .Values.type }}
|
{{- $proto := index .Values.images.protocol .Values.type }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: protocol-server
|
- name: protocol-server
|
||||||
image: {{ include "mixingx-protocol-server-unit.image" (dict "registry" .Values.global.imageRegistry "image" $proto) | quote }}
|
image: {{ .Values.registry }}/{{ $proto.repository | default .Values.image }}:{{ $proto.tag | default .Values.tag | default "latest" }}
|
||||||
imagePullPolicy: {{ .Values.imagePullPolicy }}
|
imagePullPolicy: {{ .Values.imagePullPolicy }}
|
||||||
args:
|
args:
|
||||||
- "--port"
|
- "--port"
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
global:
|
registry: 192.168.1.105:8888/mixingx
|
||||||
imageRegistry: ""
|
tag: latest
|
||||||
|
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
# 客户环境由 environments/_common 注入 imagePullSecrets(ADR-0066);内网留空=匿名拉取,行为不变
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
|
||||||
# Legacy image override (kept for backward compatibility).
|
# Legacy image override (kept for backward compatibility).
|
||||||
type: opcua
|
type: opcua
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-sso
|
name: mixingx-sso
|
||||||
description: MixingX SSO standalone release (backend, web, and PostgreSQL).
|
description: MixingX SSO standalone release (backend, web, and PostgreSQL).
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 1.0.44
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.44"
|
||||||
@@ -2,13 +2,6 @@
|
|||||||
{{- .Values.storage.className | default "local-path" -}}
|
{{- .Values.storage.className | default "local-path" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mixingx-sso.image" -}}
|
|
||||||
{{- $registry := required "global.imageRegistry is required" .registry -}}
|
|
||||||
{{- $repository := required "image.repository is required" .image.repository -}}
|
|
||||||
{{- $tag := required "image.tag is required" .image.tag -}}
|
|
||||||
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "mixingx-sso.configData" -}}
|
{{- define "mixingx-sso.configData" -}}
|
||||||
{{- $root := . -}}
|
{{- $root := . -}}
|
||||||
{{- $name := $root.Values.sso.name -}}
|
{{- $name := $root.Values.sso.name -}}
|
||||||
|
|||||||
@@ -28,13 +28,14 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $name }}
|
app.kubernetes.io/component: {{ $name }}
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-sso.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
{{ include "mixingx-sso.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ $name }}
|
- name: {{ $name }}
|
||||||
image: {{ include "mixingx-sso.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.sso) | quote }}
|
image: {{ $root.Values.registry }}/{{ $root.Values.images.sso.repository | default "sso" }}:{{ $root.Values.images.sso.tag | default $root.Values.tag | default "latest" }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
|
||||||
appArmorProfile:
|
|
||||||
type: Unconfined
|
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ $backendPort }}
|
containerPort: {{ $backendPort }}
|
||||||
@@ -129,9 +130,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $webName }}
|
app.kubernetes.io/component: {{ $webName }}
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-sso.tierAffinity" (dict "role" "web" "root" $root) | nindent 6 }}
|
{{ include "mixingx-sso.tierAffinity" (dict "role" "web" "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ $webName }}
|
- name: {{ $webName }}
|
||||||
image: {{ include "mixingx-sso.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.ssoWeb) | quote }}
|
image: {{ $root.Values.registry }}/{{ $root.Values.images.ssoWeb.repository | default "sso-web" }}:{{ $root.Values.images.ssoWeb.tag | default $root.Values.tag | default "latest" }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
@@ -193,18 +198,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $name }}-postgres
|
app.kubernetes.io/component: {{ $name }}-postgres
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-sso.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
{{ include "mixingx-sso.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
||||||
# postgres 以专用用户直跑,绕过镜像内 gosu(新内核下 gosu 用户态死循环,
|
{{- with $.Values.imagePullSecrets }}
|
||||||
# 见 ADR/工单:kernel 7.0.0-39+ × gosu 兼容 bug;三件套缺一不可)
|
imagePullSecrets:
|
||||||
securityContext:
|
{{- toYaml . | nindent 8 }}
|
||||||
runAsUser: 999
|
{{- end }}
|
||||||
runAsGroup: 999
|
|
||||||
fsGroup: 999
|
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
command: ["docker-entrypoint.sh", "postgres"]
|
image: {{ $root.Values.sharedInfra.postgres.image | default "docker.io/library/postgres:17" }}
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
image: {{ include "mixingx-sso.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.postgres) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
global:
|
registry: 192.168.1.105:8888/mixingx
|
||||||
imageRegistry: ""
|
tag: latest
|
||||||
|
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
# 客户环境由 environments/_common 注入 imagePullSecrets(ADR-0066);内网留空=匿名拉取,行为不变
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
className: local-path
|
className: local-path
|
||||||
|
|
||||||
sharedInfra:
|
sharedInfra:
|
||||||
postgres:
|
postgres:
|
||||||
|
image: docker.io/library/postgres:17
|
||||||
username: postgres
|
username: postgres
|
||||||
password: "Admin12345"
|
password: "Admin12345"
|
||||||
port: 5432
|
port: 5432
|
||||||
@@ -42,6 +45,9 @@ audit:
|
|||||||
brokerUrl: "mqtt://audit-nanomq-service:1883"
|
brokerUrl: "mqtt://audit-nanomq-service:1883"
|
||||||
|
|
||||||
images:
|
images:
|
||||||
sso: { repository: sso, tag: "" }
|
sso:
|
||||||
ssoWeb: { repository: sso-web, tag: "" }
|
repository: sso
|
||||||
postgres: { repository: postgres, tag: "17" }
|
tag: ""
|
||||||
|
ssoWeb:
|
||||||
|
repository: sso-web
|
||||||
|
tag: ""
|
||||||
@@ -2,5 +2,5 @@ apiVersion: v2
|
|||||||
name: mixingx-ultra
|
name: mixingx-ultra
|
||||||
description: "MixingX Ultra dashboard standalone release: ultra backend, ultra web, and ultra PostgreSQL."
|
description: "MixingX Ultra dashboard standalone release: ultra backend, ultra web, and ultra PostgreSQL."
|
||||||
type: application
|
type: application
|
||||||
version: 0.1.0
|
version: 1.0.44
|
||||||
appVersion: "1.0.1"
|
appVersion: "1.0.44"
|
||||||
@@ -2,13 +2,6 @@
|
|||||||
{{- .Values.storage.className | default "local-path" -}}
|
{{- .Values.storage.className | default "local-path" -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
{{- define "mixingx-ultra.image" -}}
|
|
||||||
{{- $registry := required "global.imageRegistry is required" .registry -}}
|
|
||||||
{{- $repository := required "image.repository is required" .image.repository -}}
|
|
||||||
{{- $tag := required "image.tag is required" .image.tag -}}
|
|
||||||
{{- printf "%s/%s:%s" (trimSuffix "/" $registry) (trimPrefix "/" $repository) ($tag | toString) -}}
|
|
||||||
{{- end -}}
|
|
||||||
|
|
||||||
{{- define "mixingx-ultra.configData" -}}
|
{{- define "mixingx-ultra.configData" -}}
|
||||||
{{- $root := . -}}
|
{{- $root := . -}}
|
||||||
{{- $cfg := $root.Values.ultra -}}
|
{{- $cfg := $root.Values.ultra -}}
|
||||||
|
|||||||
@@ -33,13 +33,14 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $name }}
|
app.kubernetes.io/component: {{ $name }}
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-ultra.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
{{ include "mixingx-ultra.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ $name }}
|
- name: {{ $name }}
|
||||||
image: {{ include "mixingx-ultra.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.ultra) | quote }}
|
image: {{ $root.Values.registry }}/{{ $root.Values.images.ultra.repository | default "ultra" }}:{{ $root.Values.images.ultra.tag | default $root.Values.tag | default "latest" }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
|
||||||
appArmorProfile:
|
|
||||||
type: Unconfined
|
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: {{ $port }}
|
containerPort: {{ $port }}
|
||||||
@@ -132,9 +133,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $name }}-web
|
app.kubernetes.io/component: {{ $name }}-web
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-ultra.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
{{ include "mixingx-ultra.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
||||||
|
{{- with $.Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
- name: {{ $name }}-web
|
- name: {{ $name }}-web
|
||||||
image: {{ include "mixingx-ultra.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.ultraWeb) | quote }}
|
image: {{ $root.Values.registry }}/{{ $root.Values.images.ultraWeb.repository | default "ultra-web" }}:{{ $root.Values.images.ultraWeb.tag | default $root.Values.tag | default "latest" }}
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
@@ -196,18 +201,13 @@ spec:
|
|||||||
app.kubernetes.io/component: {{ $name }}-postgres
|
app.kubernetes.io/component: {{ $name }}-postgres
|
||||||
spec:
|
spec:
|
||||||
{{ include "mixingx-ultra.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
{{ include "mixingx-ultra.tierAffinity" (dict "role" $role "root" $root) | nindent 6 }}
|
||||||
# postgres 以专用用户直跑,绕过镜像内 gosu(新内核下 gosu 用户态死循环,
|
{{- with $.Values.imagePullSecrets }}
|
||||||
# 见 ADR/工单:kernel 7.0.0-39+ × gosu 兼容 bug;三件套缺一不可)
|
imagePullSecrets:
|
||||||
securityContext:
|
{{- toYaml . | nindent 8 }}
|
||||||
runAsUser: 999
|
{{- end }}
|
||||||
runAsGroup: 999
|
|
||||||
fsGroup: 999
|
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
command: ["docker-entrypoint.sh", "postgres"]
|
image: {{ $root.Values.sharedInfra.postgres.image | default "docker.io/library/postgres:17" }}
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
image: {{ include "mixingx-ultra.image" (dict "registry" $root.Values.global.imageRegistry "image" $root.Values.images.postgres) | quote }}
|
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
|
|||||||
@@ -1,13 +1,16 @@
|
|||||||
global:
|
registry: 192.168.1.105:8888/mixingx
|
||||||
imageRegistry: ""
|
tag: latest
|
||||||
|
|
||||||
timezone: Asia/Shanghai
|
timezone: Asia/Shanghai
|
||||||
|
# 客户环境由 environments/_common 注入 imagePullSecrets(ADR-0066);内网留空=匿名拉取,行为不变
|
||||||
|
imagePullSecrets: []
|
||||||
|
|
||||||
|
|
||||||
storage:
|
storage:
|
||||||
className: local-path
|
className: local-path
|
||||||
|
|
||||||
sharedInfra:
|
sharedInfra:
|
||||||
postgres:
|
postgres:
|
||||||
|
image: docker.io/library/postgres:17
|
||||||
username: postgres
|
username: postgres
|
||||||
password: "Admin12345"
|
password: "Admin12345"
|
||||||
port: 5432
|
port: 5432
|
||||||
@@ -25,9 +28,12 @@ sharedInfra:
|
|||||||
protocol: grpc
|
protocol: grpc
|
||||||
|
|
||||||
images:
|
images:
|
||||||
ultra: { repository: ultra, tag: "" }
|
ultra:
|
||||||
ultraWeb: { repository: ultra-web, tag: "" }
|
repository: ultra
|
||||||
postgres: { repository: postgres, tag: "17" }
|
tag: ""
|
||||||
|
ultraWeb:
|
||||||
|
repository: ultra-web
|
||||||
|
tag: ""
|
||||||
|
|
||||||
ultra:
|
ultra:
|
||||||
name: ultra
|
name: ultra
|
||||||
|
|||||||
@@ -1,112 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# ============================================================================
|
|
||||||
# provision-host.sh — MixingX network-agent 主机初始化 (Ubuntu Server 20.04+)
|
|
||||||
#
|
|
||||||
# 职责(幂等,可重复执行):
|
|
||||||
# 1. 安装并启动 NetworkManager(服务器版默认未装)
|
|
||||||
# 2. 读取主网口当前网络参数,预创建等值静态 NM 连接(切换前后地址不变,不断网)
|
|
||||||
# 3. 创建低优先级 DHCP 救援连接(静态配错时的主机侧兜底)
|
|
||||||
# 4. 禁用 cloud-init 网络管理,netplan renderer 切换为 NetworkManager
|
|
||||||
# 5. rfkill 解锁无线网卡
|
|
||||||
# 6. 安装 polkit 放行规则(容器内 root 调用 NM/systemd D-Bus)
|
|
||||||
#
|
|
||||||
# 用法: sudo bash provision-host.sh
|
|
||||||
# 回滚: sudo bash rollback-host.sh
|
|
||||||
# 备份: /var/backups/mixingx-netconsole/
|
|
||||||
# ============================================================================
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
BACKUP_DIR=/var/backups/mixingx-netconsole
|
|
||||||
|
|
||||||
log() { echo -e "\033[32m[mixingx]\033[0m $*"; }
|
|
||||||
die() { echo -e "\033[31m[mixingx] 错误: $*\033[0m" >&2; exit 1; }
|
|
||||||
|
|
||||||
[[ $EUID -eq 0 ]] || die "请用 root 运行: sudo bash $0"
|
|
||||||
command -v ip >/dev/null 2>&1 || die "缺少 ip 命令"
|
|
||||||
|
|
||||||
mkdir -p "$BACKUP_DIR"
|
|
||||||
|
|
||||||
# ── 1. 安装 NetworkManager ────────────────────────────────────────────────
|
|
||||||
if ! command -v nmcli >/dev/null 2>&1; then
|
|
||||||
log "安装 NetworkManager ..."
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
|
||||||
apt-get update -qq
|
|
||||||
apt-get install -y -qq network-manager
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 关闭 NM 自动建连(未配置网卡自动 DHCP),避免与现有 networkd 抢接口
|
|
||||||
mkdir -p /etc/NetworkManager/conf.d
|
|
||||||
cat > /etc/NetworkManager/conf.d/99-mixingx.conf <<'EOF'
|
|
||||||
[main]
|
|
||||||
no-auto-default=*
|
|
||||||
EOF
|
|
||||||
|
|
||||||
systemctl enable --now NetworkManager >/dev/null 2>&1 || true
|
|
||||||
|
|
||||||
# ── 2. 识别主网口并读取当前参数 ───────────────────────────────────────────
|
|
||||||
PRIMARY_IF=$(ip -4 route show default | awk '{print $5; exit}')
|
|
||||||
[[ -n "${PRIMARY_IF:-}" ]] || die "未找到默认路由网卡(主机当前无网络?)"
|
|
||||||
PRIMARY_TYPE=$(ip link show "$PRIMARY_IF" | grep -o 'link/[a-z]*' | head -1)
|
|
||||||
|
|
||||||
CUR_ADDR=$(ip -4 addr show dev "$PRIMARY_IF" | awk '/inet /{print $2; exit}') # x.x.x.x/前缀
|
|
||||||
CUR_GW=$(ip -4 route show default | awk '{print $3; exit}')
|
|
||||||
CUR_DNS4=$(grep -h '^nameserver' /run/systemd/resolve/resolv.conf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf 2>/dev/null \
|
|
||||||
| awk '{print $2}' | grep -E '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$' | sort -u | tr '\n' ' ')
|
|
||||||
log "主网口 $PRIMARY_IF 当前: 地址=$CUR_ADDR 网关=$CUR_GW DNS4=${CUR_DNS4:-<无>}"
|
|
||||||
|
|
||||||
# ── 3. 救援连接(仅以太网主口;WiFi 主口跳过——救援 DHCP 对 WiFi 无意义) ────
|
|
||||||
if [[ "$PRIMARY_TYPE" == "ethernet"* ]]; then
|
|
||||||
if ! nmcli connection show "rescue-dhcp" >/dev/null 2>&1; then
|
|
||||||
log "创建救援 DHCP 连接 rescue-dhcp (autoconnect-priority -100)"
|
|
||||||
nmcli connection add type ethernet ifname "$PRIMARY_IF" con-name "rescue-dhcp" \
|
|
||||||
ipv4.method auto \
|
|
||||||
connection.autoconnect yes \
|
|
||||||
connection.autoconnect-priority -100 >/dev/null
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ── 4. 全局切换 netplan renderer → NetworkManager ────────────────────────
|
|
||||||
# 不删除原 netplan 配置(ethernet/wifi 定义、SSID/PSK 原样保留),
|
|
||||||
# netplan 会把原有连接定义自动渲染为等值的 NM profiles,无缝接管
|
|
||||||
if [[ ! -f /etc/netplan/90-mixingx-nm.yaml ]]; then
|
|
||||||
log "备份原 netplan 配置 → $BACKUP_DIR/netplan/"
|
|
||||||
mkdir -p "$BACKUP_DIR/netplan"
|
|
||||||
cp -a /etc/netplan/*.yaml "$BACKUP_DIR/netplan/" 2>/dev/null || true
|
|
||||||
|
|
||||||
log "禁用 cloud-init 网络管理"
|
|
||||||
mkdir -p /etc/cloud/cloud.cfg.d
|
|
||||||
echo "network: {config: disabled}" > /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
|
|
||||||
|
|
||||||
log "写入全局 renderer=NetworkManager"
|
|
||||||
cat > /etc/netplan/90-mixingx-nm.yaml <<'EOF'
|
|
||||||
network:
|
|
||||||
version: 2
|
|
||||||
renderer: NetworkManager
|
|
||||||
EOF
|
|
||||||
chmod 600 /etc/netplan/90-mixingx-nm.yaml
|
|
||||||
fi
|
|
||||||
|
|
||||||
log "应用 netplan (交给 NetworkManager 托管)..."
|
|
||||||
netplan apply
|
|
||||||
|
|
||||||
# ── 5. 无线解锁 + polkit 放行 ─────────────────────────────────────────────
|
|
||||||
rfkill unblock all 2>/dev/null || true
|
|
||||||
|
|
||||||
if command -v pkexec >/dev/null 2>&1 || dpkg -s policykit-1 >/dev/null 2>&1; then
|
|
||||||
mkdir -p /etc/polkit-1/localauthority/50-local.d
|
|
||||||
cat > /etc/polkit-1/localauthority/50-local.d/49-mixingx-network-agent.pkla <<'EOF'
|
|
||||||
[MixingX Network Agent]
|
|
||||||
Identity=unix-user:root
|
|
||||||
Action=org.freedesktop.NetworkManager.*;org.freedesktop.systemd1.*
|
|
||||||
ResultAny=yes
|
|
||||||
ResultInactive=yes
|
|
||||||
ResultActive=yes
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ── 6. 校验 ───────────────────────────────────────────────────────────────
|
|
||||||
sleep 3
|
|
||||||
log "当前设备状态:"
|
|
||||||
nmcli -g DEVICE,TYPE,STATE,CONNECTION device status
|
|
||||||
log "主网口地址: $(ip -4 addr show dev "$PRIMARY_IF" | awk '/inet /{print $2}')"
|
|
||||||
log "完成。后续用 k3s 弹窗或 nmcli 管理;回滚执行 rollback-host.sh"
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# ============================================================================
|
|
||||||
# rollback-host.sh — provision-host.sh 的反向操作
|
|
||||||
#
|
|
||||||
# 职责:
|
|
||||||
# 1. 恢复原 netplan 配置(从 /var/backups/mixingx-netconsole/netplan/)
|
|
||||||
# 2. 恢复 cloud-init 网络管理
|
|
||||||
# 3. 停用 NetworkManager 托管(服务禁用,连接配置保留)
|
|
||||||
# 4. 移除 polkit 放行规则
|
|
||||||
#
|
|
||||||
# 用法: sudo bash rollback-host.sh
|
|
||||||
# ============================================================================
|
|
||||||
set -euo pipefail
|
|
||||||
|
|
||||||
BACKUP_DIR=/var/backups/mixingx-netconsole
|
|
||||||
|
|
||||||
log() { echo -e "\033[32m[mixingx]\033[0m $*"; }
|
|
||||||
die() { echo -e "\033[31m[mixingx] 错误: $*\033[0m" >&2; exit 1; }
|
|
||||||
|
|
||||||
[[ $EUID -eq 0 ]] || die "请用 root 运行: sudo bash $0"
|
|
||||||
|
|
||||||
# ── 1. 恢复 netplan ───────────────────────────────────────────────────────
|
|
||||||
if [[ -d "$BACKUP_DIR/netplan" ]] && ls "$BACKUP_DIR/netplan"/*.yaml >/dev/null 2>&1; then
|
|
||||||
log "恢复备份的 netplan 配置"
|
|
||||||
rm -f /etc/netplan/90-mixingx-nm.yaml
|
|
||||||
cp -a "$BACKUP_DIR/netplan"/*.yaml /etc/netplan/
|
|
||||||
else
|
|
||||||
log "无备份,仅移除 NM renderer 配置(回退到 renderer 默认)"
|
|
||||||
rm -f /etc/netplan/90-mixingx-nm.yaml
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ── 2. 恢复 cloud-init 网络管理 ───────────────────────────────────────────
|
|
||||||
rm -f /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
|
|
||||||
|
|
||||||
log "应用恢复的 netplan ..."
|
|
||||||
netplan apply
|
|
||||||
|
|
||||||
# ── 3. 停用 NetworkManager ────────────────────────────────────────────────
|
|
||||||
log "停用并禁用 NetworkManager"
|
|
||||||
systemctl disable --now NetworkManager >/dev/null 2>&1 || true
|
|
||||||
|
|
||||||
# ── 4. 移除 polkit 规则 / NM 覆盖配置 ─────────────────────────────────────
|
|
||||||
rm -f /etc/polkit-1/localauthority/50-local.d/49-mixingx-network-agent.pkla
|
|
||||||
rm -f /etc/NetworkManager/conf.d/99-mixingx.conf
|
|
||||||
|
|
||||||
sleep 3
|
|
||||||
ip -4 addr show | awk '/inet /{print " " $2 " @ " $NF}'
|
|
||||||
log "回滚完成。NM 连接配置保留在 /etc/NetworkManager/system-connections/ (可手工清理)"
|
|
||||||
Reference in new issue
Block a user