Documentation ¶
Overview ¶
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func GetAvailableDevices(devices []*LocalDisk) []string
- func GetNodeConfigKey(nodeID string) string
- func GetNodeIDSet(c *Config) *util.Set
- func SetIPAddress(etcdClient etcd.KeysAPI, nodeId, publicIP, privateIP string) error
- func SetLocation(etcdClient etcd.KeysAPI, nodeId, location string) error
- func TriggerClusterHardwareDetection(etcdClient etcd.KeysAPI)
- type Config
- type Disk
- type Hardware
- type LocalDisk
- type NetworkConfig
- type NodeConfig
- type ProcessorConfig
Constants ¶
const ( NodesHealthKey = "/rook/nodes/health" NodesConfigKey = "/rook/nodes/config" TriggerHardwareDetectionKey = "trigger-hardware-detection" )
const (
HeartbeatKey = "heartbeat"
)
Variables ¶
var (
HeartbeatTtlDuration = time.Duration(heartbeatTtlSeconds) * time.Second
)
Functions ¶
func GetAvailableDevices ¶ added in v0.3.0
func GetNodeConfigKey ¶
gets the key under which all node hardware/config will be stored
func SetIPAddress ¶
Set the IP address for a node
Types ¶
type Config ¶
type Config struct { Nodes map[string]*NodeConfig `json:"nodes"` Local *Hardware `json:"local"` }
func CreateConfig ¶
Helper to create a Config with a set of node IDs
type Hardware ¶ added in v0.3.0
type Hardware struct { Disks []*LocalDisk `json:"disks"` Processors []*ProcessorConfig `json:"processors"` NetworkAdapters []*NetworkConfig `json:"networkAdapters"` Memory uint64 `json:"memory"` }
Local hardware info
func DiscoverHardware ¶
Discover all the hardware properties for this node.
func DiscoverHardwareAndStore ¶ added in v0.3.0
func DiscoverHardwareAndStore(etcdClient etcd.KeysAPI, executor exec.Executor, nodeID string) (*Hardware, error)
Discover all the hardware properties for this node. Store the important properties in etcd and more detailed info for the local node in the context.
type LocalDisk ¶ added in v0.3.0
type LocalDisk struct { Name string `json:"name"` ID string `json:"id"` UUID string `json:"uuid"` Size uint64 `json:"size"` Rotational bool `json:"rotational"` Readonly bool `json:"readonly"` FileSystem string `json:"fileSystem"` MountPoint string `json:"mountPoint"` Type string `json:"type"` Parent string `json:"parent"` HasChildren bool `json:"hasChildren"` Empty bool `json:"empty"` }
type NetworkConfig ¶
type NodeConfig ¶
type NodeConfig struct { Disks []*Disk `json:"disks"` Processors []*ProcessorConfig `json:"processors"` NetworkAdapters []*NetworkConfig `json:"networkAdapters"` Memory uint64 `json:"memory"` PublicIP string `json:"publicIp"` PrivateIP string `json:"privateIp"` HeartbeatAge time.Duration `json:"heartbeatAge"` Location string `json:"location"` }
Basic config info for a node in the cluster