132 lines
3.1 KiB
YAML
132 lines
3.1 KiB
YAML
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: data
|
|
namespace: forum
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
resources:
|
|
requests:
|
|
storage: 16Gi
|
|
storageClassName: cephfs-hyper
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: phpbb
|
|
namespace: forum
|
|
labels:
|
|
app: phpbb
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: phpbb
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: phpbb
|
|
spec:
|
|
initContainers:
|
|
- name: init-permissions
|
|
image: busybox:1.36
|
|
command:
|
|
- sh
|
|
- -ec
|
|
- |
|
|
mkdir -p /data/files
|
|
mkdir -p /data/store
|
|
mkdir -p /data/avatars-upload
|
|
chmod 0777 /data/files /data/store /data/avatars-upload
|
|
securityContext:
|
|
runAsUser: 0
|
|
runAsGroup: 0
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /data
|
|
containers:
|
|
- name: phpbb
|
|
image: selim13/phpbb
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- name: http
|
|
containerPort: 80
|
|
env:
|
|
- name: PHPBB_INSTALL
|
|
value: "true"
|
|
- name: PHPBB_DB_DRIVER
|
|
value: mysqli
|
|
- name: PHPBB_DB_HOST
|
|
value: db
|
|
- name: PHPBB_DB_PORT
|
|
value: "3306"
|
|
- name: PHPBB_DB_NAME
|
|
value: phpbb
|
|
- name: PHPBB_DB_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: forum-db
|
|
key: username
|
|
- name: PHPBB_DB_PASSWD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: forum-db
|
|
key: user.pw
|
|
- name: PHPBB_DB_TABLE_PREFIX
|
|
value: phpbb_
|
|
- name: PHPBB_DB_WAIT
|
|
value: "true"
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /phpbb/www/files
|
|
subPath: files
|
|
- name: data
|
|
mountPath: /phpbb/www/store
|
|
subPath: store
|
|
- name: data
|
|
mountPath: /phpbb/www/images/avatars/upload
|
|
subPath: avatars-upload
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: http
|
|
initialDelaySeconds: 20
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 6
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: http
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 20
|
|
timeoutSeconds: 5
|
|
failureThreshold: 6
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: data
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: phpbb
|
|
namespace: forum
|
|
labels:
|
|
app: phpbb
|
|
spec:
|
|
internalTrafficPolicy: Cluster
|
|
ipFamilies:
|
|
- IPv6
|
|
- IPv4
|
|
ipFamilyPolicy: PreferDualStack
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
protocol: TCP
|
|
targetPort: http
|
|
selector:
|
|
app: phpbb
|
|
sessionAffinity: None
|
|
type: ClusterIP |