Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tke-eos
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
QA
tke-eos
Commits
23f62661
Commit
23f62661
authored
Aug 05, 2019
by
xuezj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hostpath日志
parent
7268a603
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
149 additions
and
1 deletion
+149
-1
filebeat-file.yaml
yamls/filebeat-file.yaml
+148
-0
ui.node.yaml
yamls/ui.node.yaml
+1
-1
No files found.
yamls/filebeat-file.yaml
0 → 100644
View file @
23f62661
---
apiVersion
:
v1
kind
:
ConfigMap
metadata
:
name
:
filebeat-config
namespace
:
kube-system
labels
:
k8s-app
:
filebeat
data
:
# java日志以日期开头,node日志以[日期开头
filebeat.yml
:
|-
filebeat.inputs:
- type: log
paths:
- /var/log/containers2/*/*/*/*.log
multiline.pattern: '^\[?[0-9]{4}-[0-9]{2}-[0-9]{2}'
multiline.negate: true
multiline.match: after
ignore_older: 5m
close_inactive: 1m
clean_removed: true
processors:
- script:
lang: javascript
id: k8s_metadata
source: >
function process(event) {
event.Tag("js");
var path = event.Get('log.file.path');
path = path.split('/');
event.Put('k8s.namespace', path[4]);
event.Put('k8s.svcname', path[5]);
event.Put('k8s.podname', path[6]);
}
output.kafka:
hosts: ['172.20.1.135:9092', '172.20.1.145:9092', '172.20.1.185:9092']
topic: 'test-docker-tencent-qak8s'
required_acks: 1
compression: gzip
---
apiVersion
:
extensions/v1beta1
kind
:
DaemonSet
metadata
:
name
:
filebeat
namespace
:
kube-system
labels
:
k8s-app
:
filebeat
spec
:
template
:
metadata
:
labels
:
k8s-app
:
filebeat
spec
:
serviceAccountName
:
filebeat
terminationGracePeriodSeconds
:
30
imagePullSecrets
:
-
name
:
qcloudregistrykey
-
name
:
tencenthubkey
containers
:
-
name
:
filebeat
image
:
docker.elastic.co/beats/filebeat:7.2.1
args
:
[
"
-c"
,
"
/etc/filebeat.yml"
,
"
-e"
,
]
env
:
-
name
:
NODE_NAME
valueFrom
:
fieldRef
:
fieldPath
:
spec.nodeName
securityContext
:
runAsUser
:
0
# If using Red Hat OpenShift uncomment this:
#privileged: true
resources
:
limits
:
memory
:
200Mi
requests
:
cpu
:
100m
memory
:
100Mi
volumeMounts
:
-
name
:
config
mountPath
:
/etc/filebeat.yml
readOnly
:
true
subPath
:
filebeat.yml
-
name
:
data
mountPath
:
/usr/share/filebeat/data
-
name
:
varlibdockercontainers
mountPath
:
/var/lib/docker/containers
readOnly
:
true
-
name
:
varlog
mountPath
:
/var/log
readOnly
:
true
volumes
:
-
name
:
config
configMap
:
defaultMode
:
0600
name
:
filebeat-config
-
name
:
varlibdockercontainers
hostPath
:
path
:
/var/lib/docker/containers
-
name
:
varlog
hostPath
:
path
:
/var/log
# data folder stores a registry of read status for all files, so we don't send everything again on a Filebeat pod restart
-
name
:
data
hostPath
:
path
:
/var/lib/filebeat-data
type
:
DirectoryOrCreate
---
apiVersion
:
rbac.authorization.k8s.io/v1beta1
kind
:
ClusterRoleBinding
metadata
:
name
:
filebeat
subjects
:
-
kind
:
ServiceAccount
name
:
filebeat
namespace
:
kube-system
roleRef
:
kind
:
ClusterRole
name
:
filebeat
apiGroup
:
rbac.authorization.k8s.io
---
apiVersion
:
rbac.authorization.k8s.io/v1beta1
kind
:
ClusterRole
metadata
:
name
:
filebeat
labels
:
k8s-app
:
filebeat
rules
:
-
apiGroups
:
[
"
"
]
# "" indicates the core API group
resources
:
-
namespaces
-
pods
verbs
:
-
get
-
watch
-
list
---
apiVersion
:
v1
kind
:
ServiceAccount
metadata
:
name
:
filebeat
namespace
:
kube-system
labels
:
k8s-app
:
filebeat
---
\ No newline at end of file
yamls/ui.node.yaml
View file @
23f62661
...
@@ -73,7 +73,7 @@ spec:
...
@@ -73,7 +73,7 @@ spec:
volumes
:
volumes
:
-
name
:
filelog
-
name
:
filelog
hostPath
:
hostPath
:
path
:
/var/log/containers2
path
:
/var/log/containers2
/{{namespace}}/{{serviceName}}
restartPolicy
:
Always
restartPolicy
:
Always
dnsPolicy
:
ClusterFirst
dnsPolicy
:
ClusterFirst
imagePullSecrets
:
imagePullSecrets
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment