На NFS сервере выставляем такие настройки для монтируемой папки в /etc/exports
/nfs/data *(rw,sync,no_subtree_check,no_root_squash)
oc create sa postgres
oc adm policy add-scc-to-user anyuid -z postgres
Пример Deployment.
kind: Deployment
apiVersion: apps/v1
metadata:
name: ejabberd-psql
namespace: test
annotations:
deployment.kubernetes.io/revision: '81'
openshift.io/scc: privileged
spec:
replicas: 1
selector:
matchLabels:
app: ejabberd-psql
template:
metadata:
creationTimestamp: null
labels:
app: ejabberd-psql
spec:
restartPolicy: Always
serviceAccountName: postgres
imagePullSecrets:
- name: yoursecret
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30
securityContext: {}
containers:
- resources: {}
terminationMessagePath: /dev/termination-log
name: ejabberd-psql
env:
- name: POSTGRES_DB
value: your_db
- name: POSTGRES_USER
value: test
- name: POSTGRES_PASSWORD
value: password
- name: PGDATA
value: /var/lib/postgresql/data/
ports:
- containerPort: 5432
protocol: TCP
imagePullPolicy: IfNotPresent
volumeMounts:
- name: ejabberd-psql
mountPath: /var/lib/postgresql/data
terminationMessagePolicy: File
image: 'your-registry/docker-images/postgresql-11:11-alpine'
serviceAccount: postgres
volumes:
- name: ejabberd-psql
persistentVolumeClaim:
claimName: ejabberd-psql-pvc
Комментариев нет:
Отправить комментарий