Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
257a8745
Commit
257a8745
authored
Feb 10, 2017
by
Anthony Yeh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fluentd-gcp: Add kube-apiserver-audit.log.
parent
da8f68e0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
6 deletions
+28
-6
fluentd-gcp-ds.yaml
cluster/addons/fluentd-gcp/fluentd-gcp-ds.yaml
+4
-4
Makefile
cluster/addons/fluentd-gcp/fluentd-gcp-image/Makefile
+1
-1
fluent.conf
cluster/addons/fluentd-gcp/fluentd-gcp-image/fluent.conf
+22
-0
fluentd-gcp.yaml
cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.yaml
+1
-1
No files found.
cluster/addons/fluentd-gcp/fluentd-gcp-ds.yaml
View file @
257a8745
...
...
@@ -2,19 +2,19 @@
apiVersion
:
extensions/v1beta1
kind
:
DaemonSet
metadata
:
name
:
fluentd-gcp-v1.3
7
name
:
fluentd-gcp-v1.3
8
namespace
:
kube-system
labels
:
k8s-app
:
fluentd-gcp
kubernetes.io/cluster-service
:
"
true"
version
:
v1.3
7
version
:
v1.3
8
spec
:
template
:
metadata
:
labels
:
k8s-app
:
fluentd-gcp
kubernetes.io/cluster-service
:
"
true"
version
:
v1.3
7
version
:
v1.3
8
# This annotation ensures that fluentd does not get evicted if the node
# supports critical pod annotation based priority scheme.
# Note that this does not guarantee admission on the nodes (#40573).
...
...
@@ -23,7 +23,7 @@ spec:
spec
:
containers
:
-
name
:
fluentd-gcp
image
:
gcr.io/google_containers/fluentd-gcp:1.3
7
image
:
gcr.io/google_containers/fluentd-gcp:1.3
8
# If fluentd consumes its own logs, the following situation may happen:
# fluentd fails to send a chunk to the server => writes it to the log =>
# tries to send this message to the server => fails to send a chunk and so on.
...
...
cluster/addons/fluentd-gcp/fluentd-gcp-image/Makefile
View file @
257a8745
...
...
@@ -26,7 +26,7 @@
.PHONY
:
build push
PREFIX
=
gcr.io/google_containers
TAG
=
1.3
7
TAG
=
1.3
8
build
:
docker build
--pull
-t
$(PREFIX)
/fluentd-gcp:
$(TAG)
.
...
...
cluster/addons/fluentd-gcp/fluentd-gcp-image/fluent.conf
View file @
257a8745
...
...
@@ -175,6 +175,28 @@
</
source
>
# Example:
# 2017-02-09T00:15:57.992775796Z AUDIT: id="90c73c7c-97d6-4b65-9461-f94606ff825f" ip="104.132.1.72" method="GET" user="kubecfg" as="<self>" asgroups="<lookup>" namespace="default" uri="/api/v1/namespaces/default/pods"
# 2017-02-09T00:15:57.993528822Z AUDIT: id="90c73c7c-97d6-4b65-9461-f94606ff825f" response="200"
<
source
>
type
tail
format
multiline
multiline_flush_interval
5
s
format_firstline
/^\
S
+\
s
+
AUDIT
:/
# Fields must be explicitly captured by name to be parsed into the record.
# Fields may not always be present, and order may change, so this just looks
# for a list of key="\"quoted\" value" pairs separated by spaces.
# Unknown fields are ignored.
# Note: We can't separate query/response lines as format1/format2 because
# they don't always come one after the other for a given query.
# TODO: Maybe add a JSON output mode to audit log so we can get rid of this?
format1
/^(?<
time
>\
S
+)
AUDIT
:(?: (?:
id
=
"(?<id>(?:[^"
\\]|\\.)*)
"|ip="
(?<
ip
>(?:[^
"\\]|\\.)*)"
|
method
=
"(?<method>(?:[^"
\\]|\\.)*)
"|user="
(?<
user
>(?:[^
"\\]|\\.)*)"
|
groups
=
"(?<groups>(?:[^"
\\]|\\.)*)
"|as="
(?<
as
>(?:[^
"\\]|\\.)*)"
|
asgroups
=
"(?<asgroups>(?:[^"
\\]|\\.)*)
"|namespace="
(?<
namespace
>(?:[^
"\\]|\\.)*)"
|
uri
=
"(?<uri>(?:[^"
\\]|\\.)*)
"|response="
(?<
response
>(?:[^
"\\]|\\.)*)"
|\
w
+=
"(?:[^"
\\]|\\.)*
"
))*/
time_format
%
FT
%
T
.%
L
%
Z
path
/
var
/
log
/
kube
-
apiserver
-
audit
.
log
pos_file
/
var
/
log
/
gcp
-
kube
-
apiserver
-
audit
.
log
.
pos
tag
kube
-
apiserver
-
audit
</
source
>
# Example:
# I0204 06:55:31.872680 5 servicecontroller.go:277] LB already exists and doesn't need update for service kube-system/kube-ui
<
source
>
type
tail
...
...
cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.yaml
View file @
257a8745
...
...
@@ -15,7 +15,7 @@ spec:
dnsPolicy
:
Default
containers
:
-
name
:
fluentd-cloud-logging
image
:
gcr.io/google_containers/fluentd-gcp:1.3
7
image
:
gcr.io/google_containers/fluentd-gcp:1.3
8
# If fluentd consumes its own logs, the following situation may happen:
# fluentd fails to send a chunk to the server => writes it to the log =>
# tries to send this message to the server => fails to send a chunk and so on.
...
...
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