Update godeps
This commit is contained in:
parent
8b25cc67a5
commit
a736fba0e1
769 changed files with 15495 additions and 7996 deletions
2
vendor/k8s.io/kubernetes/pkg/kubelet/qos/doc.go
generated
vendored
2
vendor/k8s.io/kubernetes/pkg/kubelet/qos/doc.go
generated
vendored
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2015 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
|
|||
9
vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go
generated
vendored
9
vendor/k8s.io/kubernetes/pkg/kubelet/qos/policy.go
generated
vendored
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2015 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
@ -18,7 +18,6 @@ package qos
|
|||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/kubelet/qos/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -36,11 +35,11 @@ const (
|
|||
// and 1000. Containers with higher OOM scores are killed if the system runs out of memory.
|
||||
// See https://lwn.net/Articles/391222/ for more information.
|
||||
func GetContainerOOMScoreAdjust(pod *api.Pod, container *api.Container, memoryCapacity int64) int {
|
||||
switch util.GetPodQos(pod) {
|
||||
case util.Guaranteed:
|
||||
switch GetPodQOS(pod) {
|
||||
case Guaranteed:
|
||||
// Guaranteed containers should be the last to get killed.
|
||||
return guaranteedOOMScoreAdj
|
||||
case util.BestEffort:
|
||||
case BestEffort:
|
||||
return besteffortOOMScoreAdj
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2015 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2015 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
|
@ -14,19 +14,13 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
package util
|
||||
package qos
|
||||
|
||||
import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/resource"
|
||||
)
|
||||
|
||||
const (
|
||||
Guaranteed = "Guaranteed"
|
||||
Burstable = "Burstable"
|
||||
BestEffort = "BestEffort"
|
||||
)
|
||||
|
||||
// isResourceGuaranteed returns true if the container's resource requirements are Guaranteed.
|
||||
func isResourceGuaranteed(container *api.Container, resource api.ResourceName) bool {
|
||||
// A container resource is guaranteed if its request == limit.
|
||||
|
|
@ -47,11 +41,11 @@ func isResourceBestEffort(container *api.Container, resource api.ResourceName) b
|
|||
return !hasReq || req.Value() == 0
|
||||
}
|
||||
|
||||
// GetPodQos returns the QoS class of a pod.
|
||||
// GetPodQOS returns the QoS class of a pod.
|
||||
// A pod is besteffort if none of its containers have specified any requests or limits.
|
||||
// A pod is guaranteed only when requests and limits are specified for all the containers and they are equal.
|
||||
// A pod is burstable if limits and requests do not match across all containers.
|
||||
func GetPodQos(pod *api.Pod) string {
|
||||
func GetPodQOS(pod *api.Pod) QOSClass {
|
||||
requests := api.ResourceList{}
|
||||
limits := api.ResourceList{}
|
||||
zeroQuantity := resource.MustParse("0")
|
||||
|
|
@ -105,23 +99,23 @@ func GetPodQos(pod *api.Pod) string {
|
|||
return Burstable
|
||||
}
|
||||
|
||||
// QoSList is a set of (resource name, QoS class) pairs.
|
||||
type QoSList map[api.ResourceName]string
|
||||
// QOSList is a set of (resource name, QoS class) pairs.
|
||||
type QOSList map[api.ResourceName]QOSClass
|
||||
|
||||
// GetQoS returns a mapping of resource name to QoS class of a container
|
||||
func GetQoS(container *api.Container) QoSList {
|
||||
resourceToQoS := QoSList{}
|
||||
// GetQOS returns a mapping of resource name to QoS class of a container
|
||||
func GetQOS(container *api.Container) QOSList {
|
||||
resourceToQOS := QOSList{}
|
||||
for resource := range allResources(container) {
|
||||
switch {
|
||||
case isResourceGuaranteed(container, resource):
|
||||
resourceToQoS[resource] = Guaranteed
|
||||
resourceToQOS[resource] = Guaranteed
|
||||
case isResourceBestEffort(container, resource):
|
||||
resourceToQoS[resource] = BestEffort
|
||||
resourceToQOS[resource] = BestEffort
|
||||
default:
|
||||
resourceToQoS[resource] = Burstable
|
||||
resourceToQOS[resource] = Burstable
|
||||
}
|
||||
}
|
||||
return resourceToQoS
|
||||
return resourceToQOS
|
||||
}
|
||||
|
||||
// supportedComputeResources is the list of supported compute resources
|
||||
29
vendor/k8s.io/kubernetes/pkg/kubelet/qos/types.go
generated
vendored
Normal file
29
vendor/k8s.io/kubernetes/pkg/kubelet/qos/types.go
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package qos
|
||||
|
||||
// QOSClass defines the supported qos classes of Pods/Containers.
|
||||
type QOSClass string
|
||||
|
||||
const (
|
||||
// Guaranteed is the Guaranteed qos class.
|
||||
Guaranteed QOSClass = "Guaranteed"
|
||||
// Burstable is the Burstable qos class.
|
||||
Burstable QOSClass = "Burstable"
|
||||
// BestEffort is the BestEffort qos class.
|
||||
BestEffort QOSClass = "BestEffort"
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue