Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

elasticsearch.yaml 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. {{- if eq .Values.env.DOC_ENGINE "elasticsearch" -}}
  2. apiVersion: v1
  3. kind: PersistentVolumeClaim
  4. metadata:
  5. name: {{ include "ragflow.fullname" . }}-es-data
  6. annotations:
  7. "helm.sh/resource-policy": keep
  8. labels:
  9. {{- include "ragflow.labels" . | nindent 4 }}
  10. app.kubernetes.io/component: elasticsearch
  11. spec:
  12. {{- with .Values.elasticsearch.storage.className }}
  13. storageClassName: {{ . }}
  14. {{- end }}
  15. accessModes:
  16. - ReadWriteOnce
  17. resources:
  18. requests:
  19. storage: {{ .Values.elasticsearch.storage.capacity }}
  20. ---
  21. apiVersion: apps/v1
  22. kind: StatefulSet
  23. metadata:
  24. name: {{ include "ragflow.fullname" . }}-es
  25. labels:
  26. {{- include "ragflow.labels" . | nindent 4 }}
  27. app.kubernetes.io/component: elasticsearch
  28. spec:
  29. replicas: 1
  30. selector:
  31. matchLabels:
  32. {{- include "ragflow.selectorLabels" . | nindent 6 }}
  33. app.kubernetes.io/component: elasticsearch
  34. {{- with .Values.elasticsearch.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: elasticsearch
  43. annotations:
  44. checksum/config-es: {{ include (print $.Template.BasePath "/elasticsearch-config.yaml") . | sha256sum }}
  45. checksum/config-env: {{ include (print $.Template.BasePath "/env.yaml") . | sha256sum }}
  46. spec:
  47. {{- if or .Values.imagePullSecrets .Values.elasticsearch.image.pullSecrets }}
  48. imagePullSecrets:
  49. {{- with .Values.imagePullSecrets }}
  50. {{- toYaml . | nindent 8 }}
  51. {{- end }}
  52. {{- with .Values.elasticsearch.image.pullSecrets }}
  53. {{- toYaml . | nindent 8 }}
  54. {{- end }}
  55. {{- end }}
  56. initContainers:
  57. - name: fix-data-volume-permissions
  58. image: {{ .Values.elasticsearch.initContainers.alpine.repository }}:{{ .Values.elasticsearch.initContainers.alpine.tag }}
  59. {{- with .Values.elasticsearch.initContainers.alpine.pullPolicy }}
  60. imagePullPolicy: {{ . }}
  61. {{- end }}
  62. command:
  63. - sh
  64. - -c
  65. - "chown -R 1000:0 /usr/share/elasticsearch/data"
  66. volumeMounts:
  67. - mountPath: /usr/share/elasticsearch/data
  68. name: es-data
  69. - name: sysctl
  70. image: {{ .Values.elasticsearch.initContainers.busybox.repository }}:{{ .Values.elasticsearch.initContainers.busybox.tag }}
  71. {{- with .Values.elasticsearch.initContainers.busybox.pullPolicy }}
  72. imagePullPolicy: {{ . }}
  73. {{- end }}
  74. securityContext:
  75. privileged: true
  76. runAsUser: 0
  77. command: ["sysctl", "-w", "vm.max_map_count=262144"]
  78. containers:
  79. - name: elasticsearch
  80. image: {{ .Values.elasticsearch.image.repository }}:{{ .Values.elasticsearch.image.tag }}
  81. {{- with .Values.elasticsearch.image.pullPolicy }}
  82. imagePullPolicy: {{ . }}
  83. {{- end }}
  84. envFrom:
  85. - secretRef:
  86. name: {{ include "ragflow.fullname" . }}-env-config
  87. - configMapRef:
  88. name: {{ include "ragflow.fullname" . }}-es-config
  89. ports:
  90. - containerPort: 9200
  91. name: http
  92. - containerPort: 9300
  93. name: transport
  94. volumeMounts:
  95. - mountPath: /usr/share/elasticsearch/data
  96. name: es-data
  97. {{- with .Values.elasticsearch.deployment.resources }}
  98. resources:
  99. {{- . | toYaml | nindent 10 }}
  100. {{- end }}
  101. securityContext:
  102. capabilities:
  103. add:
  104. - "IPC_LOCK"
  105. runAsUser: 1000
  106. # NOTE: fsGroup doesn't seem to
  107. # work so use init container instead
  108. # fsGroup: 1000
  109. allowPrivilegeEscalation: false
  110. volumes:
  111. - name: es-data
  112. persistentVolumeClaim:
  113. claimName: {{ include "ragflow.fullname" . }}-es-data
  114. ---
  115. apiVersion: v1
  116. kind: Service
  117. metadata:
  118. name: {{ include "ragflow.fullname" . }}-es
  119. labels:
  120. {{- include "ragflow.labels" . | nindent 4 }}
  121. app.kubernetes.io/component: elasticsearch
  122. spec:
  123. selector:
  124. {{- include "ragflow.selectorLabels" . | nindent 4 }}
  125. app.kubernetes.io/component: elasticsearch
  126. ports:
  127. - protocol: TCP
  128. port: 9200
  129. targetPort: http
  130. type: {{ .Values.elasticsearch.service.type }}
  131. {{- end -}}