k8s-manifests/prd/00-proxysql.yaml

120 lines
2.9 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: proxysql-prd
namespace: prd
labels:
app: proxysql-prd
app.kubernetes.io/name: proxysql
app.kubernetes.io/part-of: mes-prd-database
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
selector:
matchLabels:
app: proxysql-prd
template:
metadata:
labels:
app: proxysql-prd
app.kubernetes.io/name: proxysql
app.kubernetes.io/part-of: mes-prd-database
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app: proxysql-prd
containers:
- name: proxysql
image: 192.168.100.49:30002/prd/proxysql:3.0.9-debian@sha256:7082d349bfe4e9ac7341bd43833ef085bac6b414a7a3d58bdb6f58c5887cccaf
imagePullPolicy: IfNotPresent
command:
- proxysql
args:
- --initial
- -f
- -c
- /etc/proxysql.cnf
ports:
- name: mysql
containerPort: 6033
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: "2"
memory: 1Gi
startupProbe:
tcpSocket:
port: mysql
failureThreshold: 30
periodSeconds: 2
readinessProbe:
tcpSocket:
port: mysql
periodSeconds: 5
timeoutSeconds: 2
livenessProbe:
tcpSocket:
port: mysql
periodSeconds: 10
timeoutSeconds: 2
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- name: config
mountPath: /etc/proxysql.cnf
subPath: proxysql.cnf
readOnly: true
- name: data
mountPath: /var/lib/proxysql
volumes:
- name: config
secret:
secretName: proxysql-prd-config
defaultMode: 0400
- name: data
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: proxysql-prd-canary
namespace: prd
labels:
app.kubernetes.io/name: proxysql
app.kubernetes.io/part-of: mes-prd-database
spec:
selector:
app: proxysql-prd
ports:
- name: mysql
port: 3306
targetPort: mysql
protocol: TCP
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: proxysql-prd
namespace: prd
spec:
minAvailable: 1
selector:
matchLabels:
app: proxysql-prd