Add shared MySQL platform service
This commit is contained in:
parent
00d10f50e9
commit
0f2c3ab52e
7 changed files with 195 additions and 0 deletions
6
charts/platform-mysql/Chart.yaml
Normal file
6
charts/platform-mysql/Chart.yaml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
apiVersion: v2
|
||||
name: platform-mysql
|
||||
description: Symcrest shared MySQL database service
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "8.4"
|
||||
13
charts/platform-mysql/templates/service.yaml
Normal file
13
charts/platform-mysql/templates/service.yaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Values.name }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
clusterIP: None
|
||||
selector:
|
||||
app: {{ .Values.name }}
|
||||
ports:
|
||||
- name: mysql
|
||||
port: 3306
|
||||
targetPort: mysql
|
||||
53
charts/platform-mysql/templates/statefulset.yaml
Normal file
53
charts/platform-mysql/templates/statefulset.yaml
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ .Values.name }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
spec:
|
||||
serviceName: {{ .Values.name }}
|
||||
replicas: 1
|
||||
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Values.name }}
|
||||
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Values.name }}
|
||||
|
||||
spec:
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.nodeSelector | indent 8 }}
|
||||
|
||||
containers:
|
||||
- name: mysql
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: IfNotPresent
|
||||
|
||||
ports:
|
||||
- name: mysql
|
||||
containerPort: 3306
|
||||
protocol: TCP
|
||||
|
||||
env:
|
||||
- name: MYSQL_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ .Values.auth.secret }}
|
||||
key: password
|
||||
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/mysql
|
||||
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: {{ .Values.storage.className }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.storage.size }}
|
||||
18
charts/platform-mysql/values.yaml
Normal file
18
charts/platform-mysql/values.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
name: platform-mysql
|
||||
namespace: platform-services
|
||||
|
||||
image:
|
||||
repository: mysql
|
||||
tag: "8.4"
|
||||
|
||||
auth:
|
||||
database: mysql
|
||||
username: root
|
||||
secret: platform-mysql-secret
|
||||
|
||||
storage:
|
||||
className: longhorn
|
||||
size: 20Gi
|
||||
|
||||
nodeSelector:
|
||||
workload: app
|
||||
Loading…
Add table
Add a link
Reference in a new issue