openshift 巡檢腳本

內(nèi)容如下:

運(yùn)行腳本后,會(huì)自動(dòng)添加定時(shí)任務(wù);
每天5點(diǎn)執(zhí)行.
會(huì)生成markdown格式報(bào)告.

#!/bin/bash 

set -e 
set -x 



function _Auto_Crontab_(){
    #Auto Crontab
path_dir=$(cd "$(dirname "${0}")" && pwd)
file=$(basename $0)
abs_file="${path_dir}/${file}"
log_file="${abs_file}.log"

if [[ $(grep -c "${abs_file}" /etc/crontab) -eq 0  ]] && [[ $UID -eq 0 ]]
then
    echo "00 05 * * * ${USER} ${SHELL} ${abs_file} $1 $2 &>> ${log_file} ">> /etc/crontab
fi
}

_Auto_Crontab_


_Report_Dir_="/scripts/check_ocp/$(date +%F)"

test -d "${_Report_Dir_}" || mkdir -p "${_Report_Dir_}"

_Report_file_="${_Report_Dir_}/$(date +%d_%H_%M).md"

>  "${_Report_file_}"



function _Check_Nodes_Services_(){
    local _NODE_SERVICES_=(
                atomic-openshift-node.service
                dnsmasq
                docker
                )

    for _service_ in ${_NODE_SERVICES_[@]};do 
    echo "#### Check Nodes Service : $_service_ "
    echo ' '
    echo '```bash'
        ansible -i /etc/ansible/hosts nodes -m shell -a "systemctl is-active ${_service_}"  |tee -a "${_Report_file_}"
    echo '```'
    echo ' '
    done 
}

function _Check_Masters_Services_(){
    local _MASTER_SERVICES_=(
            atomic-openshift-master-api.service 
            atomic-openshift-master-controllers.service  
            atomic-openshift-node.service
            dnsmasq
            docker
            )

    for _service_ in ${_MASTER_SERVICES_[@]};do 
        echo "#### Check Master Service : $_service_ "
    echo ' '
    echo '```bash'
        ansible -i /etc/ansible/hosts masters -m shell -a "systemctl is-active ${_service_}"  |tee -a "${_Report_file_}"
    echo '```'
    echo ' '
    done 
}


function echo(){
    /usr/bin/echo  $@ |tee -a "${_Report_file_}"
}

function _Print_(){
    echo "#### The Command: $*"
    echo ' '
    echo '```bash'
    eval $* |tee -a "${_Report_file_}"
    echo '```'
    echo ' '
}

function _Check_All_Node_(){
    echo "#### The All Node Number: $( oc get node |grep -c 'example.com')"
    _Print_ 'oc get node'
    echo "#### The NotReady Node Number: $(oc get node |grep -c 'NotReady')"
    echo "## Check All Node Desk Use%"
    echo ' '
    echo '```bash'
    ansible all -m shell -a "df -hT 2>/dev/null |grep -E '^/dev' |grep -E '[6-9][0-9]%'" |tee -a "${_Report_file_}"
    echo '```'
    echo ' '
    echo "## Check All Node Time "
    echo ' '
    echo '```bash'
    ansible all -m shell -a "df -hT 2>/dev/null |grep -E '^/dev' |grep -E '[6-9][0-9]%'" |tee -a "${_Report_file_}"
    echo '```'
    echo ' '
}




echo "# Check example OCP Dev Start $(date +%F_%R)" 


_IAM_="$(oc whoami)"

if [[ "${_IAM_}" != 'system:admin' ]];then
    oc login -u system:admin 
fi 
echo "## Login User Is : $(oc whoami)"

echo "## Check Node "

_Check_All_Node_
_Check_Masters_Services_
_Check_Nodes_Services_



_ALL_NODES_=(
    $(oc get node |grep 'node' |awk '{print $1}')
)

echo "##: The Node Resources Use: CPU Requests  CPU Limits  Memory Requests    Memory Limits %: "
    echo ' '
    echo '```bash'
for node in ${_ALL_NODES_[@]};do
    echo "$(oc describe node ${node} |grep -E -A 4 '^Allocated' |grep -E -o '\([0-9]*\%\)' |grep -E -o '[0-9]*')"
done
    echo '```'
    echo ' '



for node in ${_ALL_NODES_[@]};do
    echo "### Check Node $node "
    _Print_ "oc describe node ${node} |grep -E -A 4 '^Allocatable:' "
    _Print_ "oc describe node ${node} |grep -E -A 10000 '^Non-terminated' "
done

報(bào)告

-----------------------------------------------------------------------------------------------

Check example OCP Prod Start 2018-11-01_05:00

Login User Is : system:admin

Check Node

The All Node Number: 17

The Command: oc get node

NAME                        STATUS                     ROLES     AGE       VERSION
prdinfranode1.example.com   Ready                      compute   86d       v1.9.1+a0ce1bc657
prdinfranode2.example.com   Ready                      compute   86d       v1.9.1+a0ce1bc657
prdinfranode3.example.com   Ready                      compute   86d       v1.9.1+a0ce1bc657
prdinfranode4.example.com   Ready                      compute   86d       v1.9.1+a0ce1bc657
prdinfranode5.example.com   Ready                      compute   86d       v1.9.1+a0ce1bc657
prdinfranode6.example.com   Ready                      compute   86d       v1.9.1+a0ce1bc657
prdmaster1.example.com      Ready,SchedulingDisabled   master    86d       v1.9.1+a0ce1bc657
prdmaster2.example.com      Ready,SchedulingDisabled   master    86d       v1.9.1+a0ce1bc657
prdmaster3.example.com      Ready,SchedulingDisabled   master    86d       v1.9.1+a0ce1bc657
prdnode1.example.com        Ready                      compute   86d       v1.9.1+a0ce1bc657
prdnode2.example.com        Ready                      compute   86d       v1.9.1+a0ce1bc657
prdnode3.example.com        Ready                      compute   86d       v1.9.1+a0ce1bc657
prdnode4.example.com        Ready                      compute   86d       v1.9.1+a0ce1bc657
prdnode5.example.com        Ready                      compute   86d       v1.9.1+a0ce1bc657
prdnode6.example.com        Ready                      compute   86d       v1.9.1+a0ce1bc657
prdnode7.example.com        Ready                      compute   86d       v1.9.1+a0ce1bc657
prdnode8.example.com        Ready                      compute   86d       v1.9.1+a0ce1bc657

The NotReady Node Number: 0

Check All Node Desk Use%

prdnode7.example.com | FAILED | rc=1 >>
non-zero return code
prdnode6.example.com | FAILED | rc=1 >>
non-zero return code
prdnode8.example.com | FAILED | rc=1 >>
non-zero return code
prdinfranode5.example.com | FAILED | rc=1 >>
non-zero return code
prdinfranode4.example.com | FAILED | rc=1 >>
non-zero return code
prdnode1.example.com | FAILED | rc=1 >>
non-zero return code
prdnode2.example.com | FAILED | rc=1 >>
non-zero return code
prdnode4.example.com | FAILED | rc=1 >>
non-zero return code
prdnode3.example.com | FAILED | rc=1 >>
non-zero return code
prdnode5.example.com | FAILED | rc=1 >>
non-zero return code
prdinfranode1.example.com | SUCCESS | rc=0 >>
/dev/mapper/vg--esdata-lv--esdata xfs       500G  298G  203G  60% /esdata
prdinfranode6.example.com | FAILED | rc=1 >>
non-zero return code
prdinfranode2.example.com | SUCCESS | rc=0 >>
/dev/mapper/vg--esdata-lv--esdata xfs       500G  298G  202G  60% /esdata
prdinfranode3.example.com | SUCCESS | rc=0 >>
/dev/mapper/vg--esdata-lv--esdata xfs       500G  298G  202G  60% /esdata
prdmaster1.example.com | FAILED | rc=1 >>
non-zero return code
prdmaster2.example.com | FAILED | rc=1 >>
non-zero return code
prdmaster3.example.com | FAILED | rc=1 >>
non-zero return code

Check Master Service : atomic-openshift-master-api.service

