From 6ef5d177019af90ee86f87d3c4cfc4f87176e7c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20K=C5=82obuszewski?= Date: Wed, 21 Feb 2018 15:50:23 +0100 Subject: [PATCH 1/2] readme update for fluentd-gcp-scaler --- cluster/addons/fluentd-gcp/README.md | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/cluster/addons/fluentd-gcp/README.md b/cluster/addons/fluentd-gcp/README.md index d706cd038f5..7627e43e444 100644 --- a/cluster/addons/fluentd-gcp/README.md +++ b/cluster/addons/fluentd-gcp/README.md @@ -8,4 +8,67 @@ they can be searched, viewed, and analyzed. Learn more at: https://kubernetes.io/docs/tasks/debug-application-cluster/logging-stackdriver +## Troubleshooting + +In Kubernetes clusters in version 1.10.0 or later, fluentd-gcp DaemonSet can be +manually scaled. This is useful e.g. when the applications running in the +cluster are sending a large volume of logs (i.e. over 100kB/s), causing +fluentd-gcp to fail with OOM errors. Conversely, if the applications aren't +generating a lot of logs, it may be useful to reduce the amount of resources +consumed by fluentd-gcp, making them available to other applications. To learn +more about Kubernetes resource requests and limits, see the official +documentation ([CPU][cpu], [memory][memory]). The amount of resources requested +by fluentd-gcp on every node in the cluster can be fetched by running following +command: + +``` +$ kubectl get ds -n kube-system -l k8s-app=fluentd-gcp -o custom-columns=NAME:.metadata.name,CPU_REQUEST:.spec.template.spec.containers[].resources.requests.cpu,MEMORY_REQUEST:.spec.template.spec.containers[].resources.requests.memory,MEMORY_LIMIT:.spec.template.spec.containers[].resources.limits.memory +``` + +This will display an output similar to the following: + +``` +NAME CPU_REQUEST MEMORY_REQUEST MEMORY_LIMIT +fluentd-gcp-v2.0.15 100m 200Mi 300Mi +``` + +In order to change those values, a [ScalingPolicy][scalingPolicy] needs to be +defined. Currently, only base values are supported (no automatic scaling). The +ScalingPolicy can be created using kubectl. E.g. to set cpu request to 101m, +memory request to 150Mi and memory limit to 400Mi: + +``` +$ cat < Date: Thu, 22 Feb 2018 09:59:16 +0100 Subject: [PATCH 2/2] Review #1 --- cluster/addons/fluentd-gcp/README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/cluster/addons/fluentd-gcp/README.md b/cluster/addons/fluentd-gcp/README.md index 7627e43e444..ddc349213e2 100644 --- a/cluster/addons/fluentd-gcp/README.md +++ b/cluster/addons/fluentd-gcp/README.md @@ -11,18 +11,22 @@ Learn more at: https://kubernetes.io/docs/tasks/debug-application-cluster/loggin ## Troubleshooting In Kubernetes clusters in version 1.10.0 or later, fluentd-gcp DaemonSet can be -manually scaled. This is useful e.g. when the applications running in the -cluster are sending a large volume of logs (i.e. over 100kB/s), causing -fluentd-gcp to fail with OOM errors. Conversely, if the applications aren't -generating a lot of logs, it may be useful to reduce the amount of resources -consumed by fluentd-gcp, making them available to other applications. To learn +manually scaled. This is useful e.g. when applications running in the cluster +are sending a large volume of logs (i.e. over 100kB/s), causing fluentd-gcp to +fail with OutOfMemory errors. Conversely, if the applications aren't generating +a lot of logs, it may be useful to reduce the amount of resources consumed by +fluentd-gcp, making these resources available to other applications. To learn more about Kubernetes resource requests and limits, see the official documentation ([CPU][cpu], [memory][memory]). The amount of resources requested by fluentd-gcp on every node in the cluster can be fetched by running following command: ``` -$ kubectl get ds -n kube-system -l k8s-app=fluentd-gcp -o custom-columns=NAME:.metadata.name,CPU_REQUEST:.spec.template.spec.containers[].resources.requests.cpu,MEMORY_REQUEST:.spec.template.spec.containers[].resources.requests.memory,MEMORY_LIMIT:.spec.template.spec.containers[].resources.limits.memory +$ kubectl get ds -n kube-system -l k8s-app=fluentd-gcp \ +-o custom-columns=NAME:.metadata.name,\ +CPU_REQUEST:.spec.template.spec.containers[].resources.requests.cpu,\ +MEMORY_REQUEST:.spec.template.spec.containers[].resources.requests.memory,\ +MEMORY_LIMIT:.spec.template.spec.containers[].resources.limits.memory ``` This will display an output similar to the following: