MEMORY_REQUESTS=$(kubectl get pod $POD -n $NAMESPACE -o jsonpath='{.spec.containers[0].resources.requests.memory}') # 输出 pod 的内存使用情况和 requests 值 echo "Pod: $POD in namespace $NAMESPACE" echo " Memory Usage: $MEMORY_USAGE" echo " Memory Requests: $MEMORY_REQUESTS" echo "...
cluster-info 显示集群信息 top Display Resource (CPU/Memory/Storage) usage. cordon 标记 node 为 unschedulable uncordon 标记 node 为 schedulable drain Drain node in preparation for maintenance taint 更新一个或者多个 node 上的 taints Troubleshooting and Debugging Commands: describe 显示一个指定 resource...
cluster-info Display cluster information top Display resource (CPU/memory) usage cordon 标记节点为不可调度 uncordon 标记节点为可调度 drain 清空节点以准备维护 taint 更新一个或者多个节点上的污点Troubleshooting and Debugging Commands: describe 显示特定资源或资源组的详细信息 ...
kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi kubectl set serviceaccount deployment nginx-deployment serviceaccount1 -kubectl cp 在local和container之间拷贝文件或目录。 示例: kubectl cp /tmp/foo_dir <some-pod>:/tmp/bar_dir kubectl cp <s...
cluster-info 显示集群信息 top Display Resource (CPU/Memory/Storage) usage. cordon 标记 node 为 unschedulable uncordon 标记 node 为 schedulable drain Drain node in preparation for maintenance taint 更新一个或者多个 node 上的 taints Troubleshooting and Debugging Commands: describe 显示一个指定 resource...
You can also create some aliases that make your command line usage much faster. $ vim ~/.bashrc # kubectl alias alias k='kubectl' # Create resources alias kcf='kubectl create -f' alias kaf='kubectl apply -f' # List resources alias kgp='kubectl get pods' ...
$ kubectl toppods NAME CPU(cores) MEMORY(bytes) postgresql-57578b68d9-6rpt8 1m 22Mi 不错!您可以看到插件正在工作,而且创建kubectl插件并不是很困难。 摘要 在本章中,我们已经学会了如何安装、使用和创建kubectl插件。了解如何使用现有插件扩展kubectl以及如何创建自己的插件是很有用的。 我们已经了解了一些...
cluster-info 显示集群信息 top Display Resource (CPU/Memory/Storage) usage. cordon 标记 node 为 unschedulable uncordon 标记 node 为 schedulable drain Drain node in preparation for maintenance taint 更新一个或者多个 node 上的 taints Troubleshooting and Debugging Commands: describe 显示一个指定 resource...
cluster-info 显示集群信息 top Display Resource (CPU/Memory/Storage) usage. cordon 标记 node 为 unschedulable uncordon 标记 node 为 schedulable drain Drain node in preparation for maintenance taint 更新一个或者多个 node 上的 taints Troubleshooting and Debugging Commands: ...
top Display resource (CPU/memory) usage cordon 标记节点为不可调度 uncordon 标记节点为可调度 drain 清空节点以准备维护 taint 更新一个或者多个节点上的污点 Troubleshooting and Debugging Commands: describe 显示特定资源或资源组的详细信息 logs 打印 Pod 中容器的日志 ...