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
a43a039e
Commit
a43a039e
authored
Feb 20, 2015
by
Deyuan Deng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Admission doc cleanup
parent
22cbfc4d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
26 deletions
+26
-26
admission_control.md
docs/design/admission_control.md
+3
-3
admission_control_limit_range.md
docs/design/admission_control_limit_range.md
+10
-10
admission_control_resource_quota.md
docs/design/admission_control_resource_quota.md
+13
-13
No files found.
docs/design/admission_control.md
View file @
a43a039e
# Kubernetes Proposal - Admission Control
# Kubernetes Proposal - Admission Control
**Related PR:**
**Related PR:**
| Topic | Link |
| Topic | Link |
| ----- | ---- |
| ----- | ---- |
...
@@ -35,7 +35,7 @@ The kube-apiserver takes the following OPTIONAL arguments to enable admission co
...
@@ -35,7 +35,7 @@ The kube-apiserver takes the following OPTIONAL arguments to enable admission co
An
**AdmissionControl**
plug-in is an implementation of the following interface:
An
**AdmissionControl**
plug-in is an implementation of the following interface:
```
```
go
package
admission
package
admission
// Attributes is an interface used by a plug-in to make an admission decision on a individual request.
// Attributes is an interface used by a plug-in to make an admission decision on a individual request.
...
@@ -57,7 +57,7 @@ type Interface interface {
...
@@ -57,7 +57,7 @@ type Interface interface {
A
**plug-in**
must be compiled with the binary, and is registered as an available option by providing a name, and implementation
A
**plug-in**
must be compiled with the binary, and is registered as an available option by providing a name, and implementation
of admission.Interface.
of admission.Interface.
```
```
go
func
init
()
{
func
init
()
{
admission
.
RegisterPlugin
(
"AlwaysDeny"
,
func
(
client
client
.
Interface
,
config
io
.
Reader
)
(
admission
.
Interface
,
error
)
{
return
NewAlwaysDeny
(),
nil
})
admission
.
RegisterPlugin
(
"AlwaysDeny"
,
func
(
client
client
.
Interface
,
config
io
.
Reader
)
(
admission
.
Interface
,
error
)
{
return
NewAlwaysDeny
(),
nil
})
}
}
...
...
docs/design/admission_control_limit_range.md
View file @
a43a039e
...
@@ -9,7 +9,7 @@ This document proposes a system for enforcing min/max limits per resource as par
...
@@ -9,7 +9,7 @@ This document proposes a system for enforcing min/max limits per resource as par
A new resource,
**LimitRange**
, is introduced to enumerate min/max limits for a resource type scoped to a
A new resource,
**LimitRange**
, is introduced to enumerate min/max limits for a resource type scoped to a
Kubernetes namespace.
Kubernetes namespace.
```
```
go
const
(
const
(
// Limit that applies to all pods in a namespace
// Limit that applies to all pods in a namespace
LimitTypePod
string
=
"Pod"
LimitTypePod
string
=
"Pod"
...
@@ -54,7 +54,7 @@ type LimitRangeList struct {
...
@@ -54,7 +54,7 @@ type LimitRangeList struct {
## AdmissionControl plugin: LimitRanger
## AdmissionControl plugin: LimitRanger
The
**LimitRanger**
plug-in introspects all incoming admission requests.
The
**LimitRanger**
plug-in introspects all incoming admission requests.
It makes decisions by evaluating the incoming object against all defined
**LimitRange**
objects in the request context namespace.
It makes decisions by evaluating the incoming object against all defined
**LimitRange**
objects in the request context namespace.
...
@@ -97,20 +97,20 @@ kubectl is modified to support the **LimitRange** resource.
...
@@ -97,20 +97,20 @@ kubectl is modified to support the **LimitRange** resource.
For example,
For example,
```
```
shell
$ kubectl namespace myspace
$ kubectl namespace myspace
$ kubectl create -f examples/limitrange/limit-range.json
$ kubectl create -f examples/limitrange/limit-range.json
$ kubectl get limits
$ kubectl get limits
NAME
NAME
limits
limits
$ kubectl describe limits limits
$ kubectl describe limits limits
Name: limits
Name:
limits
Type
Resource Min
Max
Type
Resource Min
Max
----
-------- ---
---
----
-------- ---
---
Pod
memory 1Mi
1Gi
Pod
memory 1Mi
1Gi
Pod
cpu 250m
2
Pod
cpu 250m
2
Container
cpu 250m 2
Container
memory 1Mi 1Gi
Container
memory 1Mi 1Gi
Container
cpu 250m 2
```
```
## Future Enhancements: Define limits for a particular pod or container.
## Future Enhancements: Define limits for a particular pod or container.
...
...
docs/design/admission_control_resource_quota.md
View file @
a43a039e
...
@@ -10,7 +10,7 @@ A new resource, **ResourceQuota**, is introduced to enumerate hard resource limi
...
@@ -10,7 +10,7 @@ A new resource, **ResourceQuota**, is introduced to enumerate hard resource limi
A new resource,
**ResourceQuotaUsage**
, is introduced to support atomic updates of a
**ResourceQuota**
status.
A new resource,
**ResourceQuotaUsage**
, is introduced to support atomic updates of a
**ResourceQuota**
status.
```
```
go
// The following identify resource constants for Kubernetes object types
// The following identify resource constants for Kubernetes object types
const
(
const
(
// Pods, number
// Pods, number
...
@@ -139,14 +139,15 @@ $ kubectl namespace myspace
...
@@ -139,14 +139,15 @@ $ kubectl namespace myspace
$ kubectl create -f examples/resourcequota/resource-quota.json
$ kubectl create -f examples/resourcequota/resource-quota.json
$ kubectl get quota
$ kubectl get quota
NAME
NAME
myquota
quota
$ kubectl describe quota myquota
$ kubectl describe quota quota
Name: myquota
Name: quota
Resource Used Hard
Resource Used Hard
-------- ---- ----
-------- ---- ----
cpu 100m 20
cpu 0m 20
memory 0 1.5Gb
memory 0 1Gi
pods 1 10
pods 5 10
replicationControllers 1 10
replicationcontrollers 5 20
services 2 3
resourcequotas 1 1
```
services 3 5
\ No newline at end of file
```
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