diff --git a/pkg/api/types.go b/pkg/api/types.go index 9409fc809d2..7ec98b4b2bd 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -788,6 +788,14 @@ type NodeSpec struct { ExternalID string `json:"externalID,omitempty"` } +// NodeSystemInfo is a set of ids/uuids to uniquely identify the node. +type NodeSystemInfo struct { + // MachineID is the machine-id reported by the node + MachineID string `json:"machineID"` + // SystemUUID is the system-uuid reported by the node + SystemUUID string `json:"systemUUID"` +} + // NodeStatus is information about the current status of a node. type NodeStatus struct { // NodePhase is the current lifecycle phase of the node. @@ -796,6 +804,8 @@ type NodeStatus struct { Conditions []NodeCondition `json:"conditions,omitempty"` // Queried from cloud provider, if available. Addresses []NodeAddress `json:"addresses,omitempty"` + // NodeSystemInfo is a set of ids/uuids to uniquely identify the node + NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty"` } // NodeInfo is the information collected on the node. @@ -803,6 +813,8 @@ type NodeInfo struct { TypeMeta `json:",inline"` // Capacity represents the available resources of a node Capacity ResourceList `json:"capacity,omitempty"` + // NodeSystemInfo is a set of ids/uuids to uniquely identify the node + NodeSystemInfo `json:",inline,omitempty"` } type NodePhase string diff --git a/pkg/api/v1beta1/conversion.go b/pkg/api/v1beta1/conversion.go index 46ec4a9e8c0..fa76a6f5a1e 100644 --- a/pkg/api/v1beta1/conversion.go +++ b/pkg/api/v1beta1/conversion.go @@ -699,6 +699,9 @@ func init() { if err := s.Convert(&in.Status.Addresses, &out.Status.Addresses, 0); err != nil { return err } + if err := s.Convert(&in.Status.NodeInfo, &out.Status.NodeInfo, 0); err != nil { + return err + } for _, address := range in.Status.Addresses { if address.Type == newer.NodeLegacyHostIP { @@ -728,6 +731,9 @@ func init() { if err := s.Convert(&in.Status.Addresses, &out.Status.Addresses, 0); err != nil { return err } + if err := s.Convert(&in.Status.NodeInfo, &out.Status.NodeInfo, 0); err != nil { + return err + } if in.HostIP != "" { newer.AddToNodeAddresses(&out.Status.Addresses, diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index c4183a9d7b9..8a47ece6d98 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -618,6 +618,14 @@ type EndpointsList struct { Items []Endpoints `json:"items" description:"list of service endpoint lists"` } +// NodeSystemInfo is a set of ids/uuids to uniquely identify the node. +type NodeSystemInfo struct { + // MachineID is the machine-id reported by the node + MachineID string `json:"machineID" description:"machine id is the machine-id reported by the node"` + // SystemUUID is the system-uuid reported by the node + SystemUUID string `json:"systemUUID" description:"system uuid is the system-uuid reported by the node"` +} + // NodeStatus is information about the current status of a node. type NodeStatus struct { // NodePhase is the current lifecycle phase of the node. @@ -626,6 +634,8 @@ type NodeStatus struct { Conditions []NodeCondition `json:"conditions,omitempty" description:"conditions is an array of current node conditions"` // Queried from cloud provider, if available. Addresses []NodeAddress `json:"addresses,omitempty" description:"list of addresses reachable to the node"` + // NodeSystemInfo is a set of ids/uuids to uniquely identify the node + NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty" description:"node identity is a set of ids/uuids to uniquely identify the node"` } // NodeInfo is the information collected on the node. @@ -633,6 +643,8 @@ type NodeInfo struct { TypeMeta `json:",inline"` // Capacity represents the available resources. Capacity ResourceList `json:"capacity,omitempty" description:"resource capacity of a node represented as a map of resource name to quantity of resource"` + // NodeSystemInfo is a set of ids/uuids to uniquely identify the node + NodeSystemInfo `json:",inline,omitempty" description:"node identity is a set of ids/uuids to uniquely identify the node"` } type NodePhase string diff --git a/pkg/api/v1beta2/conversion.go b/pkg/api/v1beta2/conversion.go index effc0e3e664..6291496c449 100644 --- a/pkg/api/v1beta2/conversion.go +++ b/pkg/api/v1beta2/conversion.go @@ -619,6 +619,9 @@ func init() { if err := s.Convert(&in.Status.Addresses, &out.Status.Addresses, 0); err != nil { return err } + if err := s.Convert(&in.Status.NodeInfo, &out.Status.NodeInfo, 0); err != nil { + return err + } for _, address := range in.Status.Addresses { if address.Type == newer.NodeLegacyHostIP { @@ -648,6 +651,9 @@ func init() { if err := s.Convert(&in.Status.Addresses, &out.Status.Addresses, 0); err != nil { return err } + if err := s.Convert(&in.Status.NodeInfo, &out.Status.NodeInfo, 0); err != nil { + return err + } if in.HostIP != "" { newer.AddToNodeAddresses(&out.Status.Addresses, diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index a85db7b7c8b..3b32f4d9499 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -623,6 +623,14 @@ type EndpointsList struct { Items []Endpoints `json:"items" description:"list of service endpoint lists"` } +// NodeSystemInfo is a set of ids/uuids to uniquely identify the node. +type NodeSystemInfo struct { + // MachineID is the machine-id reported by the node + MachineID string `json:"machineID" description:"machine id is the machine-id reported by the node"` + // SystemUUID is the system-uuid reported by the node + SystemUUID string `json:"systemUUID" description:"system uuid is the system-uuid reported by the node"` +} + // NodeStatus is information about the current status of a node. // // https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/node.md#node-status @@ -633,6 +641,8 @@ type NodeStatus struct { Conditions []NodeCondition `json:"conditions,omitempty" description:"conditions is an array of current node conditions"` // Queried from cloud provider, if available. Addresses []NodeAddress `json:"addresses,omitempty" description:"list of addresses reachable to the node"` + // NodeSystemInfo is a set of ids/uuids to uniquely identify the node + NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty" description:"node identity is a set of ids/uuids to uniquely identify the node"` } // NodeInfo is the information collected on the node. @@ -640,6 +650,8 @@ type NodeInfo struct { TypeMeta `json:",inline"` // Capacity represents the available resources. Capacity ResourceList `json:"capacity,omitempty" description:"resource capacity of a node represented as a map of resource name to quantity of resource"` + // NodeSystemInfo is a set of ids/uuids to uniquely identify the node + NodeSystemInfo `json:",inline,omitempty" description:"node identity is a set of ids/uuids to uniquely identify the node"` } // Described the current lifecycle phase of a node. diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 51e5583405b..079ed83d083 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -819,6 +819,14 @@ type NodeSpec struct { ExternalID string `json:"externalID,omitempty" description:"external ID assigned to the node by some machine database (e.g. a cloud provider)"` } +// NodeSystemInfo is a set of ids/uuids to uniquely identify the node. +type NodeSystemInfo struct { + // MachineID is the machine-id reported by the node + MachineID string `json:"machineID"` + // SystemUUID is the system-uuid reported by the node + SystemUUID string `json:"systemUUID"` +} + // NodeStatus is information about the current status of a node. type NodeStatus struct { // NodePhase is the current lifecycle phase of the node. @@ -827,6 +835,8 @@ type NodeStatus struct { Conditions []NodeCondition `json:"conditions,omitempty" description:"list of node conditions observed"` // Queried from cloud provider, if available. Addresses []NodeAddress `json:"addresses,omitempty" description:"list of addresses reachable to the node"` + // NodeSystemInfo is a set of ids/uuids to uniquely identify the node + NodeInfo NodeSystemInfo `json:"nodeInfo,omitempty"` } // NodeInfo is the information collected on the node. @@ -834,6 +844,8 @@ type NodeInfo struct { TypeMeta `json:",inline"` // Capacity represents the available resources of a node Capacity ResourceList `json:"capacity,omitempty"` + // NodeSystemInfo is a set of ids/uuids to uniquely identify the node + NodeSystemInfo `json:",inline,omitempty"` } type NodePhase string diff --git a/pkg/cloudprovider/controller/nodecontroller.go b/pkg/cloudprovider/controller/nodecontroller.go index 1421e886286..0f8992df399 100644 --- a/pkg/cloudprovider/controller/nodecontroller.go +++ b/pkg/cloudprovider/controller/nodecontroller.go @@ -329,6 +329,7 @@ func (s *NodeController) updateNodeInfo(node *api.Node) error { for key, value := range nodeInfo.Capacity { node.Spec.Capacity[key] = value } + node.Status.NodeInfo = nodeInfo.NodeSystemInfo return nil } diff --git a/pkg/kubelet/server.go b/pkg/kubelet/server.go index 4d2feb8394d..b481fe59520 100644 --- a/pkg/kubelet/server.go +++ b/pkg/kubelet/server.go @@ -361,6 +361,10 @@ func (s *Server) handleNodeInfoVersioned(w http.ResponseWriter, req *http.Reques } data, err := json.Marshal(api.NodeInfo{ Capacity: capacity, + NodeSystemInfo: api.NodeSystemInfo{ + MachineID: info.MachineID, + SystemUUID: info.SystemUUID, + }, }) if err != nil { s.error(w, err)