Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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: StatefulSet
  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. {{- if or .Values.imagePullSecrets .Values.mysql.image.pullSecrets }}
  48. imagePullSecrets:
  49. {{- with .Values.imagePullSecrets }}
  50. {{- toYaml . | nindent 8 }}
  51. {{- end }}
  52. {{- with .Values.mysql.image.pullSecrets }}
  53. {{- toYaml . | nindent 8 }}
  54. {{- end }}
  55. {{- end }}
  56. containers:
  57. - name: mysql
  58. image: {{ .Values.mysql.image.repository }}:{{ .Values.mysql.image.tag }}
  59. {{- with .Values.mysql.image.pullPolicy }}
  60. imagePullPolicy: {{ . }}
  61. {{- end }}
  62. envFrom:
  63. - secretRef:
  64. name: {{ include "ragflow.fullname" . }}-env-config
  65. args:
  66. - --max_connections=1000
  67. - --character-set-server=utf8mb4
  68. - --collation-server=utf8mb4_general_ci
  69. - --default-authentication-plugin=mysql_native_password
  70. - --tls_version=TLSv1.2,TLSv1.3
  71. - --init-file=/data/application/init.sql
  72. - --disable-log-bin
  73. ports:
  74. - containerPort: 3306
  75. name: mysql
  76. {{- with .Values.mysql.deployment.resources }}
  77. resources:
  78. {{- . | toYaml | nindent 10 }}
  79. {{- end }}
  80. volumeMounts:
  81. - mountPath: /var/lib/mysql
  82. name: mysql-data
  83. - mountPath: /data/application/init.sql
  84. subPath: init.sql
  85. readOnly: true
  86. name: init-script-volume
  87. volumes:
  88. - name: mysql-data
  89. persistentVolumeClaim:
  90. claimName: {{ include "ragflow.fullname" . }}-mysql
  91. - name: init-script-volume
  92. configMap:
  93. name: mysql-init-script
  94. ---
  95. apiVersion: v1
  96. kind: Service
  97. metadata:
  98. name: {{ include "ragflow.fullname" . }}-mysql
  99. labels:
  100. {{- include "ragflow.labels" . | nindent 4 }}
  101. app.kubernetes.io/component: mysql
  102. spec:
  103. selector:
  104. {{- include "ragflow.selectorLabels" . | nindent 4 }}
  105. app.kubernetes.io/component: mysql
  106. ports:
  107. - protocol: TCP
  108. port: 3306
  109. targetPort: mysql
  110. type: {{ .Values.mysql.service.type }}