mirror of
https://github.com/wazuh/wazuh-kubernetes.git
synced 2025-12-10 16:46:36 -06:00
105 lines
2.9 KiB
YAML
105 lines
2.9 KiB
YAML
# Copyright (C) 2018 Wazuh Inc.
|
|
#
|
|
# This program is a free software; you can redistribute it
|
|
# and/or modify it under the terms of the GNU General Public
|
|
# License (version 2) as published by the FSF - Free Software
|
|
# Foundation.
|
|
|
|
# Elasticsearch StatefulSet: 3 master nodes.
|
|
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: wazuh-elasticsearch
|
|
namespace: wazuh
|
|
spec:
|
|
replicas: 3
|
|
selector:
|
|
matchLabels:
|
|
app: wazuh-elasticsearch
|
|
serviceName: wazuh-elasticsearch
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: wazuh-elasticsearch
|
|
name: wazuh-elasticsearch
|
|
spec:
|
|
# Set the wazuh-elasticsearch volume permissions so the elasticsearch user can use it!
|
|
initContainers:
|
|
- name: volume-mount-hack
|
|
image: busybox
|
|
resources:
|
|
requests:
|
|
cpu: 50m
|
|
memory: 128Mi
|
|
limits:
|
|
cpu: 100m
|
|
memory: 256Mi
|
|
command:
|
|
- sh
|
|
- '-c'
|
|
- 'chown -R 1000:1000 /usr/share/elasticsearch/data'
|
|
volumeMounts:
|
|
- name: wazuh-elasticsearch
|
|
mountPath: /usr/share/elasticsearch/data
|
|
- name: increase-the-vm-max-map-count
|
|
image: busybox
|
|
command:
|
|
- sysctl
|
|
- -w
|
|
- vm.max_map_count=262144
|
|
securityContext:
|
|
privileged: true
|
|
containers:
|
|
- name: wazuh-elasticsearch
|
|
image: 'wazuh/wazuh-elasticsearch:3.12.3_7.6.2'
|
|
resources:
|
|
requests:
|
|
cpu: 500m
|
|
memory: 1Gi
|
|
limits:
|
|
cpu: 1
|
|
memory: 2Gi
|
|
env:
|
|
- name: ES_JAVA_OPTS
|
|
value: '-Xms512m -Xmx512m'
|
|
- name: node.master
|
|
value: 'true'
|
|
- name: node.data
|
|
value: 'false'
|
|
- name: node.ingest
|
|
value: 'false'
|
|
- name: bootstrap.memory_lock
|
|
value: 'false'
|
|
- name: cluster.name
|
|
value: wazuh
|
|
- name: network.host
|
|
value: 0.0.0.0
|
|
- name: node.name
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.name
|
|
- name: discovery.zen.ping.unicast.hosts
|
|
value: "wazuh-elasticsearch"
|
|
- name: discovery.zen.minimum_master_nodes
|
|
value: "2"
|
|
volumeMounts:
|
|
- name: wazuh-elasticsearch
|
|
mountPath: /usr/share/elasticsearch/data
|
|
ports:
|
|
- containerPort: 9200
|
|
name: es-rest
|
|
- containerPort: 9300
|
|
name: es-nodes
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: wazuh-elasticsearch
|
|
namespace: es-cluster
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: gp2-encrypted-retained
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|