Merge branch 'develop/v.1.0.1'
This commit is contained in:
commit
e41c1ef463
8 files changed
+114
-4
No files matched your search
@@ -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
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# Agent PostgreSQL runtime role rollout
|
||||
|
||||
The demo Agent uses a dedicated PostgreSQL login. Passwords and the complete
|
||||
connection string are stored only in a Kubernetes Secret and are not committed.
|
||||
|
||||
## Prepare the Secret
|
||||
|
||||
Load the administrator password already used by the Agent PostgreSQL instance
|
||||
and a distinct application password from the approved vault into the operator
|
||||
shell environment, then run:
|
||||
|
||||
```bash
|
||||
AGENT_POSTGRES_ADMIN_PASSWORD='<from-vault>' \
|
||||
AGENT_POSTGRES_APP_PASSWORD='<from-vault>' \
|
||||
./scripts/upsert-agent-postgres-credentials.sh mixingx demo-2 agent_demo_2
|
||||
```
|
||||
|
||||
The script is idempotent. Do not place either value in a values file, command
|
||||
argument, or shell history. It writes short-lived mode-`0700` input files and
|
||||
removes them on exit, so the values are not exposed through `kubectl` process
|
||||
arguments. The generated Secret contains `admin-password`, `app-password`, and
|
||||
a `connection-string` whose username is `agent_demo_2`.
|
||||
|
||||
## Roll out
|
||||
|
||||
1. Sync `mixingx-agent-demo-2` in Argo CD. The PostgreSQL StatefulSet consumes
|
||||
the administrator password; the Agent init container waits for PostgreSQL,
|
||||
provisions the runtime role, transfers existing `public` objects, and applies
|
||||
the database-local timeout.
|
||||
2. When rotating an existing Secret, restart the Agent deployment explicitly:
|
||||
|
||||
```bash
|
||||
kubectl --namespace mixingx rollout restart deployment/agent-demo-2-deployment
|
||||
kubectl --namespace mixingx rollout status deployment/agent-demo-2-deployment --timeout=300s
|
||||
```
|
||||
|
||||
3. Verify the backend container receives only the application connection string.
|
||||
The administrator login remains reserved for provisioning, backup, and manual
|
||||
maintenance. Startup EF Core migrations run as the database-owning application
|
||||
role; `statement_timeout` and `lock_timeout` are explicitly left unset.
|
||||
|
||||
## Verify
|
||||
|
||||
Run the following through a temporary `psql` Pod or an approved database client,
|
||||
using the application credential from the Secret:
|
||||
|
||||
```sql
|
||||
SHOW idle_in_transaction_session_timeout;
|
||||
SHOW statement_timeout;
|
||||
SHOW lock_timeout;
|
||||
SELECT rolname, rolsuper, rolcreatedb, rolcreaterole
|
||||
FROM pg_roles
|
||||
WHERE rolname = current_user;
|
||||
```
|
||||
|
||||
Expected values are `1min`, `0`, `0`, and all three privilege flags `false`.
|
||||
@@ -2,3 +2,5 @@ agents:
|
||||
- id: demo-2
|
||||
description: Demo Agent 2
|
||||
phaseType: DieCasting
|
||||
databaseUsername: agent_demo_2
|
||||
postgresCredentialsSecret: agent-demo-2-postgres-credentials
|
||||
@@ -14,9 +14,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
|
||||
|
||||
@@ -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
|
||||
Reference in new issue
Block a user