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
13831526
Commit
13831526
authored
Nov 13, 2015
by
derekwaynecarr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve describe for LimitRange resource based on user feedback
parent
5d80d6ef
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
README.md
docs/admin/limitrange/README.md
+6
-6
README.md
docs/admin/resourcequota/README.md
+4
-4
describe.go
pkg/kubectl/describe.go
+4
-4
No files found.
docs/admin/limitrange/README.md
View file @
13831526
...
...
@@ -95,12 +95,12 @@ Let's describe the limits that we have imposed in our namespace.
$
kubectl describe limits mylimits
--namespace
=
limit-example
Name: mylimits
Namespace: limit-example
Type Resource Min Max
Request Limit Limit/Request
---- -------- --- --- -------
-----
-------------
Pod cpu 200m 2 -
-
-
Pod memory 6Mi 1Gi -
-
-
Container cpu 100m 2 200m
300m
-
Container memory 3Mi 1Gi 100Mi
200Mi
-
Type Resource Min Max
Default Request Default Limit Max Limit/Request Ratio
---- -------- --- --- -------
-------- ------------- ----------
-------------
Pod cpu 200m 2 -
-
-
Pod memory 6Mi 1Gi -
-
-
Container cpu 100m 2 200m
300m
-
Container memory 3Mi 1Gi 100Mi
200Mi
-
```
In this scenario, we have said the following:
...
...
docs/admin/resourcequota/README.md
View file @
13831526
...
...
@@ -142,10 +142,10 @@ limitrange "limits" created
$
kubectl describe limits limits
--namespace
=
quota-example
Name: limits
Namespace: quota-example
Type
Resource Min Max Request Limit Limit/Request
----
-------- --- --- ------- -----
-------------
Container
memory - - 256Mi 512Mi
-
Container
cpu - - 100m 200m
-
Type
Resource Min Max Default Request Default Limit Max Limit/Request Ratio
----
-------- --- --- --------------- ------------- ----------
-------------
Container
memory - - 256Mi 512Mi
-
Container
cpu - - 100m 200m
-
```
Now any time a pod is created in this namespace, if it has not specified any resource request/limit, the default
...
...
pkg/kubectl/describe.go
View file @
13831526
...
...
@@ -187,8 +187,8 @@ func DescribeLimitRanges(limitRanges *api.LimitRangeList, w io.Writer) {
fmt
.
Fprint
(
w
,
"No resource limits.
\n
"
)
return
}
fmt
.
Fprintf
(
w
,
"Resource Limits
\n
Type
\t
Resource
\t
Min
\t
Max
\t
Request
\t
Limit
\t
Limit/Request
\n
"
)
fmt
.
Fprintf
(
w
,
" ----
\t
--------
\t
---
\t
---
\t
-------
\t
-----
\t
-------------
\n
"
)
fmt
.
Fprintf
(
w
,
"Resource Limits
\n
Type
\t
Resource
\t
Min
\t
Max
\t
Default Request
\t
Default Limit
\t
Max Limit/Request Ratio
\n
"
)
fmt
.
Fprintf
(
w
,
" ----
\t
--------
\t
---
\t
---
\t
-------
--------
\t
-------------
\t
----------
-------------
\n
"
)
for
_
,
limitRange
:=
range
limitRanges
.
Items
{
for
i
:=
range
limitRange
.
Spec
.
Limits
{
item
:=
limitRange
.
Spec
.
Limits
[
i
]
...
...
@@ -312,8 +312,8 @@ func describeLimitRange(limitRange *api.LimitRange) (string, error) {
return
tabbedString
(
func
(
out
io
.
Writer
)
error
{
fmt
.
Fprintf
(
out
,
"Name:
\t
%s
\n
"
,
limitRange
.
Name
)
fmt
.
Fprintf
(
out
,
"Namespace:
\t
%s
\n
"
,
limitRange
.
Namespace
)
fmt
.
Fprintf
(
out
,
"Type
\t
Resource
\t
Min
\t
Max
\t
Request
\t
Limit
\t
Limit/Request
\n
"
)
fmt
.
Fprintf
(
out
,
"----
\t
--------
\t
---
\t
---
\t
-------
\t
-----
\t
-------------
\n
"
)
fmt
.
Fprintf
(
out
,
"Type
\t
Resource
\t
Min
\t
Max
\t
Default Request
\t
Default Limit
\t
Max Limit/Request Ratio
\n
"
)
fmt
.
Fprintf
(
out
,
"----
\t
--------
\t
---
\t
---
\t
-------
--------
\t
-------------
\t
----------
-------------
\n
"
)
for
i
:=
range
limitRange
.
Spec
.
Limits
{
item
:=
limitRange
.
Spec
.
Limits
[
i
]
maxResources
:=
item
.
Max
...
...
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