简体   繁体   中英

how to collect knative service logs?

I want to deploy my service through knative, but I don't know how to collect the service log and save them in the es. The service logs are located under /var/log directory, so I mount the directory to the emptyDir volumn and collect log via sidecar. When I submit the yaml file, I find that knatve doesn't support this approach.

在此处输入图像描述

I know how to collect the container console log,I just don't know how to collect specific directory log when the service is deployed through knative. So does anyone know the solution?

Thanks for your help and time

as error says, yaml has 2 containers(multi container) which is not supported by knative default. thats why your yaml not accepted by knative webhook. now v0.17 supports multi container. you should try this first. https://github.com/knative/serving/blob/master/config/core/configmaps/features.yaml#L44 https://knative.dev/docs/serving/feature-flags/#control

In my case, I did collect log to ES using just stdout and it works pretty easy, so i didnt try your apporach. however, it seems that you dont need to mount additional volume considering this config file. https://github.com/knative/serving/blob/master/config/monitoring/logging/elasticsearch/100-fluentd-configmap.yaml#L46

I have no better idea anymore. hope you find best way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM