You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.8 KiB

# Deployment description
apiVersion: apps/v1
kind: Deployment
metadata:
name: mariadb-deployment
namespace: infra-environment
labels:
app: mariadb-infra
spec:
strategy:
type: Recreate
replicas: 1
selector:
matchLabels:
app: mariadb-infra
template:
metadata:
labels:
app: mariadb-infra
spec:
containers:
- name: mariadb
image: mariadb:10.7.1
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "4"
ports:
- containerPort: 3306
envFrom:
- configMapRef:
name: mariadb-config
volumeMounts:
- mountPath: /var/lib/mysql
name: mariadb-pv-infra
subPath: mariadb
volumes:
- name: mariadb-pv-infra
persistentVolumeClaim:
claimName: mariadb-pvc-infra
---
# Persistent Volume Claim description
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mariadb-pvc-infra
namespace: infra-environment
labels:
app: mariadb-infra
spec:
storageClassName: longhorn
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
# ConfigMap description
apiVersion: v1
kind: ConfigMap
metadata:
name: mariadb-config
namespace: infra-environment
labels:
app: mariadb-infra
data:
MYSQL_ROOT_PASSWORD: a+p($y=6Q]^)UVVHa-
MYSQL_DATABASE: mariadb
MYSQL_USER: mysqluser
MYSQL_PASSWORD: Vy4U]C?tZFR~\a^gQN
---
# mariadb StatefulSet Service
apiVersion: v1
kind: Service
metadata:
name: mariadb-infra
namespace: infra-environment
spec:
selector:
app: mariadb-infra
type: LoadBalancer
ports:
- port: 3306
targetPort: 3306
---