Skip to content

Instantly share code, notes, and snippets.

@den-vasyliev
Created September 7, 2018 11:04
Show Gist options
  • Save den-vasyliev/b2d2b7dccda4947f35d57c020f91843b to your computer and use it in GitHub Desktop.
Save den-vasyliev/b2d2b7dccda4947f35d57c020f91843b to your computer and use it in GitHub Desktop.
gl-k8s-demo
---
# Source: fluent-bit/templates/secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: "efk-fluent-bit-es-tls-secret"
labels:
app: efk-fluent-bit
type: Opaque
data:
es-tls-ca.crt: ""
---
# Source: fluent-bit/templates/config.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: efk-fluent-bit-config
labels:
app: efk-fluent-bit
data:
fluent-bit.conf: |-
[SERVICE]
Flush 1
Daemon Off
Log_Level info
Parsers_File parsers.conf
[INPUT]
Name tail
Path /var/log/containers/*.log
Parser docker
Tag kube.*
Refresh_Interval 5
Mem_Buf_Limit 5MB
Skip_Long_Lines On
[FILTER]
Name kubernetes
Match kube.*
Kube_URL https://kubernetes.default.svc:443
Kube_CA_File /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
Kube_Token_File /var/run/secrets/kubernetes.io/serviceaccount/token
[OUTPUT]
Name es
Match *
Host elasticsearch-elasticsearch-cluster.logging.svc.cluster.local
Port 9200
Logstash_Format On
Retry_Limit False
Type flb_type
Logstash_Prefix kubernetes_cluster
parsers.conf: |-
---
# Source: fluent-bit/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: fluent-bit
chart: fluent-bit-0.6.0
heritage: Tiller
release: efk
name: efk-fluent-bit
---
# Source: fluent-bit/templates/cluster-role.yaml
apiVersion: "rbac.authorization.k8s.io/v1"
kind: ClusterRole
metadata:
labels:
app: fluent-bit
chart: fluent-bit-0.6.0
heritage: Tiller
release: efk
name: efk-fluent-bit
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
---
# Source: fluent-bit/templates/cluster-rolebinding.yaml
apiVersion: "rbac.authorization.k8s.io/v1"
kind: ClusterRoleBinding
metadata:
labels:
app: fluent-bit
chart: fluent-bit-0.6.0
heritage: Tiller
release: efk
name: efk-fluent-bit
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: efk-fluent-bit
subjects:
- kind: ServiceAccount
name: efk-fluent-bit
namespace: logging
---
# Source: fluent-bit/templates/daemonset.yaml
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: fluent-bit
labels:
app: efk-fluent-bit
spec:
updateStrategy:
type: RollingUpdate
template:
metadata:
labels:
app: efk-fluent-bit
annotations:
checksum/config: 5046cde71f2046bec2afec5f6457889c75dccdd43e66e59e843ad3dc4627b871
spec:
serviceAccountName: efk-fluent-bit
containers:
- name: fluent-bit
image: "fluent/fluent-bit:0.13.0"
imagePullPolicy: "Always"
env:
[]
resources:
limits:
memory: 100Mi
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
- name: config
mountPath: /fluent-bit/etc/fluent-bit.conf
subPath: fluent-bit.conf
terminationGracePeriodSeconds: 10
tolerations:
- key: dedicated
operator: Exists
volumes:
- name: varlog
hostPath:
path: /var/log
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: config
configMap:
name: efk-fluent-bit-config
---
# Source: fluent-bit/templates/service.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment