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 --sum=false Print the sum of the resource usage
59
60
61 --use-protocol-buffers=true Enables using protocol-buffers to ac‐
62 cess Metrics API.
63
64
65
67 --as="" Username to impersonate for the operation. User could be a
68 regular user or a service account in a namespace.
69
70
71 --as-group=[] Group to impersonate for the operation, this flag
72 can be repeated to specify multiple groups.
73
74
75 --as-uid="" UID to impersonate for the operation.
76
77
78 --azure-container-registry-config="" Path to the file containing
79 Azure container registry configuration information.
80
81
82 --cache-dir="/builddir/.kube/cache" Default cache directory
83
84
85 --certificate-authority="" Path to a cert file for the certificate
86 authority
87
88
89 --client-certificate="" Path to a client certificate file for TLS
90
91
92 --client-key="" Path to a client key file for TLS
93
94
95 --cluster="" The name of the kubeconfig cluster to use
96
97
98 --context="" The name of the kubeconfig context to use
99
100
101 --disable-compression=false If true, opt-out of response compres‐
102 sion for all requests to the server
103
104
105 --insecure-skip-tls-verify=false If true, the server's certificate
106 will not be checked for validity. This will make your HTTPS connections
107 insecure
108
109
110 --kubeconfig="" Path to the kubeconfig file to use for CLI re‐
111 quests.
112
113
114 --match-server-version=false Require server version to match
115 client version
116
117
118 -n, --namespace="" If present, the namespace scope for this CLI
119 request
120
121
122 --password="" Password for basic authentication to the API server
123
124
125 --profile="none" Name of profile to capture. One of
126 (none|cpu|heap|goroutine|threadcreate|block|mutex)
127
128
129 --profile-output="profile.pprof" Name of the file to write the
130 profile to
131
132
133 --request-timeout="0" The length of time to wait before giving up
134 on a single server request. Non-zero values should contain a corre‐
135 sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
136 out requests.
137
138
139 -s, --server="" The address and port of the Kubernetes API server
140
141
142 --tls-server-name="" Server name to use for server certificate
143 validation. If it is not provided, the hostname used to contact the
144 server is used
145
146
147 --token="" Bearer token for authentication to the API server
148
149
150 --user="" The name of the kubeconfig user to use
151
152
153 --username="" Username for basic authentication to the API server
154
155
156 --version=false Print version information and quit
157
158
159 --warnings-as-errors=false Treat warnings received from the server
160 as errors and exit with a non-zero exit code
161
162
163
165 # Show metrics for all pods in the default namespace
166 kubectl top pod
167
168 # Show metrics for all pods in the given namespace
169 kubectl top pod --namespace=NAMESPACE
170
171 # Show metrics for a given pod and its containers
172 kubectl top pod POD_NAME --containers
173
174 # Show metrics for the pods defined by label name=myLabel
175 kubectl top pod -l name=myLabel
176
177
178
179
181 kubectl-top(1),
182
183
184
186 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
187 com) based on the kubernetes source material, but hopefully they have
188 been automatically generated since!
189
190
191
192Manuals User KUBERNETES(1)(kubernetes)