Merge pull request #1919 from satnam6502/fluentd-gcp

Flunentd to GCP logging node level configuration
This commit is contained in:
Dawn Chen 2014-10-21 10:55:14 -07:00
commit 093ded6435
6 changed files with 37 additions and 0 deletions

View File

@ -23,6 +23,7 @@ cat <<EOF >/srv/salt-overlay/pillar/cluster-params.sls
node_instance_prefix: $NODE_INSTANCE_PREFIX
portal_net: $PORTAL_NET
use-fluentd-es: $FLUENTD_ELASTICSEARCH
use-fluentd-gcp: $FLUENTD_GCP
EOF
mkdir -p /srv/salt-overlay/salt/nginx

View File

@ -265,11 +265,17 @@ function kube-up {
echo "readonly MASTER_HTPASSWD='${htpasswd}'"
echo "readonly PORTAL_NET='${PORTAL_NET}'"
echo "readonly FLUENTD_ELASTICSEARCH='${FLUENTD_ELASTICSEARCH:-false}'"
echo "readonly FLUENTD_GCP='${FLUENTD_GCP:-false}'"
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/create-dynamic-salt-files.sh"
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/download-release.sh"
grep -v "^#" "${KUBE_ROOT}/cluster/gce/templates/salt-master.sh"
) > "${KUBE_TEMP}/master-start.sh"
# For logging to GCP we need to enable some minion scopes.
if [ $FLUENTD_GCP == "true" ]; then
MINION_SCOPES="${MINION_SCOPES}, https://www.googleapis.com/auth/logging.write"
fi
gcutil addinstance "${MASTER_NAME}" \
--project "${PROJECT}" \
--norespect_terminal_width \

View File

@ -0,0 +1,14 @@
version: v1beta2
id: fluentd-to-gcp
containers:
- name: fluentd-gcp-container
image: kubernetes/fluentd-gcp
volumeMounts:
- name: containers
mountPath: /var/lib/docker/containers
readOnly: true
volumes:
- name: containers
source:
hostDir:
path: /var/lib/docker/containers

View File

@ -0,0 +1,8 @@
/etc/kubernetes/manifests/fluentd-gcp.manifest:
file.managed:
- source: salt://fluentd-gcp/fluentd-gcp.manifest
- user: root
- group: root
- mode: 644
- makedirs: true
- dir_mode: 755

View File

@ -10,6 +10,9 @@ base:
- cadvisor
{% if pillar['use-fluentd-es'] is defined and pillar['use-fluentd-es'] %}
- fluentd-es
{% endif %}
{% if pillar['use-fluentd-gcp'] is defined and pillar['use-fluentd-gcp'] %}
- fluentd-gcp
{% endif %}
# We need a binary release of nsinit
# - nsinit

View File

@ -16,3 +16,8 @@ be targetted at an [Elasticsearch](http://www.elasticsearch.org/) instance assum
local node and accepting log information on port 9200. This can be accomplished
by writing a pod specification and service sepecificaiton to define an
Elasticsearch service (more informaiton to follow shortly in the contrib directory).
### Logging with Fluentd and Google Compute Platform
To enable logging of Docker contains in a cluster using Google Compute
Platfrom set the shell environment variable ``FLUENTD_GCP`` to ``true``.