Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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