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
7b4311e5
Commit
7b4311e5
authored
Dec 11, 2017
by
Davanum Srinivas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kubelet should use the value of the cri container runtime endpoint from cadvisor
parent
6a633378
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
helpers_linux.go
pkg/kubelet/cadvisor/helpers_linux.go
+1
-1
util.go
pkg/kubelet/cadvisor/util.go
+7
-1
No files found.
pkg/kubelet/cadvisor/helpers_linux.go
View file @
7b4311e5
...
@@ -43,7 +43,7 @@ func (i *imageFsInfoProvider) ImageFsInfoLabel() (string, error) {
...
@@ -43,7 +43,7 @@ func (i *imageFsInfoProvider) ImageFsInfoLabel() (string, error) {
// This is a temporary workaround to get stats for cri-o from cadvisor
// This is a temporary workaround to get stats for cri-o from cadvisor
// and should be removed.
// and should be removed.
// Related to https://github.com/kubernetes/kubernetes/issues/51798
// Related to https://github.com/kubernetes/kubernetes/issues/51798
if
i
.
runtimeEndpoint
==
"/var/run/crio.sock"
{
if
i
.
runtimeEndpoint
==
CrioSocket
{
return
cadvisorfs
.
LabelCrioImages
,
nil
return
cadvisorfs
.
LabelCrioImages
,
nil
}
}
}
}
...
...
pkg/kubelet/cadvisor/util.go
View file @
7b4311e5
...
@@ -29,6 +29,12 @@ import (
...
@@ -29,6 +29,12 @@ import (
kubetypes
"k8s.io/kubernetes/pkg/kubelet/types"
kubetypes
"k8s.io/kubernetes/pkg/kubelet/types"
)
)
const
(
// Please keep this in sync with the one in:
// github.com/google/cadvisor/container/crio/client.go
CrioSocket
=
"/var/run/crio/crio.sock"
)
func
CapacityFromMachineInfo
(
info
*
cadvisorapi
.
MachineInfo
)
v1
.
ResourceList
{
func
CapacityFromMachineInfo
(
info
*
cadvisorapi
.
MachineInfo
)
v1
.
ResourceList
{
c
:=
v1
.
ResourceList
{
c
:=
v1
.
ResourceList
{
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
v1
.
ResourceCPU
:
*
resource
.
NewMilliQuantity
(
...
@@ -71,5 +77,5 @@ func EphemeralStorageCapacityFromFsInfo(info cadvisorapi2.FsInfo) v1.ResourceLis
...
@@ -71,5 +77,5 @@ func EphemeralStorageCapacityFromFsInfo(info cadvisorapi2.FsInfo) v1.ResourceLis
func
UsingLegacyCadvisorStats
(
runtime
,
runtimeEndpoint
string
)
bool
{
func
UsingLegacyCadvisorStats
(
runtime
,
runtimeEndpoint
string
)
bool
{
return
runtime
==
kubetypes
.
RktContainerRuntime
||
return
runtime
==
kubetypes
.
RktContainerRuntime
||
(
runtime
==
kubetypes
.
DockerContainerRuntime
&&
goruntime
.
GOOS
==
"linux"
)
||
(
runtime
==
kubetypes
.
DockerContainerRuntime
&&
goruntime
.
GOOS
==
"linux"
)
||
runtimeEndpoint
==
"/var/run/crio.sock"
runtimeEndpoint
==
CrioSocket
}
}
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