2016-12-13 15:14:10 +00:00
|
|
|
apiVersion: extensions/v1beta1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
2018-01-12 18:16:13 +00:00
|
|
|
name: fluentd-gcp-v2.0.14
|
2016-12-13 15:14:10 +00:00
|
|
|
namespace: kube-system
|
|
|
|
labels:
|
|
|
|
k8s-app: fluentd-gcp
|
|
|
|
kubernetes.io/cluster-service: "true"
|
2017-02-25 00:53:12 +00:00
|
|
|
addonmanager.kubernetes.io/mode: Reconcile
|
2018-01-12 18:16:13 +00:00
|
|
|
version: v2.0.14
|
2016-12-13 15:14:10 +00:00
|
|
|
spec:
|
2017-03-13 17:51:45 +00:00
|
|
|
updateStrategy:
|
|
|
|
type: RollingUpdate
|
2016-12-13 15:14:10 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
k8s-app: fluentd-gcp
|
|
|
|
kubernetes.io/cluster-service: "true"
|
2018-01-12 18:16:13 +00:00
|
|
|
version: v2.0.14
|
2017-02-14 14:41:15 +00:00
|
|
|
# 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).
|
2017-02-06 19:47:48 +00:00
|
|
|
annotations:
|
|
|
|
scheduler.alpha.kubernetes.io/critical-pod: ''
|
2016-12-13 15:14:10 +00:00
|
|
|
spec:
|
2017-10-18 21:58:32 +00:00
|
|
|
serviceAccountName: fluentd-gcp
|
2017-02-15 19:53:32 +00:00
|
|
|
dnsPolicy: Default
|
2016-12-13 15:14:10 +00:00
|
|
|
containers:
|
|
|
|
- name: fluentd-gcp
|
Switch to k8s.gcr.io vanity domain
This is the 2nd attempt. The previous was reverted while we figured out
the regional mirrors (oops).
New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest. To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today). For now the staging is an alias to
gcr.io/google_containers (the legacy URL).
When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.
We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it. Nice and
visible, easy to keep track of.
2018-01-17 19:36:53 +00:00
|
|
|
image: k8s.gcr.io/fluentd-gcp:2.0.14
|
2017-02-21 12:50:47 +00:00
|
|
|
env:
|
|
|
|
- name: FLUENTD_ARGS
|
2017-06-21 18:14:43 +00:00
|
|
|
value: --no-supervisor -q
|
2016-12-13 15:14:10 +00:00
|
|
|
resources:
|
|
|
|
limits:
|
2017-03-21 09:44:01 +00:00
|
|
|
memory: 300Mi
|
2016-12-13 15:14:10 +00:00
|
|
|
requests:
|
2017-06-26 14:18:24 +00:00
|
|
|
cpu: 100m
|
2016-12-13 15:14:10 +00:00
|
|
|
memory: 200Mi
|
|
|
|
volumeMounts:
|
|
|
|
- name: varlog
|
|
|
|
mountPath: /var/log
|
|
|
|
- name: varlibdockercontainers
|
|
|
|
mountPath: /var/lib/docker/containers
|
|
|
|
readOnly: true
|
2017-02-14 14:41:15 +00:00
|
|
|
- name: libsystemddir
|
|
|
|
mountPath: /host/lib
|
|
|
|
readOnly: true
|
2017-02-26 19:51:07 +00:00
|
|
|
- name: config-volume
|
|
|
|
mountPath: /etc/fluent/config.d
|
2016-12-09 14:10:42 +00:00
|
|
|
# Liveness probe is aimed to help in situarions where fluentd
|
|
|
|
# silently hangs for no apparent reasons until manual restart.
|
|
|
|
# The idea of this probe is that if fluentd is not queueing or
|
|
|
|
# flushing chunks for 5 minutes, something is not right. If
|
|
|
|
# you want to change the fluentd configuration, reducing amount of
|
|
|
|
# logs fluentd collects, consider changing the threshold or turning
|
|
|
|
# liveness probe off completely.
|
|
|
|
livenessProbe:
|
|
|
|
initialDelaySeconds: 600
|
|
|
|
periodSeconds: 60
|
|
|
|
exec:
|
|
|
|
command:
|
|
|
|
- '/bin/sh'
|
|
|
|
- '-c'
|
|
|
|
- >
|
2017-01-13 12:46:38 +00:00
|
|
|
LIVENESS_THRESHOLD_SECONDS=${LIVENESS_THRESHOLD_SECONDS:-300};
|
|
|
|
STUCK_THRESHOLD_SECONDS=${LIVENESS_THRESHOLD_SECONDS:-900};
|
|
|
|
if [ ! -e /var/log/fluentd-buffers ];
|
|
|
|
then
|
|
|
|
exit 1;
|
|
|
|
fi;
|
2016-12-09 14:10:42 +00:00
|
|
|
LAST_MODIFIED_DATE=`stat /var/log/fluentd-buffers | grep Modify | sed -r "s/Modify: (.*)/\1/"`;
|
|
|
|
LAST_MODIFIED_TIMESTAMP=`date -d "$LAST_MODIFIED_DATE" +%s`;
|
2017-01-13 12:46:38 +00:00
|
|
|
if [ `date +%s` -gt `expr $LAST_MODIFIED_TIMESTAMP + $STUCK_THRESHOLD_SECONDS` ];
|
|
|
|
then
|
|
|
|
rm -rf /var/log/fluentd-buffers;
|
|
|
|
exit 1;
|
|
|
|
fi;
|
|
|
|
if [ `date +%s` -gt `expr $LAST_MODIFIED_TIMESTAMP + $LIVENESS_THRESHOLD_SECONDS` ];
|
|
|
|
then
|
|
|
|
exit 1;
|
|
|
|
fi;
|
2017-08-09 15:45:08 +00:00
|
|
|
# BEGIN_PROMETHEUS_TO_SD
|
2017-04-28 11:27:19 +00:00
|
|
|
- name: prometheus-to-sd-exporter
|
Switch to k8s.gcr.io vanity domain
This is the 2nd attempt. The previous was reverted while we figured out
the regional mirrors (oops).
New plan: k8s.gcr.io is a read-only facade that auto-detects your source
region (us, eu, or asia for now) and pulls from the closest. To publish
an image, push k8s-staging.gcr.io and it will be synced to the regionals
automatically (similar to today). For now the staging is an alias to
gcr.io/google_containers (the legacy URL).
When we move off of google-owned projects (working on it), then we just
do a one-time sync, and change the google-internal config, and nobody
outside should notice.
We can, in parallel, change the auto-sync into a manual sync - send a PR
to "promote" something from staging, and a bot activates it. Nice and
visible, easy to keep track of.
2018-01-17 19:36:53 +00:00
|
|
|
image: k8s.gcr.io/prometheus-to-sd:v0.2.2
|
2017-04-28 11:27:19 +00:00
|
|
|
command:
|
|
|
|
- /monitor
|
2017-08-09 15:45:08 +00:00
|
|
|
- --stackdriver-prefix={{ prometheus_to_sd_prefix }}/addons
|
|
|
|
- --api-override={{ prometheus_to_sd_endpoint }}
|
2017-10-26 13:25:26 +00:00
|
|
|
- --source=fluentd:http://localhost:31337?whitelisted=stackdriver_successful_requests_count,stackdriver_failed_requests_count,stackdriver_ingested_entries_count,stackdriver_dropped_entries_count
|
|
|
|
- --pod-id=$(POD_NAME)
|
|
|
|
- --namespace-id=$(POD_NAMESPACE)
|
|
|
|
env:
|
|
|
|
- name: POD_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.name
|
|
|
|
- name: POD_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
fieldPath: metadata.namespace
|
2017-08-09 15:45:08 +00:00
|
|
|
# END_PROMETHEUS_TO_SD
|
2016-12-13 15:18:00 +00:00
|
|
|
nodeSelector:
|
2017-03-21 19:48:13 +00:00
|
|
|
beta.kubernetes.io/fluentd-ds-ready: "true"
|
2017-02-16 20:01:52 +00:00
|
|
|
tolerations:
|
|
|
|
- key: "node.alpha.kubernetes.io/ismaster"
|
|
|
|
effect: "NoSchedule"
|
2017-05-12 09:23:23 +00:00
|
|
|
- operator: "Exists"
|
|
|
|
effect: "NoExecute"
|
2017-06-28 08:35:58 +00:00
|
|
|
- operator: "Exists"
|
|
|
|
effect: "NoSchedule"
|
2016-12-13 15:14:10 +00:00
|
|
|
terminationGracePeriodSeconds: 30
|
|
|
|
volumes:
|
|
|
|
- name: varlog
|
|
|
|
hostPath:
|
|
|
|
path: /var/log
|
|
|
|
- name: varlibdockercontainers
|
|
|
|
hostPath:
|
|
|
|
path: /var/lib/docker/containers
|
2017-02-14 14:41:15 +00:00
|
|
|
- name: libsystemddir
|
|
|
|
hostPath:
|
|
|
|
path: /usr/lib64
|
2017-02-26 19:51:07 +00:00
|
|
|
- name: config-volume
|
|
|
|
configMap:
|
2017-11-10 19:49:05 +00:00
|
|
|
name: fluentd-gcp-config-v1.2.3
|