Files
ssw-mvp/scard/code/bin/k8s/10-postgres.yaml
T
admin 3247e9fd15 init: ssw-mvp initial commit
- boot/ (Java/Maven, JNPF 7.0) — 移除旧的 boot/.git,源码直接纳入仓库
- web/ (Vue 3 + Vite + Ant Design Vue, pnpm)
- docs/, scard/, nax/
- refs/INDEX.md + refs/国标/(其余 refs/* 开源子仓库不纳入)
- 已忽略: connector_data/, jweb/, log/, web/{dist,node_modules,.pnpm}, boot/*/target/, .DS_Store, .idea, .vscode
2026-08-05 18:29:12 +08:00

74 lines
1.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Postgres 16-alpine(VM j7node 的 SSWFlow 数据平面)
# 监听 0.0.0.0:5432,供 ns j7 内 admin pod 通过 service 访问
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: j7-postgres
namespace: j7
spec:
serviceName: j7-postgres
replicas: 1
selector:
matchLabels:
app: j7-postgres
template:
metadata:
labels:
app: j7-postgres
spec:
containers:
- name: postgres
image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/postgres:16-alpine
imagePullPolicy: IfNotPresent
ports:
- containerPort: 5432
env:
- name: POSTGRES_USER
value: dacli
- name: POSTGRES_PASSWORD
value: dacli123
- name: POSTGRES_DB
value: j7_node1
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
resources:
requests:
cpu: 200m
memory: 384Mi
limits:
cpu: 1
memory: 1Gi
readinessProbe:
exec:
command: ["pg_isready", "-U", "dacli", "-d", "j7_node1"]
initialDelaySeconds: 10
periodSeconds: 5
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
- name: init-dbs
mountPath: /docker-entrypoint-initdb.d/00-create-dbs.sql
subPath: 00-create-dbs.sql
volumes:
- name: data
persistentVolumeClaim:
claimName: j7-pg-data
- name: init-dbs
configMap:
name: j7-pg-init
items:
- key: 00-create-dbs.sql
path: 00-create-dbs.sql
---
apiVersion: v1
kind: Service
metadata:
name: j7-postgres
namespace: j7
spec:
type: ClusterIP
selector:
app: j7-postgres
ports:
- port: 5432
targetPort: 5432