1
0
Fork 0

move mariadb to new base

This commit is contained in:
Massaki Archambault 2020-05-06 18:31:25 -04:00
parent b001c2ba3d
commit e5458602e6
5 changed files with 18 additions and 74 deletions

View File

@ -1,13 +1,16 @@
bases:
- ../mariadb
resources:
- namespace.yaml
- gitea-deployment.yaml
- drone-server-deployment.yaml
- drone-runner-deployment.yaml
- mariadb-deployment.yaml
secretGenerator:
- name: mariadb-credentials-secret
type: Opaque
behavior: replace
literals:
- database=gitea
- username=gitea

View File

@ -0,0 +1,10 @@
resources:
- mariadb-deployment.yaml
secretGenerator:
- name: mariadb-credentials-secret
type: Opaque
literals:
- database=mariadb
- username=mariadb
- password=replaceme

View File

@ -1,12 +1,15 @@
bases:
- ../mariadb
resources:
- namespace.yaml
- nextcloud-deployment.yaml
- nextcloud-cronjob.yaml
- mariadb-deployment.yaml
secretGenerator:
- name: mariadb-credentials-secret
type: Opaque
behavior: replace
literals:
- database=nextcloud
- username=nextcloud

View File

@ -1,72 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mariadb-deployment
spec:
selector:
matchLabels:
app: mariadb
strategy:
type: Recreate
template:
metadata:
labels:
app: mariadb
spec:
containers:
- name: mariadb
image: mariadb:10.5.2
env:
- name: MYSQL_DATABASE
valueFrom:
secretKeyRef:
name: mariadb-credentials-secret
key: database
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: mariadb-credentials-secret
key: username
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: mariadb-credentials-secret
key: password
- name: MYSQL_RANDOM_ROOT_PASSWORD
value: "yes"
ports:
- name: mariadb
containerPort: 3306
volumeMounts:
- name: mariadb-pvc
mountPath: /var/lib/mysql
volumes:
- name: mariadb-pvc
persistentVolumeClaim:
claimName: mariadb-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mariadb-pvc
labels:
app: mariadb
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: v1
kind: Service
metadata:
name: mariadb
labels:
app: mariadb
spec:
selector:
app: mariadb
ports:
- name: mariadb
port: 3306