-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload container runtime log to sd/es. #59103
Upload container runtime log to sd/es. #59103
Conversation
@crassirostris Please note that, with this there will be both |
/test pull-kubernetes-unit |
/cc @igorpeshansky for input on how tags are consumed in stackdriver. |
@Random-Liu this should rev the version of the fluentd-es addon container image. need to update:
current value is v2.0.4, I believe that v2.0.5 is appropriate. |
|
@igorpeshansky the tag is added for the container runtime (e.g., docker daemon) log itself, which does not map to any "container". Does the same rule still apply? |
Well, the question is which resource in Stackdriver the log is going to be associated with. By default, the logging agent expects the tag to be in a certain format to extract the resource information -- if the tag doesn't match, it won't be able to infer the resource, and there is currently no easy way to supply one directly to the agent. |
@coffeepac Thanks! I'll do that if people are ok with this PR. :)
@igorpeshansky This tag |
@igorpeshansky I also didn't find anything special usage of the "docker" tag in the files you linked. If that's the case, does fluentd simply pass the tag to stackdriver? |
Right, in that case fluentd will default to the instance resource and pass the tag to Stackdriver. There will be no association with the Kubernetes node or any other Kubernetes entity. |
Can I understand this as for docker daemon log, either Do we assume that there is a |
I see. The logs are only associated with the GCE VM instances, and these logs will have two tags ( |
There is no |
@igorpeshansky Thanks a lot for the information. :) |
/approve (for cluster directory changes) |
/lgtm |
@coffeepac This is only a config change. Do we really want to build a new image with new version? I feel like we should only update the config version https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/fluentd-elasticsearch/fluentd-es-configmap.yaml#L4 |
de37dcb
to
5c4a9ec
Compare
@coffeepac Updated from 0.1.3 to 0.1.4 |
Apply LGTM based on #59103 (comment) |
@Random-Liu looks good! thanks. |
/test pull-kubernetes-bazel-test |
cluster/gce/gci/configure-helper.sh
Outdated
@@ -2041,6 +2041,11 @@ function start-fluentd-resource-update { | |||
wait-for-apiserver-and-update-fluentd ${fluentd_gcp_yaml} & | |||
} | |||
|
|||
# Update {{ container-runtime }} with actual container runtime name. | |||
function update-container-runtime { | |||
sed -i -e "s@{{ *container_runtime *}}@${CONTAINER_RUNTIME_NAME:-docker}@g" "$1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make a local variable from the argument, so it's much easier to read this code later (i.e. local -r configmap_path="$1"
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the change!
Please bump fluentd-gcp configmap version & both for fluentd-gcp and fluentd-es sync configmap version in the configmap manifest file & in the damonset manifest file
Done. fluentd-es-config is changed to |
/test pull-kubernetes-bazel-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, otherwise LGTM, thanks for the change!
@@ -82,7 +82,8 @@ NODE_IMAGE_PROJECT=${KUBE_GCE_NODE_PROJECT:-cos-cloud} | |||
NODE_SERVICE_ACCOUNT=${KUBE_GCE_NODE_SERVICE_ACCOUNT:-default} | |||
CONTAINER_RUNTIME=${KUBE_CONTAINER_RUNTIME:-docker} | |||
CONTAINER_RUNTIME_ENDPOINT=${KUBE_CONTAINER_RUNTIME_ENDPOINT:-} | |||
LOAD_IMAGE_COMMAND=${KUBE_LOAD_IMAGE_COMMAND:-docker load -i} | |||
CONTAINER_RUNTIME_NAME=${KUBE_CONTAINER_RUNTIME_NAME:-} | |||
LOAD_IMAGE_COMMAND=${KUBE_LOAD_IMAGE_COMMAND:-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this parameters changed? I don't understand how it's related to the rest of the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because we don't need a default value here. The default value is set at https://github.com/kubernetes/kubernetes/blob/master/cluster/gce/gci/configure.sh#L261.
I added the initial code, just want to do a bit cleanup. :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks for the explanation!
/test pull-kubernetes-bazel-test |
Signed-off-by: Lantao Liu <lantaol@google.com>
29c970b
to
8d920d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
@@ -82,7 +82,8 @@ NODE_IMAGE_PROJECT=${KUBE_GCE_NODE_PROJECT:-cos-cloud} | |||
NODE_SERVICE_ACCOUNT=${KUBE_GCE_NODE_SERVICE_ACCOUNT:-default} | |||
CONTAINER_RUNTIME=${KUBE_CONTAINER_RUNTIME:-docker} | |||
CONTAINER_RUNTIME_ENDPOINT=${KUBE_CONTAINER_RUNTIME_ENDPOINT:-} | |||
LOAD_IMAGE_COMMAND=${KUBE_LOAD_IMAGE_COMMAND:-docker load -i} | |||
CONTAINER_RUNTIME_NAME=${KUBE_CONTAINER_RUNTIME_NAME:-} | |||
LOAD_IMAGE_COMMAND=${KUBE_LOAD_IMAGE_COMMAND:-} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks for the explanation!
/approve |
/retest |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: crassirostris, Random-Liu, roberthbailey, yujuhong The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these OWNERS Files:
Approvers can indicate their approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
I've verified this in my environment. My stackdriver has an extra
container-runtime
entry for node log, and it collects container runtime daemon log correctly.@yujuhong @feiskyer @crassirostris @piosz
@kubernetes/sig-node-pr-reviews @kubernetes/sig-instrumentation-pr-reviews
Signed-off-by: Lantao Liu lantaol@google.com
Release note: