mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-07 20:45:15 +00:00
feat: Add ELK stack deployment with Elasticsearch cluster, Kibana UI, and Logstash pipeline for telecom platform logging
- Add elasticsearch namespace with logging component labels and telecom-platform integration - Add Elasticsearch StatefulSet with 3 master node replicas, cluster name telecom-platform-logs - Add initContainers for vm.max_map_count and file descriptor limit configuration with privileged security context - Add Elasticsearch 8.10.0 container with 9200 REST and 9300 inter-node ports, 1Gi-2
This commit is contained in:
@@ -0,0 +1,141 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: elasticsearch
|
||||
labels:
|
||||
app.kubernetes.io/name: elasticsearch
|
||||
app.kubernetes.io/component: logging
|
||||
app.kubernetes.io/part-of: telecom-platform
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: elasticsearch-master
|
||||
namespace: elasticsearch
|
||||
labels:
|
||||
app.kubernetes.io/name: elasticsearch
|
||||
app.kubernetes.io/component: master
|
||||
app.kubernetes.io/part-of: telecom-platform
|
||||
spec:
|
||||
serviceName: elasticsearch-master
|
||||
replicas: 3
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: elasticsearch
|
||||
app.kubernetes.io/component: master
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: elasticsearch
|
||||
app.kubernetes.io/component: master
|
||||
app.kubernetes.io/part-of: telecom-platform
|
||||
spec:
|
||||
securityContext:
|
||||
fsGroup: 1000
|
||||
runAsUser: 1000
|
||||
initContainers:
|
||||
- name: increase-vm-max-map
|
||||
image: busybox:1.35.0
|
||||
command: ["sysctl", "-w", "vm.max_map_count=262144"]
|
||||
securityContext:
|
||||
privileged: true
|
||||
- name: increase-fd-limit
|
||||
image: busybox:1.35.0
|
||||
command: ["sh", "-c", "ulimit -n 65536"]
|
||||
securityContext:
|
||||
privileged: true
|
||||
containers:
|
||||
- name: elasticsearch
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:8.10.0
|
||||
ports:
|
||||
- containerPort: 9200
|
||||
name: rest
|
||||
- containerPort: 9300
|
||||
name: inter-node
|
||||
env:
|
||||
- name: cluster.name
|
||||
value: telecom-platform-logs
|
||||
- name: node.name
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: discovery.seed_hosts
|
||||
value: "elasticsearch-master"
|
||||
- name: cluster.initial_master_nodes
|
||||
value: "elasticsearch-master-0,elasticsearch-master-1,elasticsearch-master-2"
|
||||
- name: ES_JAVA_OPTS
|
||||
value: "-Xms1g -Xmx1g"
|
||||
- name: xpack.security.enabled
|
||||
value: "false"
|
||||
- name: xpack.monitoring.collection.enabled
|
||||
value: "true"
|
||||
resources:
|
||||
requests:
|
||||
cpu: 500m
|
||||
memory: 1Gi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 2Gi
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /usr/share/elasticsearch/data
|
||||
- name: config
|
||||
mountPath: /usr/share/elasticsearch/config
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: elasticsearch-config
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
labels:
|
||||
app.kubernetes.io/name: elasticsearch
|
||||
app.kubernetes.io/component: master
|
||||
app.kubernetes.io/part-of: telecom-platform
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
storageClassName: "standard"
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: elasticsearch-master
|
||||
namespace: elasticsearch
|
||||
labels:
|
||||
app.kubernetes.io/name: elasticsearch
|
||||
app.kubernetes.io/component: master
|
||||
app.kubernetes.io/part-of: telecom-platform
|
||||
spec:
|
||||
ports:
|
||||
- port: 9200
|
||||
name: rest
|
||||
- port: 9300
|
||||
name: inter-node
|
||||
selector:
|
||||
app.kubernetes.io/name: elasticsearch
|
||||
app.kubernetes.io/component: master
|
||||
clusterIP: None
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: elasticsearch-config
|
||||
namespace: elasticsearch
|
||||
labels:
|
||||
app.kubernetes.io/name: elasticsearch
|
||||
app.kubernetes.io/component: master
|
||||
app.kubernetes.io/part-of: telecom-platform
|
||||
data:
|
||||
elasticsearch.yml: |
|
||||
cluster.name: telecom-platform-logs
|
||||
node.name: ${HOSTNAME}
|
||||
network.host: 0.0.0.0
|
||||
discovery.seed_hosts: ["elasticsearch-master"]
|
||||
cluster.initial_master_nodes: ["elasticsearch-master-0", "elasticsearch-master-1", "elasticsearch-master-2"]
|
||||
xpack.security.enabled: false
|
||||
xpack.monitoring.collection.enabled: true
|
||||
xpack.monitoring.elasticsearch.collection.enabled: true
|
||||
indices.lifecycle.poll_interval: 1m
|
||||
Reference in New Issue
Block a user