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

103 lines
2.1 KiB
YAML

---
apiVersion: codemowers.io/v1alpha1
kind: ClusterPostgresDatabaseClass
metadata:
name: dedicated
spec:
targetNamespace: postgres-clusters
description: "Dedicated Postgres cluster"
replicas: 3
routers: 2
storageClass: postgres
podSpec:
nodeSelector:
dedicated: storage
tolerations:
- effect: NoSchedule
key: dedicated
operator: Equal
value: storage
---
apiVersion: codemowers.io/v1alpha1
kind: ClusterPostgresDatabaseClass
metadata:
name: shared
spec:
targetCluster: shared
targetNamespace: postgres-clusters
description: "Shared Postgres cluster"
replicas: 3
routers: 2
storageClass: postgres
podSpec:
nodeSelector:
dedicated: storage
tolerations:
- effect: NoSchedule
key: dedicated
operator: Equal
value: storage
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pgweb
namespace: postgres-clusters
spec:
replicas: 1
selector:
matchLabels: &selector
app: pgweb
template:
metadata:
labels: *selector
spec:
containers:
- name: pgweb
image: sosedoff/pgweb
command:
- /usr/bin/pgweb
- --bind=0.0.0.0
- --sessions
- --no-ssh
---
apiVersion: v1
kind: Service
metadata:
name: pgweb
namespace: postgres-clusters
spec:
selector:
app: pgweb
ports:
- protocol: TCP
port: 8081
targetPort: 8081
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: pgweb
namespace: postgres-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: pgweb.k-space.ee
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: pgweb
port:
number: 8081
tls:
- hosts:
- "*.k-space.ee"