我想将用户帐户和其他设置保存在 pgadmin4 k8s 实例的卷中,我这样做了:
apiVersion: apps/v1
kind: Deployment
metadata:
name: pgadmin
namespace: pgadmin
spec:
selector:
matchLabels:
app: pgadmin
replicas: 1
template:
metadata:
labels:
app: pgadmin
spec:
containers:
- name: pgadmin4
image: dpage/pgadmin4
env:
- name: PGADMIN_DEFAULT_EMAIL
value: "admin@example.com"
- name: PGADMIN_DEFAULT_PASSWORD
value: "mysecpwd"
- name: PGADMIN_PORT
value: "80"
ports:
- containerPort: 80
name: pgadminport
volumeMounts:
- mountPath: /
name: pgadmin-storage
volumes:
- name: pgadmin-storage
persistentVolumeClaim:
claimName: pgadmin-pv-claim
---
kind: PersistentVolume
apiVersion: v1
metadata:
name: pgadmin-pv-volume
namespace: pgadmin
labels:
type: local …Run Code Online (Sandbox Code Playgroud)