You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mysql.yaml 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. ---
  2. apiVersion: v1
  3. kind: PersistentVolumeClaim
  4. metadata:
  5. name: {{ include "ragflow.fullname" . }}-mysql
  6. annotations:
  7. "helm.sh/resource-policy": keep
  8. labels:
  9. {{- include "ragflow.labels" . | nindent 4 }}
  10. app.kubernetes.io/component: mysql
  11. spec:
  12. {{- with .Values.mysql.storage.className }}
  13. storageClassName: {{ . }}
  14. {{- end }}
  15. accessModes:
  16. - ReadWriteOnce
  17. resources:
  18. requests:
  19. storage: {{ .Values.mysql.storage.capacity }}
  20. ---
  21. apiVersion: apps/v1
  22. kind: Deployment
  23. metadata:
  24. name: {{ include "ragflow.fullname" . }}-mysql
  25. labels:
  26. {{- include "ragflow.labels" . | nindent 4 }}
  27. app.kubernetes.io/component: mysql
  28. spec:
  29. replicas: 1
  30. selector:
  31. matchLabels:
  32. {{- include "ragflow.selectorLabels" . | nindent 6 }}
  33. app.kubernetes.io/component: mysql
  34. {{- with .Values.mysql.deployment.strategy }}
  35. strategy:
  36. {{- . | toYaml | nindent 4 }}
  37. {{- end }}
  38. template:
  39. metadata:
  40. labels:
  41. {{- include "ragflow.labels" . | nindent 8 }}
  42. app.kubernetes.io/component: mysql
  43. annotations:
  44. checksum/config-mysql: {{ include (print $.Template.BasePath "/mysql-config.yaml") . | sha256sum }}
  45. checksum/config-env: {{ include (print $.Template.BasePath "/env.yaml") . | sha256sum }}
  46. spec:
  47. containers:
  48. - name: mysql
  49. image: {{ .Values.mysql.image.repository }}:{{ .Values.mysql.image.tag }}
  50. envFrom:
  51. - secretRef:
  52. name: {{ include "ragflow.fullname" . }}-env-config
  53. args:
  54. - --max_connections=1000
  55. - --character-set-server=utf8mb4
  56. - --collation-server=utf8mb4_general_ci
  57. - --default-authentication-plugin=mysql_native_password
  58. - --tls_version=TLSv1.2,TLSv1.3
  59. - --init-file=/data/application/init.sql
  60. - --disable-log-bin
  61. ports:
  62. - containerPort: 3306
  63. name: mysql
  64. {{- with .Values.mysql.deployment.resources }}
  65. resources:
  66. {{- . | toYaml | nindent 10 }}
  67. {{- end }}
  68. volumeMounts:
  69. - mountPath: /var/lib/mysql
  70. name: mysql-data
  71. - mountPath: /data/application/init.sql
  72. subPath: init.sql
  73. readOnly: true
  74. name: init-script-volume
  75. volumes:
  76. - name: mysql-data
  77. persistentVolumeClaim:
  78. claimName: {{ include "ragflow.fullname" . }}-mysql
  79. - name: init-script-volume
  80. configMap:
  81. name: mysql-init-script
  82. ---
  83. apiVersion: v1
  84. kind: Service
  85. metadata:
  86. name: {{ include "ragflow.fullname" . }}-mysql
  87. labels:
  88. {{- include "ragflow.labels" . | nindent 4 }}
  89. app.kubernetes.io/component: mysql
  90. spec:
  91. selector:
  92. {{- include "ragflow.selectorLabels" . | nindent 4 }}
  93. app.kubernetes.io/component: mysql
  94. ports:
  95. - protocol: TCP
  96. port: 3306
  97. targetPort: mysql
  98. type: {{ .Values.mysql.service.type }}