2023-02-26 09:15:48 +00:00
|
|
|
---
|
2023-07-28 09:21:50 +00:00
|
|
|
apiVersion: codemowers.cloud/v1beta1
|
|
|
|
kind: MysqlDatabaseClass
|
2023-02-26 09:15:48 +00:00
|
|
|
metadata:
|
|
|
|
name: shared
|
2023-07-28 09:21:50 +00:00
|
|
|
annotations:
|
|
|
|
kubernetes.io/description: "Shared MySQL cluster"
|
2023-02-26 09:15:48 +00:00
|
|
|
spec:
|
2023-07-28 09:21:50 +00:00
|
|
|
reclaimPolicy: Retain
|
|
|
|
shared: true
|
2023-02-26 09:15:48 +00:00
|
|
|
replicas: 3
|
|
|
|
routers: 2
|
|
|
|
storageClass: mysql
|
2023-07-28 09:21:50 +00:00
|
|
|
podSpec:
|
|
|
|
containers:
|
|
|
|
- name: mariadb
|
|
|
|
image: mariadb:10.9.7@sha256:198c7a5fea3d7285762042a628fe8f83f0a7ccef559605b4cc9502e65210880b
|
|
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
nodeSelector:
|
|
|
|
dedicated: storage
|
|
|
|
tolerations:
|
|
|
|
- effect: NoSchedule
|
|
|
|
key: dedicated
|
|
|
|
operator: Equal
|
|
|
|
value: storage
|
2023-02-26 09:15:48 +00:00
|
|
|
---
|
2023-07-28 09:21:50 +00:00
|
|
|
apiVersion: codemowers.cloud/v1beta1
|
|
|
|
kind: MysqlDatabaseClass
|
2023-02-26 09:15:48 +00:00
|
|
|
metadata:
|
|
|
|
name: dedicated
|
2023-07-28 09:21:50 +00:00
|
|
|
annotations:
|
|
|
|
kubernetes.io/description: "Dedicated MySQL cluster"
|
2023-02-26 09:15:48 +00:00
|
|
|
spec:
|
2023-07-28 09:21:50 +00:00
|
|
|
reclaimPolicy: Retain
|
2023-02-26 09:15:48 +00:00
|
|
|
replicas: 3
|
|
|
|
routers: 2
|
|
|
|
storageClass: mysql
|
2023-07-28 09:21:50 +00:00
|
|
|
podSpec:
|
|
|
|
containers:
|
|
|
|
- name: mariadb
|
|
|
|
image: mariadb:10.9.7@sha256:198c7a5fea3d7285762042a628fe8f83f0a7ccef559605b4cc9502e65210880b
|
|
|
|
imagePullPolicy: IfNotPresent
|
|
|
|
nodeSelector:
|
|
|
|
dedicated: storage
|
|
|
|
tolerations:
|
|
|
|
- effect: NoSchedule
|
|
|
|
key: dedicated
|
|
|
|
operator: Equal
|
|
|
|
value: storage
|
|
|
|
---
|
|
|
|
apiVersion: codemowers.cloud/v1beta1
|
|
|
|
kind: MysqlDatabaseClass
|
|
|
|
metadata:
|
|
|
|
name: external
|
|
|
|
annotations:
|
|
|
|
kubernetes.io/description: "External MySQL cluster"
|
|
|
|
spec:
|
|
|
|
reclaimPolicy: Retain
|
|
|
|
shared: true
|
2023-02-26 09:15:48 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: phpmyadmin
|
|
|
|
namespace: mysql-clusters
|
|
|
|
data:
|
|
|
|
config.user.inc.php: |
|
|
|
|
<?php
|
|
|
|
for ($i = 1; isset($hosts[$i - 1]); $i++) {
|
|
|
|
$cfg['Servers'][$i]['ssl'] = true;
|
|
|
|
}
|
|
|
|
---
|
2022-08-16 09:40:54 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: phpmyadmin
|
2023-02-26 09:15:48 +00:00
|
|
|
namespace: mysql-clusters
|
2022-08-16 09:40:54 +00:00
|
|
|
spec:
|
|
|
|
# phpMyAdmin session handling is not really compatible with more replicas
|
|
|
|
replicas: 1
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: phpmyadmin
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: phpmyadmin
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: phpmyadmin
|
|
|
|
image: phpmyadmin/phpmyadmin
|
2023-02-26 09:15:48 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: config
|
|
|
|
mountPath: /etc/phpmyadmin/config.user.inc.php
|
|
|
|
subPath: config.user.inc.php
|
2022-08-16 09:40:54 +00:00
|
|
|
ports:
|
|
|
|
- name: web
|
|
|
|
containerPort: 80
|
|
|
|
protocol: TCP
|
|
|
|
env:
|
|
|
|
- name: PMA_HOSTS
|
2023-02-26 09:15:48 +00:00
|
|
|
value: mysql-cluster-shared.mysql-clusters,mysql-cluster.authelia,mysql-cluster.etherpad,mariadb.authelia,mariadb.nextcloud,172.20.36.1
|
2022-09-21 08:38:13 +00:00
|
|
|
- name: PMA_PORTS
|
2023-02-26 09:15:48 +00:00
|
|
|
value: 6446,6446,6446,3306,3306,3306
|
2022-08-16 09:40:54 +00:00
|
|
|
- name: PMA_ABSOLUTE_URI
|
|
|
|
value: https://phpmyadmin.k-space.ee/
|
|
|
|
- name: UPLOAD_LIMIT
|
|
|
|
value: 10G
|
2023-02-26 09:15:48 +00:00
|
|
|
volumes:
|
|
|
|
- name: config
|
|
|
|
configMap:
|
|
|
|
name: phpmyadmin
|
2022-08-16 09:40:54 +00:00
|
|
|
---
|
2023-07-28 09:21:50 +00:00
|
|
|
apiVersion: codemowers.io/v1alpha1
|
|
|
|
kind: OIDCGWMiddlewareClient
|
|
|
|
metadata:
|
|
|
|
name: phpmyadmin
|
|
|
|
spec:
|
|
|
|
displayName: phpMyAdmin
|
|
|
|
uri: 'https://phpmyadmin.k-space.ee'
|
|
|
|
headerMapping:
|
|
|
|
email: Remote-Email
|
|
|
|
groups: Remote-Groups
|
|
|
|
name: Remote-Name
|
|
|
|
user: Remote-Username
|
|
|
|
---
|
2022-08-16 09:40:54 +00:00
|
|
|
apiVersion: networking.k8s.io/v1
|
|
|
|
kind: Ingress
|
|
|
|
metadata:
|
|
|
|
name: phpmyadmin
|
2023-02-26 09:15:48 +00:00
|
|
|
namespace: mysql-clusters
|
2022-08-16 09:40:54 +00:00
|
|
|
annotations:
|
|
|
|
kubernetes.io/ingress.class: traefik
|
|
|
|
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
|
|
|
traefik.ingress.kubernetes.io/router.tls: "true"
|
|
|
|
external-dns.alpha.kubernetes.io/target: traefik.k-space.ee
|
2023-07-28 09:21:50 +00:00
|
|
|
traefik.ingress.kubernetes.io/router.middlewares: mysql-clusters-phpmyadmin@kubernetescrd
|
2022-08-16 09:40:54 +00:00
|
|
|
spec:
|
|
|
|
rules:
|
|
|
|
- host: phpmyadmin.k-space.ee
|
|
|
|
http:
|
|
|
|
paths:
|
|
|
|
- pathType: Prefix
|
|
|
|
path: "/"
|
|
|
|
backend:
|
|
|
|
service:
|
|
|
|
name: phpmyadmin
|
|
|
|
port:
|
|
|
|
number: 80
|
|
|
|
tls:
|
|
|
|
- hosts:
|
2022-10-14 11:26:03 +00:00
|
|
|
- "*.k-space.ee"
|
2022-08-16 09:40:54 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: phpmyadmin
|
2023-02-26 09:15:48 +00:00
|
|
|
namespace: mysql-clusters
|
2022-08-16 09:40:54 +00:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
app: phpmyadmin
|
|
|
|
ports:
|
|
|
|
- protocol: TCP
|
|
|
|
port: 80
|
|
|
|
targetPort: 80
|