Kubernetes實(shí)用的自動(dòng)化運(yùn)維腳本有哪些

這篇文章主要介紹了Kubernetes實(shí)用的自動(dòng)化運(yùn)維腳本有哪些,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

公司主營業(yè)務(wù):成都網(wǎng)站制作、網(wǎng)站建設(shè)、移動(dòng)網(wǎng)站開發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實(shí)現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競爭能力。創(chuàng)新互聯(lián)建站是一支青春激揚(yáng)、勤奮敬業(yè)、活力青春激揚(yáng)、勤奮敬業(yè)、活力澎湃、和諧高效的團(tuán)隊(duì)。公司秉承以“開放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對我們的高要求,感謝他們從不同領(lǐng)域給我們帶來的挑戰(zhàn),讓我們激情的團(tuán)隊(duì)有機(jī)會(huì)用頭腦與智慧不斷的給客戶帶來驚喜。創(chuàng)新互聯(lián)建站推出巴楚免費(fèi)做網(wǎng)站回饋大家。


 

findEmptyNamespaces.sh

遍歷集群中的所有名稱空間并找到空的namespace。

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

getPodsTopCSV.sh

獲取以CSV格式文件編寫的Pod的cpu和內(nèi)存使用情況

???? ???? ./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 <options>

-n | --namespace <name>                : Namespace to analyse.      Default: default
-p | --pod <name>                      : Pod to analyse.
-d | --duration <seconds>              : Duration of sampling.      Default: 0 (infinite)
-i | --interval <seconds>              : Interval between samples.  Default: 5
-o | --output <name>                   : Output file.               Default: top-<timestamp>.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格式獲取每個(gè)容器的所有容器資源請求和限制,并對其值進(jìn)行標(biāo)準(zhǔn)化。CSV格式非常易于自動(dòng)化,非常適合粘貼到Excel進(jìn)行進(jìn)一步處理。

???? ???? ./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 <options>

-n | --namespace <name>                : Namespace to analyse.    Default: --all-namespaces
-o | --output <name>                   : 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

獲取在一個(gè)或多個(gè)容器中檢測到重新啟動(dòng)的所有Pod(全部或單個(gè)命名空間)。格式為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 <options>

-n | --namespace <name>                : Namespace to analyse.    Default: --all-namespaces
-o | --output <name>                   : 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是否真的準(zhǔn)備就緒的簡單腳本。檢查狀態(tài)為“正在運(yùn)行”,并且所有容器均已準(zhǔn)備就緒。如果準(zhǔn)備就緒,則返回0。如果尚未準(zhǔn)備就緒,則返回1。

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

感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“Kubernetes實(shí)用的自動(dòng)化運(yùn)維腳本有哪些”這篇文章對大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識等著你來學(xué)習(xí)!

網(wǎng)站欄目:Kubernetes實(shí)用的自動(dòng)化運(yùn)維腳本有哪些
當(dāng)前鏈接:http://muchs.cn/article44/ghgghe.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計(jì)品牌網(wǎng)站制作、自適應(yīng)網(wǎng)站、商城網(wǎng)站手機(jī)網(wǎng)站建設(shè)、品牌網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都seo排名網(wǎng)站優(yōu)化