Skip to content

Instantly share code, notes, and snippets.

@hum6ug hum6ug/cm.yml
Last active Feb 18, 2020

Embed
What would you like to do?
Schulung 2020-02-18
apiVersion: v1
kind: ConfigMap
metadata:
name:
namespace: kube-system
labels:
k8s-app:
data:
filebeat.yml: |-
filebeat.config:
inputs:
# Mounted `filebeat-inputs` configmap:
path: ${path.config}/inputs.d/*.yml
# Reload inputs configs as they change:
reload.enabled: false
modules:
path: ${path.config}/modules.d/*.yml
# Reload module configs as they change:
reload.enabled: false
processors:
- add_cloud_metadata:
output.elasticsearch:
hosts: ['${ELASTICSEARCH_HOST:elasticsearch}:${ELASTICSEARCH_PORT:9200}']
---
apiVersion: v1
kind: ConfigMap
metadata:
name:
namespace: kube-system
labels:
k8s-app:
data:
kubernetes.yml: |-
- type: docker
containers.ids:
- "*"
json:
ignore_decoding_error: true
add_error_key: true
processors:
- add_kubernetes_metadata:
in_cluster: true
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: elasticsearch
labels:
app: elasticsearch
spec:
replicas: 1
template:
metadata:
labels:
app: elasticsearch
spec:
initContainers:
- name: init-sysctl
image: busybox:1.29
command:
- sysctl
- -w
- vm.max_map_count=262144
resources:
requests:
memory: "100Mi"
limits:
memory: "200Mi"
securityContext:
privileged: true
containers:
- name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.1
env:
- name: discovery.type
value: single-node
- name: cluster.name
value: p8-es-cluster
- name: ES_JAVA_OPTS
value: -Xms2G -Xmx2G
resources:
requests:
memory: "2G"
limits:
memory: "4G"
ports:
- containerPort: 9200
name: http
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: es-data
volumes:
- name: es-data
hostPath:
path: /opt/data/elasticsearch
volumeMounts:
- name: config
mountPath: /etc/filebeat.yml
readOnly: true
subPath: filebeat.yml
- name: inputs
mountPath: /usr/share/filebeat/inputs.d
readOnly: true
- name: data
mountPath: /usr/share/filebeat/data
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
volumes:
- name: config
configMap:
defaultMode: 0600
name: filebeat-config
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: inputs
configMap:
defaultMode: 0600
name: filebeat-inputs
- name: data
hostPath:
path: /mnt/ssd/opt/filebeat
apiVersion: apps/v1
kind: DaemonSet
metadata:
name:
namespace: kube-system
labels:
k8s-app:
spec:
template:
metadata:
labels:
k8s-app:
spec:
containers:
- name: filebeat
image: docker.elastic.co/beats/filebeat:7.6.0
args: [
"-c", "/etc/filebeat.yml",
"-e",
]
env:
- name: ELASTICSEARCH_HOST
value:
- name: ELASTICSEARCH_PORT
value:
securityContext:
runAsUser: 0
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.