kubernetes⽇志采集⼯具log-pilot使⽤log-pilot介绍
github地址
log-pilot官⽅介绍
log-pilot镜像地址
log-pilot官⽅搭建
log-pilot解决问题:
每个节点只要⼀个log收集POD
能收集容器⾥⾯的⽇志⽂件,不只是stdout
log-pilot安装
kubernetes1.15以上版本
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: log-pilot
labels:
app: log-pilot
消息钩子namespace: kube-system
spec:
type: RollingUpdate
selector:
matchLabels:
app: log-pilot
template:
metadata:
labels:
app: log-pilot
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ''
scheduler.alpha.kubernetes.io/critical-pod: ''
spec:
吸音海绵
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: log-pilot
# 版本请参考github/AliyunContainerService/log-pilot/releases image: registry-hangzhou.aliyuncs/acs/log-pilot:0.9.7-filebeat
康qresources:
limits:
memory: 500Mi
requests:
cpu: 200m
memory: 200Mi
三维数据采集env:
- name: "NODE_NAME"
valueFrom:
fieldRef:
fieldPath: deName
- name: "LOGGING_OUTPUT"
value: "elasticsearch"
# 请确保集到ES⽹络可达
- name: "ELASTICSEARCH_HOSTS"
value: "10.10.203.152:9200"
#- name: "ELASTICSEARCH_USER"
# value: "{es_username}"
#- name: "ELASTICSEARCH_PASSWORD"
# value: "{es_password}"
volumeMounts:
- name: sock
mountPath: /var/run/docker.sock
- name: root
mountPath: /host
readOnly: true
readOnly: true
- name: varlib
mountPath: /var/lib/filebeat
气压顶杆- name: varlog
mountPath: /var/log/filebeat
- name: localtime
mountPath: /etc/localtime
readOnly: true
livenessProbe:
failureThreshold: 3
exec:
command:
- /pilot/healthz
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
securityContext:
capabilities:
add:
- SYS_ADMIN
terminationGracePeriodSeconds: 30 volumes:
- name: sock
hostPath:
path: /var/run/docker.sock
- name: root
hostPath:
path: /
- name: varlib
hostPath:
path: /var/lib/filebeat
type: DirectoryOrCreate
-
name: varlog
hostPath:
path: /var/log/filebeat
type: DirectoryOrCreate