elasticsearch-exporter v1.7.0 runs as a sidecar, scrapes localhost:9200, exposes elasticsearch_* metrics on :9114. ServiceMonitor re-enabled. Alert rules updated to use elasticsearch_* metric names. Flags: --es.all --es.indices --es.shards --collector.clustersettings
82 lines
2.3 KiB
YAML
82 lines
2.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: opensearch
|
|
namespace: data
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: opensearch
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: opensearch
|
|
spec:
|
|
securityContext:
|
|
fsGroup: 1000
|
|
initContainers:
|
|
- name: sysctl
|
|
image: busybox
|
|
command: ["sysctl", "-w", "vm.max_map_count=262144"]
|
|
securityContext:
|
|
privileged: true
|
|
containers:
|
|
- name: opensearch
|
|
image: opensearchproject/opensearch:3
|
|
ports:
|
|
- name: http
|
|
containerPort: 9200
|
|
protocol: TCP
|
|
- name: transport
|
|
containerPort: 9300
|
|
protocol: TCP
|
|
env:
|
|
- name: discovery.type
|
|
value: single-node
|
|
- name: OPENSEARCH_JAVA_OPTS
|
|
value: "-Xms1g -Xmx1536m"
|
|
- name: DISABLE_SECURITY_PLUGIN
|
|
value: "true"
|
|
- name: plugins.ml_commons.only_run_on_ml_node
|
|
value: "false"
|
|
- name: plugins.ml_commons.native_memory_threshold
|
|
value: "90"
|
|
- name: plugins.ml_commons.model_access_control_enabled
|
|
value: "false"
|
|
- name: plugins.ml_commons.allow_registering_model_via_url
|
|
value: "true"
|
|
resources:
|
|
limits:
|
|
memory: 2Gi
|
|
requests:
|
|
memory: 1Gi
|
|
cpu: 100m
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /usr/share/opensearch/data
|
|
# Prometheus metrics exporter — scrapes OpenSearch REST APIs and
|
|
# exposes them as elasticsearch_* metrics on :9114/metrics.
|
|
- name: exporter
|
|
image: quay.io/prometheuscommunity/elasticsearch-exporter:v1.7.0
|
|
args:
|
|
- --es.uri=http://localhost:9200
|
|
- --es.all
|
|
- --es.indices
|
|
- --es.shards
|
|
- --collector.clustersettings
|
|
ports:
|
|
- name: metrics
|
|
containerPort: 9114
|
|
protocol: TCP
|
|
resources:
|
|
requests:
|
|
cpu: 5m
|
|
memory: 32Mi
|
|
limits:
|
|
memory: 64Mi
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: opensearch-data
|