| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- apiVersion: v1
- kind: Namespace
- metadata:
- name: pouchlab
- labels:
- app.kubernetes.io/name: pouchlab
- ---
- apiVersion: apps/v1
- kind: Deployment
- metadata:
- name: pouchlab
- namespace: pouchlab
- labels:
- app: pouchlab
- spec:
- # SQLite 单写者:固定 1 副本(数据卷 hostPath)
- replicas: 1
- revisionHistoryLimit: 3
- selector:
- matchLabels:
- app: pouchlab
- strategy:
- type: RollingUpdate
- rollingUpdate:
- maxSurge: 1
- maxUnavailable: 0
- template:
- metadata:
- labels:
- app: pouchlab
- spec:
- nodeSelector:
- kubernetes.io/hostname: k8s-node1 # 数据 hostPath 固定节点(SQLite 单副本)
- containers:
- - name: pouchlab
- image: k8s.device.wenhq.top:8583/docker_r/pouchlab:1.8.22
- imagePullPolicy: IfNotPresent
- env:
- - name: PL_DB_HOST
- value: pouchlab-mysql.pouchlab.svc.cluster.local
- - name: PL_DB_PORT
- value: "3306"
- - name: PL_DB_USER
- value: pouchlab
- - name: PL_DB_PASSWORD
- value: pouchlab-db-2026
- - name: PL_DB_NAME
- value: pouchlab
- - name: PL_REDIS_URL
- value: redis://pouchlab-redis.pouchlab.svc.cluster.local:6379/0
- ports:
- - name: http
- containerPort: 8080
- resources:
- requests:
- cpu: 100m
- memory: 128Mi
- limits:
- cpu: 500m
- memory: 384Mi
- readinessProbe:
- httpGet:
- path: /healthz
- port: 8080
- initialDelaySeconds: 5
- periodSeconds: 5
- livenessProbe:
- httpGet:
- path: /healthz
- port: 8080
- initialDelaySeconds: 15
- periodSeconds: 20
- volumeMounts:
- - name: data
- mountPath: /app/data
- volumes:
- - name: data
- hostPath:
- path: /data/pouchlab
- type: DirectoryOrCreate
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: pouchlab
- namespace: pouchlab
- labels:
- app: pouchlab
- spec:
- type: NodePort
- selector:
- app: pouchlab
- ports:
- - name: http
- port: 8080
- targetPort: 8080
- nodePort: 30080
|