選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

elasticsearch.yaml 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {{- if eq .Values.env.DOC_ENGINE "elasticsearch" -}}
  2. apiVersion: v1
  3. kind: PersistentVolumeClaim
  4. metadata:
  5. name: {{ include "ragflow.fullname" . }}-es-data
  6. labels:
  7. {{- include "ragflow.labels" . | nindent 4 }}
  8. app.kubernetes.io/component: elasticsearch
  9. spec:
  10. {{- with .Values.elasticsearch.storage.className }}
  11. storageClassName: {{ . }}
  12. {{- end }}
  13. accessModes:
  14. - ReadWriteOnce
  15. resources:
  16. requests:
  17. storage: {{ .Values.elasticsearch.storage.capacity }}
  18. ---
  19. apiVersion: apps/v1
  20. kind: Deployment
  21. metadata:
  22. name: {{ include "ragflow.fullname" . }}-es
  23. labels:
  24. {{- include "ragflow.labels" . | nindent 4 }}
  25. app.kubernetes.io/component: elasticsearch
  26. spec:
  27. replicas: 1
  28. selector:
  29. matchLabels:
  30. {{- include "ragflow.selectorLabels" . | nindent 6 }}
  31. app.kubernetes.io/component: elasticsearch
  32. {{- with .Values.elasticsearch.deployment.strategy }}
  33. strategy:
  34. {{- . | toYaml | nindent 4 }}
  35. {{- end }}
  36. template:
  37. metadata:
  38. labels:
  39. {{- include "ragflow.labels" . | nindent 8 }}
  40. app.kubernetes.io/component: elasticsearch
  41. annotations:
  42. checksum/config-es: {{ include (print $.Template.BasePath "/elasticsearch-config.yaml") . | sha256sum }}
  43. checksum/config-env: {{ include (print $.Template.BasePath "/env.yaml") . | sha256sum }}
  44. spec:
  45. initContainers:
  46. - name: fix-data-volume-permissions
  47. image: alpine
  48. command:
  49. - sh
  50. - -c
  51. - "chown -R 1000:0 /usr/share/elasticsearch/data"
  52. volumeMounts:
  53. - mountPath: /usr/share/elasticsearch/data
  54. name: es-data
  55. containers:
  56. - name: elasticsearch
  57. image: docker.elastic.co/elasticsearch/elasticsearch:{{ .Values.env.STACK_VERSION }}
  58. envFrom:
  59. - secretRef:
  60. name: {{ include "ragflow.fullname" . }}-env-config
  61. - configMapRef:
  62. name: {{ include "ragflow.fullname" . }}-es-config
  63. ports:
  64. - containerPort: 9200
  65. name: http
  66. - containerPort: 9300
  67. name: transport
  68. volumeMounts:
  69. - mountPath: /usr/share/elasticsearch/data
  70. name: es-data
  71. {{- with .Values.elasticsearch.deployment.resources }}
  72. resources:
  73. {{- . | toYaml | nindent 10 }}
  74. {{- end }}
  75. securityContext:
  76. capabilities:
  77. add:
  78. - "IPC_LOCK"
  79. runAsUser: 1000
  80. # NOTE: fsGroup doesn't seem to
  81. # work so use init container instead
  82. # fsGroup: 1000
  83. allowPrivilegeEscalation: false
  84. volumes:
  85. - name: es-data
  86. persistentVolumeClaim:
  87. claimName: {{ include "ragflow.fullname" . }}-es-data
  88. ---
  89. apiVersion: v1
  90. kind: Service
  91. metadata:
  92. name: {{ include "ragflow.fullname" . }}-es
  93. labels:
  94. {{- include "ragflow.labels" . | nindent 4 }}
  95. app.kubernetes.io/component: elasticsearch
  96. spec:
  97. selector:
  98. {{- include "ragflow.selectorLabels" . | nindent 4 }}
  99. app.kubernetes.io/component: elasticsearch
  100. ports:
  101. - protocol: TCP
  102. port: 9200
  103. targetPort: http
  104. type: {{ .Values.elasticsearch.service.type }}
  105. {{- end -}}