Skip to content

Commit

Permalink
Merge pull request kubernetes#35824 from jessfraz/automated-cherry-pi…
Browse files Browse the repository at this point in the history
…ck-of-#35136-kubernetes#35817-origin-release-1.4

Automated cherry pick of kubernetes#35136 kubernetes#35817
  • Loading branch information
jessfraz authored Oct 28, 2016
2 parents 86fb30b + 6462113 commit b31f1f8
Show file tree
Hide file tree
Showing 27 changed files with 439 additions and 305 deletions.
166 changes: 83 additions & 83 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions cluster/gce/config-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,7 @@ HAIRPIN_MODE="${HAIRPIN_MODE:-promiscuous-bridge}" # promiscuous-bridge, hairpin
E2E_STORAGE_TEST_ENVIRONMENT=${KUBE_E2E_STORAGE_TEST_ENVIRONMENT:-false}

# Evict pods whenever compute resource availability on the nodes gets below a threshold.
# TODO: Get rid of the conditionals once https://github.com/kubernetes/kubernetes/issues/33444 is resolved.
if [[ "${NODE_OS_DISTRIBUTION}" == "debian" ]]; then
EVICTION_HARD="${EVICTION_HARD:-memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%}"
else
EVICTION_HARD="${EVICTION_HARD:-memory.available<100Mi,imagefs.available<10%,imagefs.inodesFree<5%}"
fi
EVICTION_HARD="${EVICTION_HARD:-memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%}"

# Optional: custom scheduling algorithm
SCHEDULING_ALGORITHM_PROVIDER="${SCHEDULING_ALGORITHM_PROVIDER:-}"
7 changes: 1 addition & 6 deletions cluster/gce/config-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,7 @@ E2E_STORAGE_TEST_ENVIRONMENT=${KUBE_E2E_STORAGE_TEST_ENVIRONMENT:-false}
PREPULL_E2E_IMAGES="${PREPULL_E2E_IMAGES:-true}"

# Evict pods whenever compute resource availability on the nodes gets below a threshold.
# TODO: Get rid of the conditionals once https://github.com/kubernetes/kubernetes/issues/33444 is resolved.
if [[ "${NODE_OS_DISTRIBUTION}" == "debian" ]]; then
EVICTION_HARD="${EVICTION_HARD:-memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%}"
else
EVICTION_HARD="${EVICTION_HARD:-memory.available<100Mi,imagefs.available<10%,imagefs.inodesFree<5%}"
fi
EVICTION_HARD="${EVICTION_HARD:-memory.available<100Mi,nodefs.available<10%,nodefs.inodesFree<5%}"

# Optional: custom scheduling algorithm
SCHEDULING_ALGORITHM_PROVIDER="${SCHEDULING_ALGORITHM_PROVIDER:-}"
2 changes: 1 addition & 1 deletion cmd/kubelet/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.KubeletDeps) (err error) {
}

if kubeDeps.CAdvisorInterface == nil {
kubeDeps.CAdvisorInterface, err = cadvisor.New(uint(s.CAdvisorPort), s.ContainerRuntime)
kubeDeps.CAdvisorInterface, err = cadvisor.New(uint(s.CAdvisorPort), s.ContainerRuntime, s.RootDirectory)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/mesos/pkg/executor/service/cadvisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type MesosCadvisor struct {
}

func NewMesosCadvisor(cores int, mem uint64, port uint, runtime string) (*MesosCadvisor, error) {
c, err := cadvisor.New(port, runtime)
c, err := cadvisor.New(port, runtime, "/var/lib/mesos")
if err != nil {
return nil, err
}
Expand Down
12 changes: 7 additions & 5 deletions pkg/kubelet/cadvisor/cadvisor_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ import (
)

type cadvisorClient struct {
runtime string
runtime string
rootPath string
manager.Manager
}

Expand Down Expand Up @@ -93,7 +94,7 @@ func containerLabels(c *cadvisorapi.ContainerInfo) map[string]string {
}

// New creates a cAdvisor and exports its API on the specified port if port > 0.
func New(port uint, runtime string) (Interface, error) {
func New(port uint, runtime string, rootPath string) (Interface, error) {
sysFs, err := sysfs.NewRealSysFs()
if err != nil {
return nil, err
Expand All @@ -106,8 +107,9 @@ func New(port uint, runtime string) (Interface, error) {
}

cadvisorClient := &cadvisorClient{
runtime: runtime,
Manager: m,
runtime: runtime,
rootPath: rootPath,
Manager: m,
}

err = cadvisorClient.exportHTTP(port)
Expand Down Expand Up @@ -202,7 +204,7 @@ func (cc *cadvisorClient) ImagesFsInfo() (cadvisorapiv2.FsInfo, error) {
}

func (cc *cadvisorClient) RootFsInfo() (cadvisorapiv2.FsInfo, error) {
return cc.getFsInfo(cadvisorfs.LabelSystemRoot)
return cc.GetDirFsInfo(cc.rootPath)
}

func (cc *cadvisorClient) getFsInfo(label string) (cadvisorapiv2.FsInfo, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kubelet/cadvisor/cadvisor_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type cadvisorUnsupported struct {

var _ Interface = new(cadvisorUnsupported)

func New(port uint, runtime string) (Interface, error) {
func New(port uint, runtime string, rootPath string) (Interface, error) {
return &cadvisorUnsupported{}, nil
}

Expand Down
Loading

0 comments on commit b31f1f8

Please sign in to comment.