apiVersion: v1
kind: ReplicationController
metadata:
name: mysql
namespace: dev
labels:
spec:
replicas: 1
selector:
template:
containers:
- name: mysql
image: mysql:8.0.33
args: ["--character-set-server=utf8mb4", "--collation-server=utf8mb4_unicode_ci", "--max_connections=2000", "--binlog_expire_logs_seconds=432000","--sql_mode =STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"]
ports:
- containerPort: 3306
volumeMounts:
- name: mysql-data-dev
mountPath: /var/lib/mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: "Beaconfire@2099"
- name: MYSQL_DATABASE
value: "devops"
- name: MYSQL_USER
- name: MYSQL_PASSWORD
volumes:
hostPath:
path: /data/dev/mysql
---
kind: Service
- protocol: TCP
port: 3306
targetPort: 3306
nodePort: 30016
type: NodePort