1
0
forked from k-space/kube
kube/mysql-clusters/application.yaml

126 lines
2.9 KiB
YAML

---
apiVersion: codemowers.io/v1alpha1
kind: ClusterMysqlDatabaseClass
metadata:
name: external
spec:
targetCluster: external
targetNamespace: mysql-clusters
description: "MySQL instance running on the ZFS box"
---
apiVersion: codemowers.io/v1alpha1
kind: ClusterMysqlDatabaseClass
metadata:
name: shared
spec:
targetCluster: shared
targetNamespace: mysql-clusters
description: "Shared MySQL cluster"
replicas: 3
routers: 2
storageClass: mysql
---
apiVersion: codemowers.io/v1alpha1
kind: ClusterMysqlDatabaseClass
metadata:
name: dedicated
spec:
targetNamespace: mysql-clusters
description: "Dedicated MySQL cluster"
replicas: 3
routers: 2
storageClass: mysql
---
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;
}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: phpmyadmin
namespace: mysql-clusters
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
volumeMounts:
- name: config
mountPath: /etc/phpmyadmin/config.user.inc.php
subPath: config.user.inc.php
ports:
- name: web
containerPort: 80
protocol: TCP
env:
- name: PMA_HOSTS
value: mysql-cluster-shared.mysql-clusters,mysql-cluster.authelia,mysql-cluster.etherpad,mariadb.authelia,mariadb.nextcloud,172.20.36.1
- name: PMA_PORTS
value: 6446,6446,6446,3306,3306,3306
- name: PMA_ABSOLUTE_URI
value: https://phpmyadmin.k-space.ee/
- name: UPLOAD_LIMIT
value: 10G
volumes:
- name: config
configMap:
name: phpmyadmin
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: phpmyadmin
namespace: mysql-clusters
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
traefik.ingress.kubernetes.io/router.middlewares: traefik-sso@kubernetescrd
spec:
rules:
- host: phpmyadmin.k-space.ee
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: phpmyadmin
port:
number: 80
tls:
- hosts:
- "*.k-space.ee"
---
apiVersion: v1
kind: Service
metadata:
name: phpmyadmin
namespace: mysql-clusters
spec:
selector:
app: phpmyadmin
ports:
- protocol: TCP
port: 80
targetPort: 80