Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add node's IP range cidr to NodeSpec #4456

Merged
merged 1 commit into from
Feb 23, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkg/api/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,9 @@ type EndpointsList struct {
type NodeSpec struct {
// Capacity represents the available resources of a node
Capacity ResourceList `json:"capacity,omitempty"`
// PodCIDR represents the pod IP range assigned to the node
// Note: assigning IP ranges to nodes might need to be revisited when we support migratable IPs.
PodCIDR string `json:"cidr,omitempty"`
}

// NodeStatus is information about the current status of a node.
Expand Down Expand Up @@ -844,7 +847,7 @@ const (
// ResourceList is a set of (resource name, quantity) pairs.
type ResourceList map[ResourceName]resource.Quantity

// Node is a worker node in Kubernetenes
// Node is a worker node in Kubernetes
// The name of the node according to etcd is in ObjectMeta.Name.
type Node struct {
TypeMeta `json:",inline"`
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/v1beta1/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ func init() {
}

out.HostIP = in.Status.HostIP
out.PodCIDR = in.Spec.PodCIDR
return s.Convert(&in.Spec.Capacity, &out.NodeResources.Capacity, 0)
},
func(in *Minion, out *newer.Node, s conversion.Scope) error {
Expand All @@ -718,6 +719,7 @@ func init() {
}

out.Status.HostIP = in.HostIP
out.Spec.PodCIDR = in.PodCIDR
return s.Convert(&in.NodeResources.Capacity, &out.Spec.Capacity, 0)
},
func(in *newer.LimitRange, out *LimitRange, s conversion.Scope) error {
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,8 @@ type Minion struct {
HostIP string `json:"hostIP,omitempty" description:"IP address of the node"`
// Resources available on the node
NodeResources NodeResources `json:"resources,omitempty" description:"characterization of node resources"`
// Pod IP range assigned to the node
PodCIDR string `json:"cidr,omitempty" description:"IP range assigned to the node"`
// Status describes the current status of a node
Status NodeStatus `json:"status,omitempty" description:"current status of node"`
// Labels for the node
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/v1beta2/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ func init() {
}

out.HostIP = in.Status.HostIP
out.PodCIDR = in.Spec.PodCIDR
return s.Convert(&in.Spec.Capacity, &out.NodeResources.Capacity, 0)
},
func(in *Minion, out *newer.Node, s conversion.Scope) error {
Expand All @@ -638,6 +639,7 @@ func init() {
}

out.Status.HostIP = in.HostIP
out.Spec.PodCIDR = in.PodCIDR
return s.Convert(&in.NodeResources.Capacity, &out.Spec.Capacity, 0)
},
func(in *newer.LimitRange, out *LimitRange, s conversion.Scope) error {
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/v1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,8 @@ type Minion struct {
TypeMeta `json:",inline"`
// Queried from cloud provider, if available.
HostIP string `json:"hostIP,omitempty" description:"IP address of the node"`
// Pod IP range assigned to the node
PodCIDR string `json:"cidr,omitempty" description:"IP range assigned to the node"`
// Resources available on the node
NodeResources NodeResources `json:"resources,omitempty" description:"characterization of node resources"`
// Status describes the current status of a node
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/v1beta3/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,8 @@ type NodeSpec struct {
// Capacity represents the available resources of a node
// see https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/resources.md for more details.
Capacity ResourceList `json:"capacity,omitempty"`
// PodCIDR represents the pod IP range assigned to the node
PodCIDR string `json:"cidr,omitempty"`
}

// NodeStatus is information about the current status of a node.
Expand Down