Files
k8s-apps/forum/phpbb.yaml
2025-08-24 13:38:37 +02:00

171 lines
4.2 KiB
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: config
namespace: forum
data:
config.php: |
<?php
// phpBB 3.3.x auto-generated configuration file
// Do not change anything in this file!
$dbms = 'phpbb\\db\\driver\\mysqli';
$dbhost = 'db';
$dbport = '3306';
$dbname = 'phpbb';
$dbuser = 'phpbb';
$dbpasswd = 'phpbbUserDBPW';
$table_prefix = 'phpbb_';
$phpbb_adm_relative_path = 'adm/';
$acm_type = 'phpbb\\cache\\driver\\file';
@define('PHPBB_INSTALLED', true);
@define('PHPBB_ENVIRONMENT', 'production');
// @define('DEBUG_CONTAINER', true);
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: phpbb
# Change "rook-ceph" provisioner prefix to match the operator namespace if needed
provisioner: rook-ceph.cephfs.csi.ceph.com
parameters:
# clusterID is the namespace where the rook cluster is running
# If you change this namespace, also change the namespace below where the secret namespaces are defined
clusterID: rook-ceph
# CephFS filesystem name into which the volume shall be created
fsName: forum
# Ceph pool into which the volume shall be created
# Required for provisionVolume: "true"
pool: forum-replicated
# The secrets contain Ceph admin credentials. These are generated automatically by the operator
# in the same namespace as the cluster.
csi.storage.k8s.io/provisioner-secret-name: rook-csi-cephfs-provisioner
csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph
csi.storage.k8s.io/controller-expand-secret-name: rook-csi-cephfs-provisioner
csi.storage.k8s.io/controller-expand-secret-namespace: rook-ceph
csi.storage.k8s.io/node-stage-secret-name: rook-csi-cephfs-node
csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph
reclaimPolicy: Delete
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: data
namespace: forum
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 16Gi
storageClassName: phpbb
---
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:
securityContext:
# runAsUser: 1000
# runAsGroup: 1000
fsGroup: 1001
containers:
- name: phpbb
image: bitnami/phpbb:3.3.10
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
- containerPort: 8443
env:
- name: ALLOW_EMPTY_PASSWORD
value: "yes"
- name: PHPBB_DISABLE_SESSION_VALIDATION
value: "true"
- name: PHPBB_DATABASE_HOST
value: "db"
- name: PHPBB_DATABASE_PORT_NUMBER
value: "3306"
- name: PHPBB_USERNAME
value: "admin"
- name: PHPBB_PASSWORD
valueFrom:
secretKeyRef:
name: forum-phpbb-user
key: pw
optional: false
- name: PHPBB_DATABASE_USER
valueFrom:
secretKeyRef:
name: forum-db
key: username
optional: false
- name: PHPBB_DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: forum-db
key: user.pw
optional: false
- name: PHPBB_DATABASE_NAME
value: "phpbb"
volumeMounts:
- mountPath: "/bitnami/phpbb"
name: data
- mountPath: /bitnami/phpbb/config.php
name: config
subPath: config.php
volumes:
- name: data
persistentVolumeClaim:
claimName: data
- name: config
configMap:
name: config
defaultMode: 0777
items:
- key: "config.php"
path: "config.php"
---
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: 8080
- name: https
port: 443
protocol: TCP
targetPort: 8443
selector:
app: phpbb
sessionAffinity: None
type: ClusterIP