mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Flunentd to GCP logging node level configuration
This commit is contained in:
parent
e8686429c4
commit
39212f5e2e
@ -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
|
||||
|
@ -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 \
|
||||
|
14
cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.manifest
Normal file
14
cluster/saltbase/salt/fluentd-gcp/fluentd-gcp.manifest
Normal 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
|
8
cluster/saltbase/salt/fluentd-gcp/init.sls
Normal file
8
cluster/saltbase/salt/fluentd-gcp/init.sls
Normal 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
|
@ -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
|
||||
|
@ -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``.
|
Loading…
Reference in New Issue
Block a user