kubernetes - 如何在 azure devops 中通过邮件发送 kubectl 日志输出
问题描述
我有一个 azuredevops 构建作业来获取部署 pod 的日志。
命令: kubectl logs deployment/myapp
我在 azure devops 管道的摘要页面中获得输出,但同样我想发送一个带有日志作为附件的团队。为此,我在 azure devops 中没有任何选择
解决方案
Basically, your k8s log (pods) will gone after the pods has been terminated (although you can somehow keep it for a little while). For debug purpose or any other purpose you want, you need to Centralized logging
your k8s log (use some tools: filebeat, fluentd, fluent-bit to forward your k8s log to elasticsearch).
EX: Some software (tools) for Centralized logging
Elasticsearch, Graylog, ...
https://www.elastic.co/fr/what-is/elk-stack
And then you can save, export, analyze your log ... You can do anythings you want with your stored k8s log.
Hope this may help you, guy!
Edit: I use GCP as cloud solution and in GCP, by default, they will use fluentd to forward your k8s log to store in Logging
. And the Logging
has feature Export
, I think you can search somethings similar to Logging
in your cloud solution: Azure
推荐阅读
- amazon-web-services - AWS Cognito SignInWithApple 抛出 apple_sub Attribute does not exist in schema 错误
- python - SQL 服务器连接在 lambda 容器中工作正常,但在将 zip 上传到 aws lambda 后失败
- keras - 如何在 Keras 中编写线性激活函数
- javascript - 功能组件的 usestate 反应钩子总是在使用 setstate 时重新渲染整个组件
- purescript - Purescript 中的 getElementById
- django - 在 Django 中对相同值的记录添加操作
- php - 函数 App\Http\Controllers\Auth\RegisterController::createuser() 的参数太少,通过了 0,预期正好 1
- google-sheets - 特定日期范围自动建议操作的条件格式日期
- php - 在 WooCommerce 的后端添加样式自定义字段
- python - 是否有可能在 python-opengl 中获得“不可见”顶点的索引,如 gloo、glumpy?