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.

opensearch.yaml 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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: Deployment
  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. httpGet:
  89. path: /
  90. port: 9201
  91. initialDelaySeconds: 30
  92. periodSeconds: 10
  93. timeoutSeconds: 10
  94. failureThreshold: 120
  95. volumes:
  96. - name: opensearch-data
  97. persistentVolumeClaim:
  98. claimName: {{ include "ragflow.fullname" . }}-opensearch-data
  99. ---
  100. apiVersion: v1
  101. kind: Service
  102. metadata:
  103. name: {{ include "ragflow.fullname" . }}-opensearch
  104. labels:
  105. {{- include "ragflow.labels" . | nindent 4 }}
  106. app.kubernetes.io/component: opensearch
  107. spec:
  108. selector:
  109. {{- include "ragflow.selectorLabels" . | nindent 4 }}
  110. app.kubernetes.io/component: opensearch
  111. ports:
  112. - protocol: TCP
  113. port: 9201
  114. targetPort: http
  115. type: {{ .Values.opensearch.service.type }}
  116. {{- end -}}