vn-docker/mrbs/kube-compose.yml

163 lines
3.2 KiB
YAML

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: mrbs
labels:
app: mrbs
spec:
ingressClassName: nginx
rules:
- host: mrbs.verdnatura.es
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: mrbs
port:
number: 80
---
apiVersion: v1
kind: Service
metadata:
name: mrbs
labels:
app: mrbs
spec:
ports:
- port: 80
targetPort: 80
selector:
app: mrbs
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mrbs
labels:
app: mrbs
spec:
replicas: 1
selector:
matchLabels:
app: mrbs
strategy:
type: Recreate
template:
metadata:
labels:
app: mrbs
spec:
containers:
- image: registry.verdnatura.es/mrbs:1.11.2-vn1
name: main
ports:
- containerPort: 80
resources:
limits:
memory: 1Gi
volumeMounts:
- name: secret
mountPath: /var/www/html/web/config.inc.php
subPath: config.inc.php
restartPolicy: Always
imagePullSecrets:
- name: regcred
volumes:
- name: secret
secret:
secretName: mrbs.config
defaultMode: 420
---
apiVersion: v1
kind: Service
metadata:
name: mrbs-db
labels:
app: mrbs-db
spec:
type: NodePort
ports:
- port: 3306
targetPort: 3306
selector:
io.kompose.service: mrbs-db
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mrbs.db
labels:
app: mrbs
spec:
replicas: 1
selector:
matchLabels:
io.kompose.service: mrbs-db
strategy:
type: Recreate
template:
metadata:
labels:
io.kompose.service: mrbs-db
spec:
containers:
- image: mariadb:10.11.4
name: mrbs-db
args:
- --transaction-isolation=READ-COMMITTED
- --binlog-format=ROW
- --ignore-db-dir=lost+found
env:
- name: MYSQL_DATABASE
value: mrbs
- name: MYSQL_USER
value: mrbs
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mrbs.env
key: MYSQL_PASSWORD
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mrbs.env
key: MYSQL_ROOT_PASSWORD
ports:
- containerPort: 3306
resources:
limits:
memory: 500Mi
volumeMounts:
- mountPath: /var/lib/mysql
name: db
- mountPath: /etc/localtime
name: localtime
readOnly: true
restartPolicy: Always
volumes:
- name: db
persistentVolumeClaim:
claimName: mrbs.db
- name: localtime
hostPath:
path: /etc/localtime
type: File
readOnly: true
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mrbs.db
labels:
app: mrdb
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 2Gi
storageClassName: csi-rbd-ssd-sc
volumeMode: Filesystem