Add shared MySQL platform service
This commit is contained in:
parent
00d10f50e9
commit
0f2c3ab52e
7 changed files with 195 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: platform-mysql
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: platform
|
||||||
|
source:
|
||||||
|
repoURL: http://forgejo.forgejo.svc.cluster.local:3000/symcrest/k8s-platform.git
|
||||||
|
targetRevision: main
|
||||||
|
path: rendered/platform-mysql
|
||||||
|
destination:
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
namespace: platform-services
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
prune: false
|
||||||
|
selfHeal: true
|
||||||
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
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
apiVersion: cilium.io/v2
|
||||||
|
kind: CiliumNetworkPolicy
|
||||||
|
metadata:
|
||||||
|
name: platform-mysql-ingress
|
||||||
|
namespace: platform-services
|
||||||
|
spec:
|
||||||
|
endpointSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: platform-mysql
|
||||||
|
ingress:
|
||||||
|
- fromEndpoints:
|
||||||
|
- matchLabels:
|
||||||
|
k8s:io.kubernetes.pod.namespace: leantime-poc
|
||||||
|
toPorts:
|
||||||
|
- ports:
|
||||||
|
- port: "3306"
|
||||||
|
protocol: TCP
|
||||||
70
rendered/platform-mysql/platform-mysql.yaml
Normal file
70
rendered/platform-mysql/platform-mysql.yaml
Normal file
|
|
@ -0,0 +1,70 @@
|
||||||
|
---
|
||||||
|
# Source: platform-mysql/templates/service.yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: platform-mysql
|
||||||
|
namespace: platform-services
|
||||||
|
spec:
|
||||||
|
clusterIP: None
|
||||||
|
selector:
|
||||||
|
app: platform-mysql
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
port: 3306
|
||||||
|
targetPort: mysql
|
||||||
|
---
|
||||||
|
# Source: platform-mysql/templates/statefulset.yaml
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: platform-mysql
|
||||||
|
namespace: platform-services
|
||||||
|
spec:
|
||||||
|
serviceName: platform-mysql
|
||||||
|
replicas: 1
|
||||||
|
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: platform-mysql
|
||||||
|
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: platform-mysql
|
||||||
|
|
||||||
|
spec:
|
||||||
|
nodeSelector:
|
||||||
|
workload: app
|
||||||
|
|
||||||
|
containers:
|
||||||
|
- name: mysql
|
||||||
|
image: "mysql:8.4"
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
|
||||||
|
ports:
|
||||||
|
- name: mysql
|
||||||
|
containerPort: 3306
|
||||||
|
protocol: TCP
|
||||||
|
|
||||||
|
env:
|
||||||
|
- name: MYSQL_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: platform-mysql-secret
|
||||||
|
key: password
|
||||||
|
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /var/lib/mysql
|
||||||
|
|
||||||
|
volumeClaimTemplates:
|
||||||
|
- metadata:
|
||||||
|
name: data
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
storageClassName: longhorn
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 20Gi
|
||||||
Loading…
Add table
Add a link
Reference in a new issue