forked from k-space/kube
Add mysql-clusters namespace
This commit is contained in:
parent
41b7b509f4
commit
2343edbe6b
8
mysql-clusters/README.md
Normal file
8
mysql-clusters/README.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# MySQL clusters
|
||||||
|
|
||||||
|
This is namespace for MySQL clusters managed by operator-bundle
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl create namespace mysql-clusters
|
||||||
|
kubectl apply -n mysql-clusters -f application.yaml
|
||||||
|
```
|
@ -1,9 +1,53 @@
|
|||||||
|
---
|
||||||
|
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
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: phpmyadmin
|
name: phpmyadmin
|
||||||
labels:
|
namespace: mysql-clusters
|
||||||
app: phpmyadmin
|
|
||||||
spec:
|
spec:
|
||||||
# phpMyAdmin session handling is not really compatible with more replicas
|
# phpMyAdmin session handling is not really compatible with more replicas
|
||||||
replicas: 1
|
replicas: 1
|
||||||
@ -18,32 +62,39 @@ spec:
|
|||||||
containers:
|
containers:
|
||||||
- name: phpmyadmin
|
- name: phpmyadmin
|
||||||
image: phpmyadmin/phpmyadmin
|
image: phpmyadmin/phpmyadmin
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /etc/phpmyadmin/config.user.inc.php
|
||||||
|
subPath: config.user.inc.php
|
||||||
ports:
|
ports:
|
||||||
- name: web
|
- name: web
|
||||||
containerPort: 80
|
containerPort: 80
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
env:
|
env:
|
||||||
- name: PMA_ARBITRARY
|
|
||||||
value: "1"
|
|
||||||
- name: PMA_HOSTS
|
- name: PMA_HOSTS
|
||||||
value: mysql-cluster.authelia,mysql-cluster.etherpad,mariadb.authelia,mariadb.nextcloud,172.20.36.1
|
value: mysql-cluster-shared.mysql-clusters,mysql-cluster.authelia,mysql-cluster.etherpad,mariadb.authelia,mariadb.nextcloud,172.20.36.1
|
||||||
- name: PMA_PORTS
|
- name: PMA_PORTS
|
||||||
value: 6446,6446,3306,3306,3306
|
value: 6446,6446,6446,3306,3306,3306
|
||||||
- name: PMA_ABSOLUTE_URI
|
- name: PMA_ABSOLUTE_URI
|
||||||
value: https://phpmyadmin.k-space.ee/
|
value: https://phpmyadmin.k-space.ee/
|
||||||
- name: UPLOAD_LIMIT
|
- name: UPLOAD_LIMIT
|
||||||
value: 10G
|
value: 10G
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: phpmyadmin
|
||||||
---
|
---
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
name: phpmyadmin
|
name: phpmyadmin
|
||||||
|
namespace: mysql-clusters
|
||||||
annotations:
|
annotations:
|
||||||
kubernetes.io/ingress.class: traefik
|
kubernetes.io/ingress.class: traefik
|
||||||
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||||
traefik.ingress.kubernetes.io/router.middlewares: traefik-sso@kubernetescrd
|
|
||||||
traefik.ingress.kubernetes.io/router.tls: "true"
|
traefik.ingress.kubernetes.io/router.tls: "true"
|
||||||
external-dns.alpha.kubernetes.io/target: traefik.k-space.ee
|
external-dns.alpha.kubernetes.io/target: traefik.k-space.ee
|
||||||
|
traefik.ingress.kubernetes.io/router.middlewares: traefik-sso@kubernetescrd
|
||||||
spec:
|
spec:
|
||||||
rules:
|
rules:
|
||||||
- host: phpmyadmin.k-space.ee
|
- host: phpmyadmin.k-space.ee
|
||||||
@ -64,8 +115,7 @@ apiVersion: v1
|
|||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: phpmyadmin
|
name: phpmyadmin
|
||||||
labels:
|
namespace: mysql-clusters
|
||||||
app: phpmyadmin
|
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: phpmyadmin
|
app: phpmyadmin
|
||||||
@ -73,36 +123,3 @@ spec:
|
|||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 80
|
port: 80
|
||||||
targetPort: 80
|
targetPort: 80
|
||||||
---
|
|
||||||
apiVersion: networking.k8s.io/v1
|
|
||||||
kind: NetworkPolicy
|
|
||||||
metadata:
|
|
||||||
name: phpmyadmin
|
|
||||||
spec:
|
|
||||||
podSelector:
|
|
||||||
matchLabels:
|
|
||||||
app: phpmyadmin
|
|
||||||
policyTypes:
|
|
||||||
- Ingress
|
|
||||||
- Egress
|
|
||||||
ingress:
|
|
||||||
- from:
|
|
||||||
- namespaceSelector:
|
|
||||||
matchLabels:
|
|
||||||
kubernetes.io/metadata.name: traefik
|
|
||||||
ports:
|
|
||||||
- protocol: TCP
|
|
||||||
port: 80
|
|
||||||
egress:
|
|
||||||
- # Allow connecting to MySQL instance in any namespace
|
|
||||||
to:
|
|
||||||
- namespaceSelector: {}
|
|
||||||
ports:
|
|
||||||
- port: 6446
|
|
||||||
- # Allow connecting to any MySQL instance outside the cluster
|
|
||||||
to:
|
|
||||||
- ipBlock:
|
|
||||||
cidr: 0.0.0.0/0
|
|
||||||
ports:
|
|
||||||
- protocol: TCP
|
|
||||||
port: 3306
|
|
@ -1,5 +0,0 @@
|
|||||||
# phpMyAdmin
|
|
||||||
|
|
||||||
```
|
|
||||||
kubectl apply -n phpmyadmin -f application.yml
|
|
||||||
```
|
|
@ -1 +0,0 @@
|
|||||||
../shared/networkpolicy-base.yml
|
|
Loading…
Reference in New Issue
Block a user