Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7964708

Browse files
authored
Merge pull request #35824 from jessfraz/automated-cherry-pick-of-#35136-#35817-origin-release-1.4
Automated cherry pick of #35136 #35817
2 parents b7ad318 + e945501 commit 7964708

27 files changed

Lines changed: 439 additions & 305 deletions

File tree

Godeps/Godeps.json

Lines changed: 83 additions & 83 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cluster/gce/config-default.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,7 @@ HAIRPIN_MODE="${HAIRPIN_MODE:-promiscuous-bridge}" # promiscuous-bridge, hairpin
161161
E2E_STORAGE_TEST_ENVIRONMENT=${KUBE_E2E_STORAGE_TEST_ENVIRONMENT:-false}
162162

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

171166
# Optional: custom scheduling algorithm
172167
SCHEDULING_ALGORITHM_PROVIDER="${SCHEDULING_ALGORITHM_PROVIDER:-}"

cluster/gce/config-test.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,7 @@ E2E_STORAGE_TEST_ENVIRONMENT=${KUBE_E2E_STORAGE_TEST_ENVIRONMENT:-false}
196196
PREPULL_E2E_IMAGES="${PREPULL_E2E_IMAGES:-true}"
197197

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

206201
# Optional: custom scheduling algorithm
207202
SCHEDULING_ALGORITHM_PROVIDER="${SCHEDULING_ALGORITHM_PROVIDER:-}"

cmd/kubelet/app/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.KubeletDeps) (err error) {
395395
}
396396

397397
if kubeDeps.CAdvisorInterface == nil {
398-
kubeDeps.CAdvisorInterface, err = cadvisor.New(uint(s.CAdvisorPort), s.ContainerRuntime)
398+
kubeDeps.CAdvisorInterface, err = cadvisor.New(uint(s.CAdvisorPort), s.ContainerRuntime, s.RootDirectory)
399399
if err != nil {
400400
return err
401401
}

contrib/mesos/pkg/executor/service/cadvisor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type MesosCadvisor struct {
2929
}
3030

3131
func NewMesosCadvisor(cores int, mem uint64, port uint, runtime string) (*MesosCadvisor, error) {
32-
c, err := cadvisor.New(port, runtime)
32+
c, err := cadvisor.New(port, runtime, "/var/lib/mesos")
3333
if err != nil {
3434
return nil, err
3535
}

pkg/kubelet/cadvisor/cadvisor_linux.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ import (
4040
)
4141

4242
type cadvisorClient struct {
43-
runtime string
43+
runtime string
44+
rootPath string
4445
manager.Manager
4546
}
4647

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

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

108109
cadvisorClient := &cadvisorClient{
109-
runtime: runtime,
110-
Manager: m,
110+
runtime: runtime,
111+
rootPath: rootPath,
112+
Manager: m,
111113
}
112114

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

204206
func (cc *cadvisorClient) RootFsInfo() (cadvisorapiv2.FsInfo, error) {
205-
return cc.getFsInfo(cadvisorfs.LabelSystemRoot)
207+
return cc.GetDirFsInfo(cc.rootPath)
206208
}
207209

208210
func (cc *cadvisorClient) getFsInfo(label string) (cadvisorapiv2.FsInfo, error) {

pkg/kubelet/cadvisor/cadvisor_unsupported.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type cadvisorUnsupported struct {
3131

3232
var _ Interface = new(cadvisorUnsupported)
3333

34-
func New(port uint, runtime string) (Interface, error) {
34+
func New(port uint, runtime string, rootPath string) (Interface, error) {
3535
return &cadvisorUnsupported{}, nil
3636
}
3737

0 commit comments

Comments
 (0)