Skip to content

Instantly share code, notes, and snippets.

@aaadipop
Last active May 15, 2023 10:15
Show Gist options
  • Save aaadipop/b2087ee10668cbb11e32a87b4c776591 to your computer and use it in GitHub Desktop.
Save aaadipop/b2087ee10668cbb11e32a87b4c776591 to your computer and use it in GitHub Desktop.
---
eck-elasticsearch:
enabled: true
fullnameOverride: elasticsearch
annotations:
eck.k8s.elastic.co/license: basic
nodeSets:
- name: default
count: 3
# Comment out when setting the vm.max_map_count via initContainer, as these are mutually exclusive.
# For production workloads, it is strongly recommended to increase the kernel setting vm.max_map_count to 262144
# and leave node.store.allow_mmap unset.
# ref: https://www.elastic.co/guide/en/cloud-on-k8s/master/k8s-virtual-memory.html
#
config:
# vm.max_map_count: 262144 // default for selected ami: vm.max_map_count=524288
# node.store.allow_mmap: false
volumeClaimTemplates:
- metadata:
name: elasticsearch-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
# Adjust to your storage class name
# storageClassName: local-storage
# volumeClaimDeletePolicy: DeleteOnScaledownOnly
eck-kibana:
enabled: true
fullnameOverride: kibana
annotations:
eck.k8s.elastic.co/license: basic
spec:
elasticsearchRef:
name: elasticsearch
http:
tls:
selfSignedCertificate:
disabled: true
service:
spec:
type: NodePort
config:
server.publicBaseUrl: https://kibana.domain.com
xpack.fleet.agents.elasticsearch.hosts: ["https://elasticsearch-es-http.elastic-stack.svc:9200"]
xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server-agent-http.elastic-stack.svc:8220"]
xpack.fleet.packages:
- name: system
version: latest
- name: elastic_agent
version: latest
- name: fleet_server
version: latest
- name: kubernetes
version: latest
xpack.fleet.agentPolicies:
- name: Fleet Server on ECK policy
id: eck-fleet-server
# namespace: default
monitoring_enabled:
- logs
- metrics
is_default_fleet_server: true
package_policies:
- name: fleet_server-1
id: fleet_server-1
package:
name: fleet_server
- name: Elastic Agent on ECK policy
id: eck-agent
# namespace: default
monitoring_enabled:
- logs
- metrics
unenroll_timeout: 900
is_default: true
package_policies:
- package:
name: system
name: system-1
- package:
name: kubernetes
name: kubernetes-1
- package:
name: apm
name: apm-1
inputs:
- type: apm
enabled: true
vars:
- name: host
value: 0.0.0.0:8200
eck-agent:
enabled: true
annotations:
eck.k8s.elastic.co/license: basic
spec:
kibanaRef:
name: kibana
# elasticsearchRefs must be empty when fleet mode is enabled.
elasticsearchRefs: []
fleetServerRef:
name: fleet-server
mode: fleet
daemonSet:
podTemplate:
spec:
serviceAccountName: elastic-agent
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
automountServiceAccountToken: true
securityContext:
runAsUser: 0
eck-fleet-server:
enabled: true
fullnameOverride: fleet-server
annotations:
eck.k8s.elastic.co/license: basic
spec:
kibanaRef:
name: kibana
elasticsearchRefs:
- name: elasticsearch
# eck-beats:
# enabled: true
# name: filebeat
# annotations:
# eck.k8s.elastic.co/license: basic
# version: 8.7.0
# spec:
# type: filebeat
# elasticsearchRef:
# name: elasticsearch
# kibanaRef:
# name: kibana
# config:
# filebeat:
# inputs:
# - type: container
# paths:
# - /var/log/containers/*.log
# autodiscover:
# providers:
# - type: kubernetes
# node: $${NODE_NAME}
# hints:
# enabled: true
# default_config:
# type: container
# paths:
# - /var/log/containers/*$${data.kubernetes.container.id}.log
# processors:
# - add_host_metadata: {}
# - add_cloud_metadata: {}
# - add_kubernetes_metadata: {}
# daemonSet:
# podTemplate:
# spec:
# serviceAccountName: filebeat
# automountServiceAccountToken: true
# terminationGracePeriodSeconds: 30
# dnsPolicy: ClusterFirstWithHostNet
# hostNetwork: true # Allows to provide richer host metadata
# containers:
# - name: filebeat
# securityContext:
# runAsUser: 0
# volumeMounts:
# - name: varlogcontainers
# mountPath: /var/log/containers
# - name: varlogpods
# mountPath: /var/log/pods
# - name: varlibdockercontainers
# mountPath: /var/lib/docker/containers
# volumes:
# - name: varlogcontainers
# hostPath:
# path: /var/log/containers
# - name: varlogpods
# hostPath:
# path: /var/log/pods
# - name: varlibdockercontainers
# hostPath:
# path: /var/lib/docker/containers
#
# clusterRole:
# name: filebeat
# rules:
# - apiGroups: [""] # "" indicates the core API group
# resources:
# - namespaces
# - pods
# - nodes
# verbs:
# - get
# - watch
# - list
#
# serviceAccount:
# name: filebeat
#
# clusterRoleBinding:
# name: metricbeat
# subjects:
# - kind: ServiceAccount
# name: filebeat
# roleRef:
# kind: ClusterRole
# name: filebeat
# apiGroup: rbac.authorization.k8s.io
# name: metricbeat
# annotations:
# eck.k8s.elastic.co/license: basic
#
# spec:
# type: metricbeat
# version: 8.7.0
# elasticsearchRef:
# name: elasticsearch
# kibanaRef:
# name: kibana
# config:
# # Since filebeat is used in the default values, this needs to be removed with an empty list.
# filebeat.inputs: []
# metricbeat:
# autodiscover:
# providers:
# - hints:
# default_config: {}
# enabled: "true"
# node: $${NODE_NAME}
# type: kubernetes
# modules:
# - module: system
# period: 10s
# metricsets:
# - cpu
# - load
# - memory
# - network
# - process
# - process_summary
# process:
# include_top_n:
# by_cpu: 5
# by_memory: 5
# processes:
# - .*
# - module: system
# period: 1m
# metricsets:
# - filesystem
# - fsstat
# processors:
# - drop_event:
# when:
# regexp:
# system:
# filesystem:
# mount_point: ^/(sys|cgroup|proc|dev|etc|host|lib)($|/)
# - module: kubernetes
# period: 10s
# node: $${NODE_NAME}
# hosts:
# - https://$${NODE_NAME}:10250
# bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
# ssl:
# verification_mode: none
# metricsets:
# - node
# - system
# - pod
# - container
# - volume
# processors:
# - add_cloud_metadata: {}
# - add_host_metadata: {}
# daemonSet:
# podTemplate:
# spec:
# serviceAccountName: metricbeat
# automountServiceAccountToken: true # some older Beat versions are depending on this settings presence in k8s context
# containers:
# - args:
# - -e
# - -c
# - /etc/beat.yml
# - -system.hostfs=/hostfs
# name: metricbeat
# volumeMounts:
# - mountPath: /hostfs/sys/fs/cgroup
# name: cgroup
# - mountPath: /var/run/docker.sock
# name: dockersock
# - mountPath: /hostfs/proc
# name: proc
# env:
# - name: NODE_NAME
# valueFrom:
# fieldRef:
# fieldPath: spec.nodeName
# dnsPolicy: ClusterFirstWithHostNet
# hostNetwork: true # Allows to provide richer host metadata
# securityContext:
# runAsUser: 0
# terminationGracePeriodSeconds: 30
# volumes:
# - hostPath:
# path: /sys/fs/cgroup
# name: cgroup
# - hostPath:
# path: /var/run/docker.sock
# name: dockersock
# - hostPath:
# path: /proc
# name: proc
#
# clusterRole:
# # permissions needed for metricbeat
# # source: https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-kubernetes.html
# name: metricbeat
# rules:
# - apiGroups:
# - ""
# resources:
# - nodes
# - namespaces
# - events
# - pods
# verbs:
# - get
# - list
# - watch
# - apiGroups:
# - "extensions"
# resources:
# - replicasets
# verbs:
# - get
# - list
# - watch
# - apiGroups:
# - apps
# resources:
# - statefulsets
# - deployments
# - replicasets
# verbs:
# - get
# - list
# - watch
# - apiGroups:
# - ""
# resources:
# - nodes/stats
# verbs:
# - get
# - nonResourceURLs:
# - /metrics
# verbs:
# - get
#
# serviceAccount:
# name: metricbeat
#
# clusterRoleBinding:
# name: metricbeat
# subjects:
# - kind: ServiceAccount
# name: metricbeat
# roleRef:
# kind: ClusterRole
# name: metricbeat
# apiGroup: rbac.authorization.k8s.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment