1KUBERNETES(1)(kubernetes) KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7
9 kubectl top pod - Display resource (CPU/memory) usage of pods
10
11
12
14 kubectl top pod [OPTIONS]
15
16
17
19 Display resource (CPU/memory) usage of pods.
20
21
22 The 'top pod' command allows you to see the resource consumption of
23 pods.
24
25
26 Due to the metrics pipeline delay, they may be unavailable for a few
27 minutes since pod creation.
28
29
30
32 -A, --all-namespaces=false If present, list the requested ob‐
33 ject(s) across all namespaces. Namespace in current context is ignored
34 even if specified with --namespace.
35
36
37 --containers=false If present, print usage of containers within a
38 pod.
39
40
41 --field-selector="" Selector (field query) to filter on, supports
42 '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2).
43 The server only supports a limited number of field queries per type.
44
45
46 --no-headers=false If present, print output without headers.
47
48
49 -l, --selector="" Selector (label query) to filter on, supports
50 '=', '==', and '!='.(e.g. -l key1=value1,key2=value2). Matching objects
51 must satisfy all of the specified label constraints.
52
53
54 --sort-by="" If non-empty, sort pods list using specified field.
55 The field can be either 'cpu' or 'memory'.
56
57
58 --use-protocol-buffers=true Enables using protocol-buffers to ac‐
59 cess Metrics API.
60
61
62
64 --as="" Username to impersonate for the operation. User could be a
65 regular user or a service account in a namespace.
66
67
68 --as-group=[] Group to impersonate for the operation, this flag
69 can be repeated to specify multiple groups.
70
71
72 --as-uid="" UID to impersonate for the operation.
73
74
75 --azure-container-registry-config="" Path to the file containing
76 Azure container registry configuration information.
77
78
79 --cache-dir="/builddir/.kube/cache" Default cache directory
80
81
82 --certificate-authority="" Path to a cert file for the certificate
83 authority
84
85
86 --client-certificate="" Path to a client certificate file for TLS
87
88
89 --client-key="" Path to a client key file for TLS
90
91
92 --cluster="" The name of the kubeconfig cluster to use
93
94
95 --context="" The name of the kubeconfig context to use
96
97
98 --insecure-skip-tls-verify=false If true, the server's certificate
99 will not be checked for validity. This will make your HTTPS connections
100 insecure
101
102
103 --kubeconfig="" Path to the kubeconfig file to use for CLI re‐
104 quests.
105
106
107 --match-server-version=false Require server version to match
108 client version
109
110
111 -n, --namespace="" If present, the namespace scope for this CLI
112 request
113
114
115 --password="" Password for basic authentication to the API server
116
117
118 --profile="none" Name of profile to capture. One of
119 (none|cpu|heap|goroutine|threadcreate|block|mutex)
120
121
122 --profile-output="profile.pprof" Name of the file to write the
123 profile to
124
125
126 --request-timeout="0" The length of time to wait before giving up
127 on a single server request. Non-zero values should contain a corre‐
128 sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
129 out requests.
130
131
132 -s, --server="" The address and port of the Kubernetes API server
133
134
135 --tls-server-name="" Server name to use for server certificate
136 validation. If it is not provided, the hostname used to contact the
137 server is used
138
139
140 --token="" Bearer token for authentication to the API server
141
142
143 --user="" The name of the kubeconfig user to use
144
145
146 --username="" Username for basic authentication to the API server
147
148
149 --version=false Print version information and quit
150
151
152 --warnings-as-errors=false Treat warnings received from the server
153 as errors and exit with a non-zero exit code
154
155
156
158 # Show metrics for all pods in the default namespace
159 kubectl top pod
160
161 # Show metrics for all pods in the given namespace
162 kubectl top pod --namespace=NAMESPACE
163
164 # Show metrics for a given pod and its containers
165 kubectl top pod POD_NAME --containers
166
167 # Show metrics for the pods defined by label name=myLabel
168 kubectl top pod -l name=myLabel
169
170
171
172
174 kubectl-top(1),
175
176
177
179 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
180 com) based on the kubernetes source material, but hopefully they have
181 been automatically generated since!
182
183
184
185Manuals User KUBERNETES(1)(kubernetes)