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
bf7020a9
Commit
bf7020a9
authored
Aug 12, 2016
by
Yu-Ju Hong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRI: remove pod resources
The pod-level resources need further discussion. Remove it from CRI for now.
parent
dfcb649e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
35 deletions
+5
-35
api.pb.go
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
+0
-0
api.proto
pkg/kubelet/api/v1alpha1/runtime/api.proto
+3
-30
docker_sandbox.go
pkg/kubelet/dockershim/docker_sandbox.go
+2
-5
No files found.
pkg/kubelet/api/v1alpha1/runtime/api.pb.go
View file @
bf7020a9
This diff is collapsed.
Click to expand it.
pkg/kubelet/api/v1alpha1/runtime/api.proto
View file @
bf7020a9
...
...
@@ -112,26 +112,6 @@ message Mount {
optional
bool
selinux_relabel
=
5
;
}
// ResourceRequirements contains a set of resources
// Valid resources are:
// - cpu, in cores. (500m = .5 cores)
// - memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
message
ResourceRequirements
{
// The maximum amount of compute resources allowed.
optional
double
limits
=
1
;
// The minimum amount of compute resources required.
// If Request is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value
optional
double
requests
=
2
;
}
// PodSandboxResources contains the CPU/memory resource requirements.
message
PodSandboxResources
{
// CPU resource requirement.
optional
ResourceRequirements
cpu
=
1
;
// Memory resource requirement.
optional
ResourceRequirements
memory
=
2
;
}
// NamespaceOption provides options for Linux namespaces.
message
NamespaceOption
{
// If set, use the host's network namespace.
...
...
@@ -181,20 +161,13 @@ message PodSandboxConfig {
optional
DNSOption
dns_options
=
4
;
// The port mappings for the sandbox.
repeated
PortMapping
port_mappings
=
5
;
// Resources specifies the resource limits for the sandbox (i.e., the
// aggregate cpu/memory resources limits of all containers).
// Note: On a Linux host, kubelet will create a pod-level cgroup and pass
// it as the cgroup parent for the PodSandbox. For some runtimes, this is
// sufficient. For others, e.g., hypervisor-based runtimes, explicit
// resource limits for the sandbox are needed at creation time.
optional
PodSandboxResources
resources
=
6
;
// Labels are key value pairs that may be used to scope and select individual resources.
map
<
string
,
string
>
labels
=
7
;
map
<
string
,
string
>
labels
=
6
;
// Annotations is an unstructured key value map that may be set by external
// tools to store and retrieve arbitrary metadata.
map
<
string
,
string
>
annotations
=
8
;
map
<
string
,
string
>
annotations
=
7
;
// Optional configurations specific to Linux hosts.
optional
LinuxPodSandboxConfig
linux
=
9
;
optional
LinuxPodSandboxConfig
linux
=
8
;
}
message
CreatePodSandboxRequest
{
...
...
pkg/kubelet/dockershim/docker_sandbox.go
View file @
bf7020a9
...
...
@@ -240,7 +240,7 @@ func makeSandboxDockerConfig(c *runtimeApi.PodSandboxConfig, image string) *dock
}
// Apply resource options.
setSandboxResources
(
c
.
GetResources
(),
hc
)
setSandboxResources
(
hc
)
// Set security options.
hc
.
SecurityOpt
=
[]
string
{
getSeccompOpts
()}
...
...
@@ -248,10 +248,7 @@ func makeSandboxDockerConfig(c *runtimeApi.PodSandboxConfig, image string) *dock
return
createConfig
}
func
setSandboxResources
(
_
*
runtimeApi
.
PodSandboxResources
,
hc
*
dockercontainer
.
HostConfig
)
{
// Ignore the resource requests and limits for now and just use the docker
// defaults.
// TODO: apply resource limits based on the configuration.
func
setSandboxResources
(
hc
*
dockercontainer
.
HostConfig
)
{
hc
.
Resources
=
dockercontainer
.
Resources
{
MemorySwap
:
-
1
,
// Always disable memory swap.
CPUShares
:
defaultSandboxCPUshares
,
...
...
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