当前位置: 首页 > news >正文

建站网站建设郑州网站制作公司

建站网站建设,郑州网站制作公司,郑州app开发 丁,自适用网站的建设公众号关注 「奇妙的 Linux 世界」设为「星标」,每天带你玩转 Linux !robusta 的功能远不止本章介绍的这些,它可以去监控 Kubernetes,提供观测性,可以于 prometheus 接入,作为告警的二次处理,自…

公众号关注 「奇妙的 Linux 世界」

设为「星标」,每天带你玩转 Linux !

5e215b59839adc415e960cbff4e80d91.png

robusta 的功能远不止本章介绍的这些,它可以去监控 Kubernetes,提供观测性,可以于 prometheus 接入,作为告警的二次处理,自动修复等,也提供了事件的时间线。

此前使用的是阿里的 kube-eventer,kube-eventer 仅仅只是提供了一个转发,因此 kube-eventer 只能解决的是事件触发的通知。

当然, 如果 robusta 也是仅仅止步于此,那也没用多少必要性去使用它。它还提供了另外一种非常有用的功能 : 事件告警。 在 robusta 的事件告警中,当侦测到后,会将预设中预设的 pod 状态连同最近一段日志发送到 slack. 这也是为什么会有这篇文章最重要的原因。

基础依赖

python 版本必须等于大于 3.7,于是我们升级版本。

升级 python:

$ wget https://www.python.org/ftp/python/3.9.16/Python-3.9.16.tar.xz
$ yum install gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel -y
$ yum install libffi-devel -y
$ yum install zlib* -y$ tar xf Python-3.9.16.tar.xz
$ cd Python-3.9.16
$ ./configure --with-ssl --prefix=/usr/local/python3  
$ make 
$ make install
$ rm -rf  /usr/bin/python3 /usr/bin/pip3
$ ln -s /usr/local/python3/bin/python3 /usr/bin/python3
$ ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3

准备国内源:

$ mkdir -p ~/.pip/
$ cat > ~/.pip/pip.conf << EOF
[global]
trusted-host =  mirrors.aliyun.com
index-url = http://mirrors.aliyun.com/pypi/simple
EOF

robusta.dev

参考官方文档[1]开始安装。

$ pip3 install -U robusta-cli --no-cache robusta gen-config

由于网络问题,我个人将使用使用 docker 进行配置。

$ curl -fsSL -o robusta https://docs.robusta.dev/master/_static/robusta
$ chmod +x robusta
$ ./robusta gen-config

开始之前,务必下载我中转的镜像:

docker pull registry.cn-zhangjiakou.aliyuncs.com/marksugar-k8s/robusta-cli:latest
docker tag  us-central1-docker.pkg.dev/genuine-flight-317411/devel/robusta-cli:latest registry.cn-zhangjiakou.aliyuncs.com/marksugar-k8s/robusta-cli:latest
$ ./robusta  gen-config
Robusta reports its findings to external destinations (we call them "sinks").
We'll define some of them now.Configure Slack integration? This is HIGHLY recommended. [Y/n]: y
# 强烈建议配置slack
If your browser does not automatically launch, open the below url:
https://api.robusta.dev/integrations/slack?id=64a3ee7c-5691-466f-80da-85e8ece80359
# 浏览器打开
======================================================================
Error getting slack token ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
======================================================================
======================================================================
Error getting slack token HTTPSConnectionPool(host='api.robusta.dev', port=443): Max retries exceeded with url: /integrations/slack/get-token?id=64a3ee7c-5691-466f-80da-85e8ece80359 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f50b1f18cd0>: Failed to establish a new connection: [Errno 110] Connection timed out'))
======================================================================
You've just connected Robusta to the Slack of: crow as a cock
Which slack channel should I send notifications to? #

根据提示打开 If your browser does not automatically launch, open the below url: https://api.robusta.dev/integrations/slack?id=64a3ee7c-5691-466f-80da-85e8ece80359

47697dd1d45b2a06cf57f37639454bd4.png

勾选允许:

582f190978d486a503ab35d89315292e.png

如下:

572497631da148182492c63130d6e5d9.png


此时 slack 已经有了 robusta 应用:

281b2cfd6262819195ecda4ca35e9586.png

继续下一步,在提示种选择了频道后:

Which slack channel should I send notifications to? # devops

会受到一封消息:

5911172980fcba7324135e2574be95c1.png

执行完成后,如下:

$ ./robusta  gen-config
Robusta reports its findings to external destinations (we call them "sinks").
We'll define some of them now.Configure Slack integration? This is HIGHLY recommended. [Y/n]: y
If your browser does not automatically launch, open the below url:
https://api.robusta.dev/integrations/slack?id=d1fcbb13-5174-4027-a176-a3dcab10c27a
======================================================================
Error getting slack token HTTPSConnectionPool(host='api.robusta.dev', port=443): Max retries exceeded with url: /integrations/slack/get-token?id=d1fcbb13-5174-4027-a176-a3dcab10c27a (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f0ec508eee0>: Failed to establish a new connection: [Errno 110] Connection timed out'))
======================================================================
You've just connected Robusta to the Slack of: crow as a cock
Which slack channel should I send notifications to? # devops
Configure MsTeams integration? [y/N]: n
配置MsTeams集成?[y / N]: N
Configure Robusta UI sink? This is HIGHLY recommended. [Y/n]: y
配置Robusta UI接收器?这是强烈推荐的。[Y / n]:
Enter your Gmail/Google address. This will be used to login: user@gmail.com
输入您的Gmail/谷歌地址。这将用于登录:
Choose your account name (e.g your organization name): marksugar
选择您的帐户名称(例如您的组织名称):
Successfully registered.Robusta can use Prometheus as an alert source.
If you haven't installed it yet, Robusta can install a pre-configured Prometheus.
Would you like to do so? [y/N]: y
罗布斯塔可以使用普罗米修斯作为警报源。
如果你还没有安装它,罗布斯塔可以安装一个预先配置的Prometheus。
你愿意这样做吗?[y / N]:
Please read and approve our End User License Agreement: https://api.robusta.dev/eula.html
Do you accept our End User License Agreement? [y/N]: y
请阅读并批准我们的最终用户许可协议:https://api.robusta.dev/eula.html
您是否接受我们的最终用户许可协议?[y / N]:
Last question! Would you like to help us improve Robusta by sending exception reports? [y/N]: n
最后一个问题!你愿意通过发送异常报告来帮助我们改进Robusta吗?[y / N]:Saved configuration to ./generated_values.yaml - save this file for future use!
Finish installing with Helm (see the Robusta docs). Then login to Robusta UI at https://platform.robusta.devBy the way, we'll send you some messages later to get feedback. (We don't store your API key, so we scheduled future messages using Slack'sAPI)
保存配置到。/generated_values。保存这个文件以备将来使用!
完成Helm的安装(参见罗布斯塔文档)。然后登录到罗布斯塔用户界面https://platform.robusta.dev顺便说一下,我们稍后会给你发一些信息以获得反馈。(我们不存储你的API密钥,所以我们使用Slack的API来安排未来的消息)

上述完成后,创建了一个 generated_values.yaml

globalConfig:signing_key: 92a8195-a3fa879b3f88account_id: 79efaf9c433294
sinksConfig:
- slack_sink:name: main_slack_sinkslack_channel: devopsapi_key: xoxb-4715825756487-4749501ZZylPy1f
- robusta_sink:name: robusta_ui_sinktoken: eyJhY2NvjIn0=
enablePrometheusStack: true
enablePlatformPlaybooks: true
runner:sendAdditionalTelemetry: false
rsa:private: LS0tLS1CRUdJTiBRCBSU0EgUFJJVkFURSBLRVktLS0tLQo=public: LS0tLS1CRUdJTiBQTElDIEtFWS0tLS0tCg==

helm

紧接着使用上述创建的 yaml 文件进行安装。我们适当调整下内容。

关于触发器的种类非常多,我们可以参考:example-triggers[2],  java-troubleshooting[3],event-enrichment[4]miscellaneous[5],kubernetes-triggers[6]。我们可以针对某一组 pod 或者名称空间进行过滤去监控的特定的信息。

我们节选一些测试,并且加到 generated_values.yaml 种,如下:

globalConfig:signing_key: 92a8195-a3fa879b3f88account_id: 79efaf9c433294
sinksConfig:
- slack_sink:name: main_slack_sinkslack_channel: devopsapi_key: xoxb-4715825756487-4749501ZZylPy1f
- robusta_sink:name: robusta_ui_sinktoken: eyJhY2NvjIn0=
enablePrometheusStack: false
enablePlatformPlaybooks: true
runner:sendAdditionalTelemetry: false
rsa:private: LS0tLS1CRUdJTiBRCBSU0EgUFJJVkFURSBLRVktLS0tLQo=public: LS0tLS1CRUdJTiBQTElDIEtFWS0tLS0tCg==customPlaybooks:
- triggers:- on_deployment_update: {}actions:- resource_babysitter:omitted_fields: []fields_to_monitor: ["spec.replicas"]- triggers:- on_pod_crash_loop:restart_reason: "CrashLoopBackOff"restart_count: 1rate_limit: 3600actions:- report_crash_loop: {}- triggers:- on_pod_oom_killed:rate_limit: 900exclude:- name: "oomkilled-pod"namespace: "default"actions:- pod_graph_enricher:resource_type: Memorydisplay_limits: true- triggers:- on_container_oom_killed:rate_limit: 900exclude:- name: "oomkilled-container"namespace: "default"actions:- oomkilled_container_graph_enricher:resource_type: Memory- triggers:- on_job_failure:namespace_prefix: robustaactions:- create_finding:title: "Job $name on namespace $namespace failed"aggregation_key: "Job Failure"- job_events_enricher: runner:image: registry.cn-zhangjiakou.aliyuncs.com/marksugar-k8s/robusta-runner:0.10.10imagePullPolicy: IfNotPresent
kubewatch:image: registry.cn-zhangjiakou.aliyuncs.com/marksugar-k8s/kubewatch:v2.0imagePullPolicy: IfNotPresent

现在我们开始使用 helm 安装:

$ helm repo add robusta https://robusta-charts.storage.googleapis.com && helm repo update
$ helm upgrade --install robusta --namespace robusta  --create-namespace  robusta/robusta -f ./generated_values.yaml \
--set clusterName=test

也可以使用如下命令调试

$ helm upgrade --install robusta --namespace robusta  robusta/robusta -f ./generated_values.yaml  --set clusterName=test --dry-run

如下:

$ helm upgrade --install robusta --namespace robusta  --create-namespace  robusta/robusta -f ./generated_values.yaml \
> --set clusterName=test
Release "robusta" does not exist. Installing it now.
NAME: robusta
LAST DEPLOYED: Thu Feb  2 15:58:32 2023
NAMESPACE: robusta
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
Thank you for installing Robusta 0.10.10As an open source project, we collect general usage statistics.
This data is extremely limited and contains only general metadata to help us understand usage patterns.
If you are willing to share additional data, please do so! It really help us improve Robusta.You can set sendAdditionalTelemetry: true as a Helm value to send exception reports and additional data.
This is disabled by default.To opt-out of telemetry entirely, set a ENABLE_TELEMETRY=false environment variable on the robusta-runner deployment.Visit the web UI at: https://platform.robusta.dev/

等待 pod 就绪:

$ kubectl -n robusta get pod -w
NAME                                 READY   STATUS              RESTARTS   AGE
robusta-forwarder-78964b4455-vnt77   1/1     Running             0          2m55s
robusta-runner-758cf9c986-87l4x      0/1     ContainerCreating   0          2m55s
robusta-runner-758cf9c986-87l4x      1/1     Running             0          7m6s

此时如果你的集群上 pod 有异常状态的而崩溃的,在被删除前,将会将日志发送到 slack, slack 上已经可以收到日志信息了:

5d5baeb5902e95b6ad98c2e97b58e75f.png

选择点击以展开内联,即可查看详细信息:

1911ff1ef6ff154de91225e98123f011.png

引用链接

[1]

官方文档: https://docs.robusta.dev/master/installation.html

[2]

example-triggers: https://docs.robusta.dev/master/catalog/triggers/smart.html#example-triggers

[3]

java-troubleshooting: https://docs.robusta.dev/master/catalog/actions/java-troubleshooting.html

[4]

event-enrichment: https://docs.robusta.dev/master/catalog/actions/event-enrichment.html

[5]

miscellaneous: https://docs.robusta.dev/master/catalog/actions/miscellaneous.html

[6]

kubernetes-triggers: https://docs.robusta.dev/master/catalog/triggers/kubernetes.html#kubernetes-triggers

本文转载自:「LinuxEA」,原文:https://url.hi-linux.com/zsMf6,版权归原作者所有。欢迎投稿,投稿邮箱: editor@hi-linux.com。

ef1bdc9a04aef4d5d06c9aae048cf94b.gif

最近,我们建立了一个技术交流微信群。目前群里已加入了不少行业内的大神,有兴趣的同学可以加入和我们一起交流技术,在 「奇妙的 Linux 世界」 公众号直接回复 「加群」 邀请你入群。

7ac61bef64b102f6c9a1bfcae9ac3017.png

你可能还喜欢

点击下方图片即可阅读

3986459cd06eba341603b271ae96de68.png

15 个 Kubernetes 最佳实践

c2472c3312a35726f600bd58e21c49d0.png
点击上方图片,『美团|饿了么』外卖红包天天免费领

809adfbdd178a39d3061ac7b9e70476d.png

更多有趣的互联网新鲜事,关注「奇妙的互联网」视频号全了解!

http://www.lbrq.cn/news/2706913.html

相关文章:

  • 深圳拼团手机网站开发百度站长平台快速收录
  • 山东网站推广营销设计做网络推广一个月的收入
  • 项目计划书范文关键词优化心得
  • ashx做网站网络营销优化培训
  • 怎样给网站做推广沈阳全网推广公司哪家好
  • 彩票网站建设方案企业如何网络推广
  • 东营网站建设电话全国疫情最新情况最新消息今天
  • 中建卓越建设有限公司网站首页磁力猫最好磁力搜索引擎
  • 手机网站开发周期seo泛目录培训
  • 网站系统名称是什么长沙推广引流
  • 男的和女的做那种短视频网站seo优化推广公司
  • 池州专业网站建设公司营销培训课程ppt
  • 乌鲁木齐网站设计要多少钱知名seo公司
  • dnf做汉堡怎么玩间网站百度seo优化及推广
  • 潍城区住房和城乡建设局网站网络营销七个步骤
  • java制作的网站专业软文
  • 网站开发app营销培训机构哪家最专业
  • 惠州网站开发公司重庆疫情最新消息
  • 织梦复制网站模板百度客服人工
  • 学校网站建设的作用如何搭建一个网站平台
  • 国家中职示范校建设专题网站佛山百度推广公司
  • 移动网站建站系统下载怎么做一个网站的步骤
  • 中国优秀企业网站优化精灵
  • 做一个网站加优化排名得多少钱软文素材网站
  • 学做烘焙的网站登录百度账号注册
  • 自适应产品网站模板网店推广方案范文
  • 太原网站制作最新招聘信息网络销售工作靠谱吗
  • 东莞企业网站费用小程序源码网
  • 我国市级网站建设分析模板长沙关键词优化公司电话
  • 玉环住房与城乡建设规划局网站成人电脑培训班办公软件
  • Python之Django使用技巧(附视频教程)
  • Linux下的软件编程——framebuffer(文件操作的应用)
  • 弹性扩展新范式:分布式LLM计算的FastMCP解决方案
  • 面试实战 问题二十九 Java 值传递与引用传递的区别详解
  • 长篇音频制作(小说自动配音)完整教程
  • 数据分析项目----幸福感挖掘和预测