Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
2adecd04
Unverified
Commit
2adecd04
authored
Sep 27, 2018
by
k8s-ci-robot
Committed by
GitHub
Sep 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #63485 from lovejoy/addPodAgeToDescribeNode
add pod age to describe node
parents
807eb6b2
d022cc8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
describe.go
pkg/printers/internalversion/describe.go
+4
-4
No files found.
pkg/printers/internalversion/describe.go
View file @
2adecd04
...
@@ -3093,8 +3093,8 @@ func describeHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, e
...
@@ -3093,8 +3093,8 @@ func describeHorizontalPodAutoscaler(hpa *autoscaling.HorizontalPodAutoscaler, e
func
describeNodeResource
(
nodeNonTerminatedPodsList
*
api
.
PodList
,
node
*
api
.
Node
,
w
PrefixWriter
)
{
func
describeNodeResource
(
nodeNonTerminatedPodsList
*
api
.
PodList
,
node
*
api
.
Node
,
w
PrefixWriter
)
{
w
.
Write
(
LEVEL_0
,
"Non-terminated Pods:
\t
(%d in total)
\n
"
,
len
(
nodeNonTerminatedPodsList
.
Items
))
w
.
Write
(
LEVEL_0
,
"Non-terminated Pods:
\t
(%d in total)
\n
"
,
len
(
nodeNonTerminatedPodsList
.
Items
))
w
.
Write
(
LEVEL_1
,
"Namespace
\t
Name
\t\t
CPU Requests
\t
CPU Limits
\t
Memory Requests
\t
Memory Limits
\n
"
)
w
.
Write
(
LEVEL_1
,
"Namespace
\t
Name
\t\t
CPU Requests
\t
CPU Limits
\t
Memory Requests
\t
Memory Limits
\
t
AGE
\
n
"
)
w
.
Write
(
LEVEL_1
,
"---------
\t
----
\t\t
------------
\t
----------
\t
---------------
\t
-------------
\n
"
)
w
.
Write
(
LEVEL_1
,
"---------
\t
----
\t\t
------------
\t
----------
\t
---------------
\t
-------------
\
t
---
\
n
"
)
allocatable
:=
node
.
Status
.
Capacity
allocatable
:=
node
.
Status
.
Capacity
if
len
(
node
.
Status
.
Allocatable
)
>
0
{
if
len
(
node
.
Status
.
Allocatable
)
>
0
{
allocatable
=
node
.
Status
.
Allocatable
allocatable
=
node
.
Status
.
Allocatable
...
@@ -3107,9 +3107,9 @@ func describeNodeResource(nodeNonTerminatedPodsList *api.PodList, node *api.Node
...
@@ -3107,9 +3107,9 @@ func describeNodeResource(nodeNonTerminatedPodsList *api.PodList, node *api.Node
fractionCpuLimit
:=
float64
(
cpuLimit
.
MilliValue
())
/
float64
(
allocatable
.
Cpu
()
.
MilliValue
())
*
100
fractionCpuLimit
:=
float64
(
cpuLimit
.
MilliValue
())
/
float64
(
allocatable
.
Cpu
()
.
MilliValue
())
*
100
fractionMemoryReq
:=
float64
(
memoryReq
.
Value
())
/
float64
(
allocatable
.
Memory
()
.
Value
())
*
100
fractionMemoryReq
:=
float64
(
memoryReq
.
Value
())
/
float64
(
allocatable
.
Memory
()
.
Value
())
*
100
fractionMemoryLimit
:=
float64
(
memoryLimit
.
Value
())
/
float64
(
allocatable
.
Memory
()
.
Value
())
*
100
fractionMemoryLimit
:=
float64
(
memoryLimit
.
Value
())
/
float64
(
allocatable
.
Memory
()
.
Value
())
*
100
w
.
Write
(
LEVEL_1
,
"%s
\t
%s
\t\t
%s (%d%%)
\t
%s (%d%%)
\t
%s (%d%%)
\t
%s (%d%%)
\n
"
,
pod
.
Namespace
,
pod
.
Name
,
w
.
Write
(
LEVEL_1
,
"%s
\t
%s
\t\t
%s (%d%%)
\t
%s (%d%%)
\t
%s (%d%%)
\t
%s (%d%%)
\
t
%s
\
n
"
,
pod
.
Namespace
,
pod
.
Name
,
cpuReq
.
String
(),
int64
(
fractionCpuReq
),
cpuLimit
.
String
(),
int64
(
fractionCpuLimit
),
cpuReq
.
String
(),
int64
(
fractionCpuReq
),
cpuLimit
.
String
(),
int64
(
fractionCpuLimit
),
memoryReq
.
String
(),
int64
(
fractionMemoryReq
),
memoryLimit
.
String
(),
int64
(
fractionMemoryLimit
))
memoryReq
.
String
(),
int64
(
fractionMemoryReq
),
memoryLimit
.
String
(),
int64
(
fractionMemoryLimit
)
,
translateTimestampSince
(
pod
.
CreationTimestamp
)
)
}
}
w
.
Write
(
LEVEL_0
,
"Allocated resources:
\n
(Total limits may be over 100 percent, i.e., overcommitted.)
\n
"
)
w
.
Write
(
LEVEL_0
,
"Allocated resources:
\n
(Total limits may be over 100 percent, i.e., overcommitted.)
\n
"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment