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
c28524fb
Commit
c28524fb
authored
May 10, 2016
by
Lucas Käldström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add operatingsystem/architecture as node labels. Also, display that in status
parent
dee24333
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
3 deletions
+34
-3
types.go
pkg/api/types.go
+4
-0
well_known_labels.go
pkg/api/unversioned/well_known_labels.go
+3
-0
types.go
pkg/api/v1/types.go
+4
-0
describe.go
pkg/kubectl/describe.go
+2
-0
kubelet.go
pkg/kubelet/kubelet.go
+15
-3
kubelet_test.go
pkg/kubelet/kubelet_test.go
+6
-0
No files found.
pkg/api/types.go
View file @
c28524fb
...
@@ -1830,6 +1830,10 @@ type NodeSystemInfo struct {
...
@@ -1830,6 +1830,10 @@ type NodeSystemInfo struct {
KubeletVersion
string
`json:"kubeletVersion"`
KubeletVersion
string
`json:"kubeletVersion"`
// KubeProxy Version reported by the node.
// KubeProxy Version reported by the node.
KubeProxyVersion
string
`json:"kubeProxyVersion"`
KubeProxyVersion
string
`json:"kubeProxyVersion"`
// The Operating System reported by the node
OperatingSystem
string
`json:"operatingSystem"`
// The Architecture reported by the node
Architecture
string
`json:"architecture"`
}
}
// NodeStatus is information about the current status of a node.
// NodeStatus is information about the current status of a node.
...
...
pkg/api/unversioned/well_known_labels.go
View file @
c28524fb
...
@@ -24,4 +24,7 @@ const (
...
@@ -24,4 +24,7 @@ const (
LabelZoneRegion
=
"failure-domain.beta.kubernetes.io/region"
LabelZoneRegion
=
"failure-domain.beta.kubernetes.io/region"
LabelInstanceType
=
"beta.kubernetes.io/instance-type"
LabelInstanceType
=
"beta.kubernetes.io/instance-type"
LabelOS
=
"beta.kubernetes.io/os"
LabelArch
=
"beta.kubernetes.io/arch"
)
)
pkg/api/v1/types.go
View file @
c28524fb
...
@@ -2206,6 +2206,10 @@ type NodeSystemInfo struct {
...
@@ -2206,6 +2206,10 @@ type NodeSystemInfo struct {
KubeletVersion
string
`json:"kubeletVersion" protobuf:"bytes,7,opt,name=kubeletVersion"`
KubeletVersion
string
`json:"kubeletVersion" protobuf:"bytes,7,opt,name=kubeletVersion"`
// KubeProxy Version reported by the node.
// KubeProxy Version reported by the node.
KubeProxyVersion
string
`json:"kubeProxyVersion" protobuf:"bytes,8,opt,name=kubeProxyVersion"`
KubeProxyVersion
string
`json:"kubeProxyVersion" protobuf:"bytes,8,opt,name=kubeProxyVersion"`
// The Operating System reported by the node
OperatingSystem
string
`json:"operatingSystem" protobuf:"bytes,9,opt,name=operatingSystem"`
// The Architecture reported by the node
Architecture
string
`json:"architecture" protobuf:"bytes,10,opt,name=architecture"`
}
}
// NodeStatus is information about the current status of a node.
// NodeStatus is information about the current status of a node.
...
...
pkg/kubectl/describe.go
View file @
c28524fb
...
@@ -1638,6 +1638,8 @@ func describeNode(node *api.Node, nodeNonTerminatedPodsList *api.PodList, events
...
@@ -1638,6 +1638,8 @@ func describeNode(node *api.Node, nodeNonTerminatedPodsList *api.PodList, events
fmt
.
Fprintf
(
out
,
" Boot ID:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
BootID
)
fmt
.
Fprintf
(
out
,
" Boot ID:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
BootID
)
fmt
.
Fprintf
(
out
,
" Kernel Version:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
KernelVersion
)
fmt
.
Fprintf
(
out
,
" Kernel Version:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
KernelVersion
)
fmt
.
Fprintf
(
out
,
" OS Image:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
OSImage
)
fmt
.
Fprintf
(
out
,
" OS Image:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
OSImage
)
fmt
.
Fprintf
(
out
,
" Operating System:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
OperatingSystem
)
fmt
.
Fprintf
(
out
,
" Architecture:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
Architecture
)
fmt
.
Fprintf
(
out
,
" Container Runtime Version:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
ContainerRuntimeVersion
)
fmt
.
Fprintf
(
out
,
" Container Runtime Version:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
ContainerRuntimeVersion
)
fmt
.
Fprintf
(
out
,
" Kubelet Version:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
KubeletVersion
)
fmt
.
Fprintf
(
out
,
" Kubelet Version:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
KubeletVersion
)
fmt
.
Fprintf
(
out
,
" Kube-Proxy Version:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
KubeProxyVersion
)
fmt
.
Fprintf
(
out
,
" Kube-Proxy Version:
\t
%s
\n
"
,
node
.
Status
.
NodeInfo
.
KubeProxyVersion
)
...
...
pkg/kubelet/kubelet.go
View file @
c28524fb
...
@@ -26,6 +26,7 @@ import (
...
@@ -26,6 +26,7 @@ import (
"os"
"os"
"path"
"path"
"path/filepath"
"path/filepath"
goRuntime
"runtime"
"sort"
"sort"
"strings"
"strings"
"sync"
"sync"
...
@@ -963,8 +964,12 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) {
...
@@ -963,8 +964,12 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) {
func
(
kl
*
Kubelet
)
initialNodeStatus
()
(
*
api
.
Node
,
error
)
{
func
(
kl
*
Kubelet
)
initialNodeStatus
()
(
*
api
.
Node
,
error
)
{
node
:=
&
api
.
Node
{
node
:=
&
api
.
Node
{
ObjectMeta
:
api
.
ObjectMeta
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
kl
.
nodeName
,
Name
:
kl
.
nodeName
,
Labels
:
map
[
string
]
string
{
unversioned
.
LabelHostname
:
kl
.
hostname
},
Labels
:
map
[
string
]
string
{
unversioned
.
LabelHostname
:
kl
.
hostname
,
unversioned
.
LabelOS
:
goRuntime
.
GOOS
,
unversioned
.
LabelArch
:
goRuntime
.
GOARCH
,
},
},
},
Spec
:
api
.
NodeSpec
{
Spec
:
api
.
NodeSpec
{
Unschedulable
:
!
kl
.
registerSchedulable
,
Unschedulable
:
!
kl
.
registerSchedulable
,
...
@@ -3006,7 +3011,7 @@ func (kl *Kubelet) setNodeStatusDaemonEndpoints(node *api.Node) {
...
@@ -3006,7 +3011,7 @@ func (kl *Kubelet) setNodeStatusDaemonEndpoints(node *api.Node) {
node
.
Status
.
DaemonEndpoints
=
*
kl
.
daemonEndpoints
node
.
Status
.
DaemonEndpoints
=
*
kl
.
daemonEndpoints
}
}
// Set images list fo
t this
node
// Set images list fo
r the
node
func
(
kl
*
Kubelet
)
setNodeStatusImages
(
node
*
api
.
Node
)
{
func
(
kl
*
Kubelet
)
setNodeStatusImages
(
node
*
api
.
Node
)
{
// Update image list of this node
// Update image list of this node
var
imagesOnNode
[]
api
.
ContainerImage
var
imagesOnNode
[]
api
.
ContainerImage
...
@@ -3024,12 +3029,19 @@ func (kl *Kubelet) setNodeStatusImages(node *api.Node) {
...
@@ -3024,12 +3029,19 @@ func (kl *Kubelet) setNodeStatusImages(node *api.Node) {
node
.
Status
.
Images
=
imagesOnNode
node
.
Status
.
Images
=
imagesOnNode
}
}
// Set the GOOS and GOARCH for this node
func
(
kl
*
Kubelet
)
setNodeStatusGoRuntime
(
node
*
api
.
Node
)
{
node
.
Status
.
NodeInfo
.
OperatingSystem
=
goRuntime
.
GOOS
node
.
Status
.
NodeInfo
.
Architecture
=
goRuntime
.
GOARCH
}
// Set status for the node.
// Set status for the node.
func
(
kl
*
Kubelet
)
setNodeStatusInfo
(
node
*
api
.
Node
)
{
func
(
kl
*
Kubelet
)
setNodeStatusInfo
(
node
*
api
.
Node
)
{
kl
.
setNodeStatusMachineInfo
(
node
)
kl
.
setNodeStatusMachineInfo
(
node
)
kl
.
setNodeStatusVersionInfo
(
node
)
kl
.
setNodeStatusVersionInfo
(
node
)
kl
.
setNodeStatusDaemonEndpoints
(
node
)
kl
.
setNodeStatusDaemonEndpoints
(
node
)
kl
.
setNodeStatusImages
(
node
)
kl
.
setNodeStatusImages
(
node
)
kl
.
setNodeStatusGoRuntime
(
node
)
}
}
// Set Readycondition for the node.
// Set Readycondition for the node.
...
...
pkg/kubelet/kubelet_test.go
View file @
c28524fb
...
@@ -2566,6 +2566,8 @@ func TestUpdateNewNodeStatus(t *testing.T) {
...
@@ -2566,6 +2566,8 @@ func TestUpdateNewNodeStatus(t *testing.T) {
BootID
:
"1b3"
,
BootID
:
"1b3"
,
KernelVersion
:
"3.16.0-0.bpo.4-amd64"
,
KernelVersion
:
"3.16.0-0.bpo.4-amd64"
,
OSImage
:
"Debian GNU/Linux 7 (wheezy)"
,
OSImage
:
"Debian GNU/Linux 7 (wheezy)"
,
OperatingSystem
:
"linux"
,
Architecture
:
"amd64"
,
ContainerRuntimeVersion
:
"test://1.5.0"
,
ContainerRuntimeVersion
:
"test://1.5.0"
,
KubeletVersion
:
version
.
Get
()
.
String
(),
KubeletVersion
:
version
.
Get
()
.
String
(),
KubeProxyVersion
:
version
.
Get
()
.
String
(),
KubeProxyVersion
:
version
.
Get
()
.
String
(),
...
@@ -2797,6 +2799,8 @@ func TestUpdateExistingNodeStatus(t *testing.T) {
...
@@ -2797,6 +2799,8 @@ func TestUpdateExistingNodeStatus(t *testing.T) {
BootID
:
"1b3"
,
BootID
:
"1b3"
,
KernelVersion
:
"3.16.0-0.bpo.4-amd64"
,
KernelVersion
:
"3.16.0-0.bpo.4-amd64"
,
OSImage
:
"Debian GNU/Linux 7 (wheezy)"
,
OSImage
:
"Debian GNU/Linux 7 (wheezy)"
,
OperatingSystem
:
"linux"
,
Architecture
:
"amd64"
,
ContainerRuntimeVersion
:
"test://1.5.0"
,
ContainerRuntimeVersion
:
"test://1.5.0"
,
KubeletVersion
:
version
.
Get
()
.
String
(),
KubeletVersion
:
version
.
Get
()
.
String
(),
KubeProxyVersion
:
version
.
Get
()
.
String
(),
KubeProxyVersion
:
version
.
Get
()
.
String
(),
...
@@ -3068,6 +3072,8 @@ func TestUpdateNodeStatusWithRuntimeStateError(t *testing.T) {
...
@@ -3068,6 +3072,8 @@ func TestUpdateNodeStatusWithRuntimeStateError(t *testing.T) {
BootID
:
"1b3"
,
BootID
:
"1b3"
,
KernelVersion
:
"3.16.0-0.bpo.4-amd64"
,
KernelVersion
:
"3.16.0-0.bpo.4-amd64"
,
OSImage
:
"Debian GNU/Linux 7 (wheezy)"
,
OSImage
:
"Debian GNU/Linux 7 (wheezy)"
,
OperatingSystem
:
"linux"
,
Architecture
:
"amd64"
,
ContainerRuntimeVersion
:
"test://1.5.0"
,
ContainerRuntimeVersion
:
"test://1.5.0"
,
KubeletVersion
:
version
.
Get
()
.
String
(),
KubeletVersion
:
version
.
Get
()
.
String
(),
KubeProxyVersion
:
version
.
Get
()
.
String
(),
KubeProxyVersion
:
version
.
Get
()
.
String
(),
...
...
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