prdmaster3.example.com | SUCCESS | rc=0 >>
active
prdmaster2.example.com | SUCCESS | rc=0 >>
active
prdmaster1.example.com | SUCCESS | rc=0 >>
active

Check Master Service : atomic-openshift-master-controllers.service

prdmaster3.example.com | SUCCESS | rc=0 >>
active
prdmaster2.example.com | SUCCESS | rc=0 >>
active
prdmaster1.example.com | SUCCESS | rc=0 >>
active

Check Master Service : atomic-openshift-node.service

prdmaster1.example.com | SUCCESS | rc=0 >>
active
prdmaster2.example.com | SUCCESS | rc=0 >>
active
prdmaster3.example.com | SUCCESS | rc=0 >>
active

Check Master Service : dnsmasq

prdmaster1.example.com | SUCCESS | rc=0 >>
active
prdmaster2.example.com | SUCCESS | rc=0 >>
active
prdmaster3.example.com | SUCCESS | rc=0 >>
active

Check Master Service : docker

prdmaster2.example.com | SUCCESS | rc=0 >>
active
prdmaster3.example.com | SUCCESS | rc=0 >>
active
prdmaster1.example.com | SUCCESS | rc=0 >>
active

Check Nodes Service : atomic-openshift-node.service

prdmaster1.example.com | SUCCESS | rc=0 >>
active
prdinfranode1.example.com | SUCCESS | rc=0 >>
active
prdinfranode2.example.com | SUCCESS | rc=0 >>
active
prdmaster2.example.com | SUCCESS | rc=0 >>
active
prdmaster3.example.com | SUCCESS | rc=0 >>
active
prdnode2.example.com | SUCCESS | rc=0 >>
active
prdinfranode3.example.com | SUCCESS | rc=0 >>
active
prdnode1.example.com | SUCCESS | rc=0 >>
active
prdnode3.example.com | SUCCESS | rc=0 >>
active
prdnode4.example.com | SUCCESS | rc=0 >>
active
prdnode5.example.com | SUCCESS | rc=0 >>
active
prdnode6.example.com | SUCCESS | rc=0 >>
active
prdinfranode5.example.com | SUCCESS | rc=0 >>
active
prdinfranode6.example.com | SUCCESS | rc=0 >>
active
prdinfranode4.example.com | SUCCESS | rc=0 >>
active
prdnode7.example.com | SUCCESS | rc=0 >>
active
prdnode8.example.com | SUCCESS | rc=0 >>
active

Check Nodes Service : dnsmasq

prdinfranode1.example.com | SUCCESS | rc=0 >>
active
prdinfranode2.example.com | SUCCESS | rc=0 >>
active
prdmaster2.example.com | SUCCESS | rc=0 >>
active
prdmaster3.example.com | SUCCESS | rc=0 >>
active
prdmaster1.example.com | SUCCESS | rc=0 >>
active
prdinfranode3.example.com | SUCCESS | rc=0 >>
active
prdnode1.example.com | SUCCESS | rc=0 >>
active
prdnode4.example.com | SUCCESS | rc=0 >>
active
prdnode2.example.com | SUCCESS | rc=0 >>
active
prdnode3.example.com | SUCCESS | rc=0 >>
active
prdnode5.example.com | SUCCESS | rc=0 >>
active
prdnode6.example.com | SUCCESS | rc=0 >>
active
prdinfranode6.example.com | SUCCESS | rc=0 >>
active
prdinfranode4.example.com | SUCCESS | rc=0 >>
active
prdinfranode5.example.com | SUCCESS | rc=0 >>
active
prdnode7.example.com | SUCCESS | rc=0 >>
active
prdnode8.example.com | SUCCESS | rc=0 >>
active

Check Nodes Service : docker

prdinfranode1.example.com | SUCCESS | rc=0 >>
active
prdinfranode2.example.com | SUCCESS | rc=0 >>
active
prdmaster2.example.com | SUCCESS | rc=0 >>
active
prdmaster3.example.com | SUCCESS | rc=0 >>
active
prdmaster1.example.com | SUCCESS | rc=0 >>
active
prdnode2.example.com | SUCCESS | rc=0 >>
active
prdnode1.example.com | SUCCESS | rc=0 >>
active
prdinfranode3.example.com | SUCCESS | rc=0 >>
active
prdnode3.example.com | SUCCESS | rc=0 >>
active
prdnode4.example.com | SUCCESS | rc=0 >>
active
prdnode5.example.com | SUCCESS | rc=0 >>
active
prdnode6.example.com | SUCCESS | rc=0 >>
active
prdinfranode6.example.com | SUCCESS | rc=0 >>
active
prdinfranode4.example.com | SUCCESS | rc=0 >>
active
prdinfranode5.example.com | SUCCESS | rc=0 >>
active
prdnode7.example.com | SUCCESS | rc=0 >>
active
prdnode8.example.com | SUCCESS | rc=0 >>
active

: The Node Resources Use: CPU Requests CPU Limits Memory Requests Memory Limits %:

21 0 38 48
17 0 36 40
20 0 39 44
2 0 9 6
2 0 9 6
2 0 2 1
5 0 3 3
5 0 3 3
5 0 3 3
25 87 62 119
25 87 54 111
22 87 60 119
6 25 18 34
25 87 54 111
1 0 1 1
1 0 1 1
1 0 1 1

Check Node prdinfranode1.example.com

The Command: oc describe node prdinfranode1.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     8
 memory:  32661400Ki
 pods:    80
System Info:

The Command: oc describe node prdinfranode1.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (8 in total)
  Namespace                  Name                                       CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                                       ------------  ----------  ---------------  -------------
  default                    docker-registry-2-hx8vl                    100m (1%)     0 (0%)      256Mi (0%)       0 (0%)
  default                    router-1-lfktr                             100m (1%)     0 (0%)      256Mi (0%)       0 (0%)
  logging                    logging-curator-13-9xdgq                   100m (1%)     0 (0%)      256Mi (0%)       256Mi (0%)
  logging                    logging-es-data-master-iv056e3b-4-2nbff    1100m (13%)   0 (0%)      8256Mi (25%)     8256Mi (25%)
  logging                    logging-fluentd-qmlsk                      100m (1%)     0 (0%)      512Mi (1%)       512Mi (1%)
  logging                    logging-kibana-2-dcw9r                     200m (2%)     0 (0%)      992Mi (3%)       992Mi (3%)
  openshift-infra            hawkular-cassandra-1-mlmgr                 0 (0%)        0 (0%)      1G (2%)          2G (5%)
  openshift-infra            heapster-s7n2c                             0 (0%)        0 (0%)      937500k (2%)     3750M (11%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests    Memory Limits
  ------------  ----------  ---------------    -------------
  1700m (21%)   0 (0%)      12976908128 (38%)  16252537216 (48%)
Events:         <none>

Check Node prdinfranode2.example.com

The Command: oc describe node prdinfranode2.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     8
 memory:  32661400Ki
 pods:    80
System Info:

The Command: oc describe node prdinfranode2.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (6 in total)
  Namespace                  Name                                       CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                                       ------------  ----------  ---------------  -------------
  default                    docker-registry-2-4cmmx                    100m (1%)     0 (0%)      256Mi (0%)       0 (0%)
  default                    router-1-nw5ck                             100m (1%)     0 (0%)      256Mi (0%)       0 (0%)
  logging                    logging-es-data-master-ryom5kjr-4-86zjx    1100m (13%)   0 (0%)      8256Mi (25%)     8256Mi (25%)
  logging                    logging-fluentd-l9zgr                      100m (1%)     0 (0%)      512Mi (1%)       512Mi (1%)
  openshift-infra            hawkular-cassandra-2-4q7bw                 0 (0%)        0 (0%)      1G (2%)          2G (5%)
  openshift-infra            hawkular-metrics-2zkrq                     0 (0%)        0 (0%)      1500M (4%)       2500M (7%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests    Memory Limits
  ------------  ----------  ---------------    -------------
  1400m (17%)   0 (0%)      12230785280 (36%)  13693914368 (40%)
Events:         <none>

Check Node prdinfranode3.example.com

The Command: oc describe node prdinfranode3.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     8
 memory:  32661400Ki
 pods:    80
System Info:

The Command: oc describe node prdinfranode3.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (7 in total)
  Namespace                  Name                                       CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                                       ------------  ----------  ---------------  -------------
  default                    docker-registry-2-jm7sj                    100m (1%)     0 (0%)      256Mi (0%)       0 (0%)
  default                    router-1-qz4lt                             100m (1%)     0 (0%)      256Mi (0%)       0 (0%)
  logging                    logging-es-data-master-tc5e4et1-4-6lt7q    1100m (13%)   0 (0%)      8256Mi (25%)     8256Mi (25%)
  logging                    logging-fluentd-xx847                      100m (1%)     0 (0%)      512Mi (1%)       512Mi (1%)
  logging                    logging-kibana-2-2547z                     200m (2%)     0 (0%)      992Mi (3%)       992Mi (3%)
  openshift-infra            hawkular-cassandra-3-8qlbz                 0 (0%)        0 (0%)      1G (2%)          2G (5%)
  openshift-infra            hawkular-metrics-hzr98                     0 (0%)        0 (0%)      1500M (4%)       2500M (7%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests    Memory Limits
  ------------  ----------  ---------------    -------------
  1600m (20%)   0 (0%)      13270972672 (39%)  14734101760 (44%)
Events:         <none>

Check Node prdinfranode4.example.com

The Command: oc describe node prdinfranode4.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     8
 memory:  7889928Ki
 pods:    80
System Info:

The Command: oc describe node prdinfranode4.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (2 in total)
  Namespace                  Name                     CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                     ------------  ----------  ---------------  -------------
  default                    routerdmz-3-55fs6        100m (1%)     0 (0%)      256Mi (3%)       0 (0%)
  logging                    logging-fluentd-m9wgb    100m (1%)     0 (0%)      512Mi (6%)       512Mi (6%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  200m (2%)     0 (0%)      768Mi (9%)       512Mi (6%)
Events:         <none>

Check Node prdinfranode5.example.com

The Command: oc describe node prdinfranode5.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     8
 memory:  7889924Ki
 pods:    80
System Info:

The Command: oc describe node prdinfranode5.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (2 in total)
  Namespace                  Name                     CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                     ------------  ----------  ---------------  -------------
  default                    routerdmz-3-brjx8        100m (1%)     0 (0%)      256Mi (3%)       0 (0%)
  logging                    logging-fluentd-2kdck    100m (1%)     0 (0%)      512Mi (6%)       512Mi (6%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  200m (2%)     0 (0%)      768Mi (9%)       512Mi (6%)
Events:         <none>

Check Node prdinfranode6.example.com

The Command: oc describe node prdinfranode6.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     8
 memory:  32661400Ki
 pods:    80
System Info:

The Command: oc describe node prdinfranode6.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (2 in total)
  Namespace                  Name                     CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                     ------------  ----------  ---------------  -------------
  default                    routerdmz-3-vpb8x        100m (1%)     0 (0%)      256Mi (0%)       0 (0%)
  logging                    logging-fluentd-c78zq    100m (1%)     0 (0%)      512Mi (1%)       512Mi (1%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  200m (2%)     0 (0%)      768Mi (2%)       512Mi (1%)
Events:         <none>

Check Node prdmaster1.example.com

The Command: oc describe node prdmaster1.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     4
 memory:  16147424Ki
 pods:    40
System Info:

The Command: oc describe node prdmaster1.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (3 in total)
  Namespace                  Name                           CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                           ------------  ----------  ---------------  -------------
  default                    registry-console-1-zsktg       0 (0%)        0 (0%)      0 (0%)           0 (0%)
  logging                    logging-fluentd-tq4cx          100m (2%)     0 (0%)      512Mi (3%)       512Mi (3%)
  openshift-web-console      webconsole-759b44bbdd-5jh7g    100m (2%)     0 (0%)      100Mi (0%)       0 (0%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  200m (5%)     0 (0%)      612Mi (3%)       512Mi (3%)
Events:         <none>

Check Node prdmaster2.example.com

The Command: oc describe node prdmaster2.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     4
 memory:  16147440Ki
 pods:    40
System Info:

The Command: oc describe node prdmaster2.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (2 in total)
  Namespace                  Name                           CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                           ------------  ----------  ---------------  -------------
  logging                    logging-fluentd-z94ht          100m (2%)     0 (0%)      512Mi (3%)       512Mi (3%)
  openshift-web-console      webconsole-759b44bbdd-5xlkz    100m (2%)     0 (0%)      100Mi (0%)       0 (0%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  200m (5%)     0 (0%)      612Mi (3%)       512Mi (3%)
Events:         <none>

Check Node prdmaster3.example.com

The Command: oc describe node prdmaster3.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     4
 memory:  16147440Ki
 pods:    40
System Info:

The Command: oc describe node prdmaster3.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (2 in total)
  Namespace                  Name                           CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                           ------------  ----------  ---------------  -------------
  logging                    logging-fluentd-7hqm7          100m (2%)     0 (0%)      512Mi (3%)       512Mi (3%)
  openshift-web-console      webconsole-759b44bbdd-49jxl    100m (2%)     0 (0%)      100Mi (0%)       0 (0%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  200m (5%)     0 (0%)      612Mi (3%)       512Mi (3%)
Events:         <none>

Check Node prdnode1.example.com

The Command: oc describe node prdnode1.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     16
 memory:  49438616Ki
 pods:    160
System Info:

The Command: oc describe node prdnode1.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (9 in total)
  Namespace                  Name                                                      CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                                                      ------------  ----------  ---------------  -------------
  example-ecp                example-ecp-front-19-hjp67                                1 (6%)        2 (12%)     1Gi (2%)         4Gi (8%)
  example-ecp                example-inventory-gateway-erp-starter-18-d5jfs            500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-gateway-retail-starter-11-swmxh         500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-inventory-inventory-starter-19-nz5s7    500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-oms-rest-starter-15-vmb2c               500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-order-order-starter-11-rn94x            500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-user-usercenter-starter-13-5gphj        500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                jenkins-1-847s4                                           0 (0%)        0 (0%)      4Gi (8%)         4Gi (8%)
  logging                    logging-fluentd-4kbgd                                     100m (0%)     0 (0%)      512Mi (1%)       512Mi (1%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  4100m (25%)   14 (87%)    30208Mi (62%)    57856Mi (119%)
Events:         <none>

Check Node prdnode2.example.com

The Command: oc describe node prdnode2.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     16
 memory:  49438616Ki
 pods:    160
System Info:

The Command: oc describe node prdnode2.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (8 in total)
  Namespace                  Name                                                  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                                                  ------------  ----------  ---------------  -------------
  example-ecp                example-ecp-front-19-jb7ph                            1 (6%)        2 (12%)     1Gi (2%)         4Gi (8%)
  example-ecp                example-inventory-item-item-starter-17-6h2j9          500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-item-item-starter-17-khgt6          500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-oms-admin-starter-15-5q5v2          500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-oms-rest-starter-15-bqtnr           500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-order-order-starter-11-4ppsg        500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-user-usercenter-starter-13-z5gnt    500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  logging                    logging-fluentd-dx64t                                 100m (0%)     0 (0%)      512Mi (1%)       512Mi (1%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  4100m (25%)   14 (87%)    26112Mi (54%)    53760Mi (111%)
Events:         <none>

Check Node prdnode3.example.com

The Command: oc describe node prdnode3.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     16
 memory:  49438632Ki
 pods:    160
System Info:

The Command: oc describe node prdnode3.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (8 in total)
  Namespace                  Name                                                      CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                                                      ------------  ----------  ---------------  -------------
  example-ecp                example-inventory-gateway-erp-starter-18-glgdl            500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-gateway-retail-starter-11-njdtf         500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-inventory-inventory-starter-19-smx64    500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-oms-rest-starter-15-87fks               500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-order-order-starter-11-84tdw            500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-scheduler-starter-10-9wfx5              500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-user-usercenter-starter-13-xm4hm        500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  logging                    logging-fluentd-mkp92                                     100m (0%)     0 (0%)      512Mi (1%)       512Mi (1%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  3600m (22%)   14 (87%)    29184Mi (60%)    57856Mi (119%)
Events:         <none>

Check Node prdnode4.example.com

The Command: oc describe node prdnode4.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     16
 memory:  49438616Ki
 pods:    160
System Info:

The Command: oc describe node prdnode4.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (3 in total)
  Namespace                  Name                                              CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                                              ------------  ----------  ---------------  -------------
  example-ecp                example-inventory-gateway-erp-starter-18-n6rmm    500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-scheduler-starter-10-hwgjc      500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  logging                    logging-fluentd-vgz9l                             100m (0%)     0 (0%)      512Mi (1%)       512Mi (1%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  1100m (6%)    4 (25%)     8704Mi (18%)     16896Mi (34%)
Events:         <none>

Check Node prdnode5.example.com

The Command: oc describe node prdnode5.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     16
 memory:  49438616Ki
 pods:    160
System Info:

The Command: oc describe node prdnode5.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (8 in total)
  Namespace                  Name                                                      CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                                                      ------------  ----------  ---------------  -------------
  example-ecp                example-ecp-front-19-n8qcf                                1 (6%)        2 (12%)     1Gi (2%)         4Gi (8%)
  example-ecp                example-inventory-gateway-retail-starter-11-qszq7         500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-inventory-inventory-starter-19-jjhm9    500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-item-item-starter-17-kn5wk              500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-oms-admin-starter-15-5fknd              500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-oms-admin-starter-15-5g2ts              500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  example-ecp                example-inventory-scheduler-starter-10-p2w6h              500m (3%)     2 (12%)     4Gi (8%)         8Gi (16%)
  logging                    logging-fluentd-lfpp4                                     100m (0%)     0 (0%)      512Mi (1%)       512Mi (1%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  4100m (25%)   14 (87%)    26112Mi (54%)    53760Mi (111%)
Events:         <none>

Check Node prdnode6.example.com

The Command: oc describe node prdnode6.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     8
 memory:  32661400Ki
 pods:    80
System Info:

The Command: oc describe node prdnode6.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (1 in total)
  Namespace                  Name                     CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                     ------------  ----------  ---------------  -------------
  logging                    logging-fluentd-9g57w    100m (1%)     0 (0%)      512Mi (1%)       512Mi (1%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  100m (1%)     0 (0%)      512Mi (1%)       512Mi (1%)
Events:         <none>

Check Node prdnode7.example.com

The Command: oc describe node prdnode7.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     8
 memory:  32661400Ki
 pods:    80
System Info:

The Command: oc describe node prdnode7.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (1 in total)
  Namespace                  Name                     CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                     ------------  ----------  ---------------  -------------
  logging                    logging-fluentd-7d8fx    100m (1%)     0 (0%)      512Mi (1%)       512Mi (1%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  100m (1%)     0 (0%)      512Mi (1%)       512Mi (1%)
Events:         <none>

Check Node prdnode8.example.com

The Command: oc describe node prdnode8.example.com |grep -E -A 4 '^Allocatable:'

Allocatable:
 cpu:     8
 memory:  32661400Ki
 pods:    80
System Info:

The Command: oc describe node prdnode8.example.com |grep -E -A 10000 '^Non-terminated'

Non-terminated Pods:         (1 in total)
  Namespace                  Name                     CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ---------                  ----                     ------------  ----------  ---------------  -------------
  logging                    logging-fluentd-pvgwk    100m (1%)     0 (0%)      512Mi (1%)       512Mi (1%)
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  CPU Requests  CPU Limits  Memory Requests  Memory Limits
  ------------  ----------  ---------------  -------------
  100m (1%)     0 (0%)      512Mi (1%)       512Mi (1%)
Events:         <none>
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末汰寓,一起剝皮案震驚了整個(gè)濱河市轧钓,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖斧蜕,帶你破解...
    沈念sama閱讀 216,402評(píng)論 6 499
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異觉痛,居然都是意外死亡荠瘪,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 92,377評(píng)論 3 392
  • 文/潘曉璐 我一進(jìn)店門逛艰,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)躏碳,“玉大人,你說(shuō)我怎么就攤上這事散怖」矫啵” “怎么了?”我有些...
    開(kāi)封第一講書(shū)人閱讀 162,483評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵镇眷,是天一觀的道長(zhǎng)咬最。 經(jīng)常有香客問(wèn)我,道長(zhǎng)欠动,這世上最難降的妖魔是什么永乌? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 58,165評(píng)論 1 292
  • 正文 為了忘掉前任,我火速辦了婚禮,結(jié)果婚禮上翅雏,老公的妹妹穿的比我還像新娘圈驼。我一直安慰自己,他們只是感情好枚荣,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,176評(píng)論 6 388
  • 文/花漫 我一把揭開(kāi)白布碗脊。 她就那樣靜靜地躺著,像睡著了一般橄妆。 火紅的嫁衣襯著肌膚如雪衙伶。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書(shū)人閱讀 51,146評(píng)論 1 297
  • 那天害碾,我揣著相機(jī)與錄音矢劲,去河邊找鬼。 笑死慌随,一個(gè)胖子當(dāng)著我的面吹牛芬沉,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播阁猜,決...
    沈念sama閱讀 40,032評(píng)論 3 417
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼丸逸,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了剃袍?” 一聲冷哼從身側(cè)響起黄刚,我...
    開(kāi)封第一講書(shū)人閱讀 38,896評(píng)論 0 274
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎民效,沒(méi)想到半個(gè)月后憔维,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 45,311評(píng)論 1 310
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡畏邢,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,536評(píng)論 2 332
  • 正文 我和宋清朗相戀三年业扒,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片舒萎。...
    茶點(diǎn)故事閱讀 39,696評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡程储,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出逆甜,到底是詐尸還是另有隱情虱肄,我是刑警寧澤,帶...
    沈念sama閱讀 35,413評(píng)論 5 343
  • 正文 年R本政府宣布交煞,位于F島的核電站,受9級(jí)特大地震影響斟或,放射性物質(zhì)發(fā)生泄漏素征。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,008評(píng)論 3 325
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望御毅。 院中可真熱鬧根欧,春花似錦、人聲如沸端蛆。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 31,659評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)今豆。三九已至嫌拣,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間呆躲,已是汗流浹背异逐。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 32,815評(píng)論 1 269
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留插掂,地道東北人灰瞻。 一個(gè)月前我還...
    沈念sama閱讀 47,698評(píng)論 2 368
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像辅甥,于是被迫代替她去往敵國(guó)和親酝润。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,592評(píng)論 2 353

推薦閱讀更多精彩內(nèi)容

  • 菜鳥(niǎo)教程shell在線編輯器大目錄整理: 1.第一個(gè) Shell 腳本嘗試 2.Shell 變量 3.Shell ...
    中酷男閱讀 5,615評(píng)論 0 12
  • Content Transformation 內(nèi)容轉(zhuǎn)換腳本用于在從網(wǎng)頁(yè)中提取內(nèi)容后轉(zhuǎn)換內(nèi)容璃弄。內(nèi)容轉(zhuǎn)換通常用于HTM...
    游俠兒evil閱讀 803評(píng)論 0 0
  • 一要销、Python簡(jiǎn)介和環(huán)境搭建以及pip的安裝 4課時(shí)實(shí)驗(yàn)課主要內(nèi)容 【Python簡(jiǎn)介】: Python 是一個(gè)...
    _小老虎_閱讀 5,744評(píng)論 0 10
  • 前言:shell script就是針對(duì)shell所寫的腳本;shell script就是利用shell的功能所寫的...
    boker_han閱讀 659評(píng)論 2 4
  • 一個(gè)人的蘭州求學(xué)之行凳鬓,離開(kāi)熟悉的地方,離開(kāi)兒子患民,來(lái)到一個(gè)陌生而遙遠(yuǎn)的地方缩举,忽然覺(jué)得自己好勇敢,忍不住要給自己瘋狂打...
    慢吞吞的亭閱讀 523評(píng)論 0 50