Open GangHun-Jo opened 3 years ago
apiVersion: v1
kind: Service
metadata:
name: mysql-svc-{{ .Release.Name }}
spec:
ports:
- port: 3306
selector:
app: mysql-{{ .Release.Name }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysql-{{ .Release.Name }}
spec:
selector:
matchLabels:
app: mysql-{{ .Release.Name }}
strategy:
type: Recreate
template:
metadata:
labels:
app: mysql-{{ .Release.Name }}
spec:
containers:
- image: mysql:5.6
name: mysql
env:
- name: MYSQL_DATABASE
value: {{ .Values.mysql.db }}
- name: MYSQL_ROOT_PASSWORD
value: {{ .Values.mysql.password }}
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-pv-claim
Client Service, Deployment
NGinx ingress