快上网专注成都网站设计 成都网站制作 成都网站建设
成都网站建设公司服务热线:028-86922220

网站建设知识

十年网站开发经验 + 多家企业客户 + 靠谱的建站团队

量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决

Kubernetes实用的自动化运维脚本有哪些

这篇文章主要介绍了Kubernetes实用的自动化运维脚本有哪些,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。

公司主营业务:成都网站制作、网站建设、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联建站是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联建站推出巴楚免费做网站回馈大家。


 

findEmptyNamespaces.sh

遍历集群中的所有名称空间并找到空的namespace

???? ???? ./findEmptyNamespaces.sh default
kube-public
online
test
   

getPodsTopCSV.sh

获取以CSV格式文件编写的Pod的cpu和内存使用情况

???? ???? ./getPodsTopCSV.sh --help
./getPodsTopCSV.sh - Get formatted results of kubectl top pod in a Kubernetes cluster for a selected namespace and pod in a CSV format

Usage: ./getPodsTopCSV.sh 

-n | --namespace                 : Namespace to analyse.      Default: default
-p | --pod                       : Pod to analyse.
-d | --duration               : Duration of sampling.      Default: 0 (infinite)
-i | --interval               : Interval between samples.  Default: 5
-o | --output                    : Output file.               Default: top-.csv
-c | --containers                      : Output per container.      Default: off
-q | --quite                           : Don't output to screen.    Default: Output to screen
-h | --help                            : Show this usage
--no-headers                           : Don't print headers line

Examples:
========
Get for pod foo in namespace bar:                                $ ./getPodsTopCSV.sh --namespace bar --pod foo
Get for pod foo in namespace bar and output to file foo.csv :    $ ./getPodsTopCSV.sh --namespace bar --pod foo --output foo.csv
   

getResourcesCSV.sh

以CSV格式获取每个容器的所有容器资源请求和限制,并对其值进行标准化。CSV格式非常易于自动化,非常适合粘贴到Excel进行进一步处理。

???? ???? ./getResourcesCSV.sh --help

./getResourcesCSV.sh - Extract resource requests and limits in a Kubernetes cluster for a selected namespace or all namespaces in a CSV format

Usage: ./getResourcesCSV.sh 

-n | --namespace                 : Namespace to analyse.    Default: --all-namespaces
-o | --output                    : Output file.             Default: resources.csv
-q | --quite                           : Don't output to screen.  Default: Output to screen
-h | --help                            : Show this usage
--no-headers                           : Don't print headers line

Examples:
========
Get all:                                                  $ ./getResourcesCSV.sh
Get for namespace foo:                                    $ ./getResourcesCSV.sh --namespace foo
Get for namespace foo and use output file bar.csv :       $ ./getResourcesCSV.sh --namespace foo --output bar.csv
   

getRestartingPods.sh

获取在一个或多个容器中检测到重新启动的所有Pod(全部或单个命名空间)。格式为CSV。

???? ???? ./getRestartingPods.sh --help
./getRestartingPods.sh - Extract resource requests and limits in a Kubernetes cluster for a selected namespace or all namespaces in a CSV format

Usage: ./getRestartingPods.sh 

-n | --namespace                 : Namespace to analyse.    Default: --all-namespaces
-o | --output                    : Output file.             Default: restarting.csv
-q | --quite                           : Don't output to screen.  Default: Output to screen
-h | --help                            : Show this usage
--no-headers                           : Don't print headers line

Examples:
========
Get all:                                                  $ ./getRestartingPods.sh
Get for namespace foo:                                    $ ./getRestartingPods.sh --namespace foo
Get for namespace foo and use output file bar.csv :       $ ./getRestartingPods.sh --namespace foo --output bar.csv
   

podReady.sh

检查Pod是否真的准备就绪的简单脚本。检查状态为“正在运行”,并且所有容器均已准备就绪。如果准备就绪,则返回0。如果尚未准备就绪,则返回1。

???? ???? ./podReady.sh kube-flannel-ds-lf87p kube-system

感谢你能够认真阅读完这篇文章,希望小编分享的“Kubernetes实用的自动化运维脚本有哪些”这篇文章对大家有帮助,同时也希望大家多多支持创新互联,关注创新互联行业资讯频道,更多相关知识等着你来学习!


新闻标题:Kubernetes实用的自动化运维脚本有哪些
文章路径:http://6mz.cn/article/ghgghe.html

其他资讯