Documentation ¶
Overview ¶
Copyright 2018 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.
Package v1alpha2 is the v1alpha2 version of the rook.io API. +groupName=rook.io
Copyright 2018 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 2018 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 2018 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 2018 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 GetLocationFromContainer(container v1.Container) string
- func LocationEnvVar(location string) v1.EnvVar
- func Resource(resource string) schema.GroupResource
- type Attachment
- type Device
- type Directory
- type NetworkSpec
- type Node
- type NodesByName
- type Placement
- type PlacementSpec
- type PortSpec
- type ResourceSpec
- type Selection
- type StorageScopeSpec
- func (s *StorageScopeSpec) AnyUseAllDevices() bool
- func (s *StorageScopeSpec) ClearUseAllDevices()
- func (in *StorageScopeSpec) DeepCopy() *StorageScopeSpec
- func (in *StorageScopeSpec) DeepCopyInto(out *StorageScopeSpec)
- func (in *StorageScopeSpec) DeepCopyObject() runtime.Object
- func (s *StorageScopeSpec) ResolveNode(nodeName string) *Node
- type Volume
- type VolumeList
Constants ¶
const ( CustomResourceGroup = "rook.io" Version = "v1alpha2" )
const (
LocationEnvVarName = "ROOK_LOCATION"
)
const (
PlacementKeyAll = "all"
)
Variables ¶
var ( // SchemeBuilder and AddToScheme will stay in k8s.io/kubernetes. SchemeBuilder runtime.SchemeBuilder AddToScheme = localSchemeBuilder.AddToScheme )
var SchemeGroupVersion = schema.GroupVersion{Group: rookio.GroupName, Version: Version}
SchemeGroupVersion is group version used to register these objects
Functions ¶
func LocationEnvVar ¶
func Resource ¶
func Resource(resource string) schema.GroupResource
Resource takes an unqualified resource and returns a Group qualified GroupResource
Types ¶
type Attachment ¶
type Attachment struct { Node string `json:"node"` PodNamespace string `json:"podNamespace"` PodName string `json:"podName"` ClusterName string `json:"clusterName"` MountDir string `json:"mountDir"` ReadOnly bool `json:"readOnly"` }
func (*Attachment) DeepCopy ¶
func (in *Attachment) DeepCopy() *Attachment
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Attachment.
func (*Attachment) DeepCopyInto ¶
func (in *Attachment) DeepCopyInto(out *Attachment)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Device ¶
type Device struct { Name string `json:"name,omitempty"` FullPath string // TODO: FullPath to be supported for devices Config map[string]string `json:"config"` }
func (*Device) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device.
func (*Device) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Directory ¶
type Directory struct { Path string `json:"path,omitempty"` Config map[string]string `json:"config"` }
func (*Directory) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Directory.
func (*Directory) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NetworkSpec ¶
type NetworkSpec struct { metav1.TypeMeta `json:",inline"` // HostNetwork to enable host network HostNetwork bool `json:"hostNetwork"` // Set of named ports that can be configured for this resource Ports []PortSpec `json:"ports,omitempty"` }
func (*NetworkSpec) DeepCopy ¶
func (in *NetworkSpec) DeepCopy() *NetworkSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkSpec.
func (*NetworkSpec) DeepCopyInto ¶
func (in *NetworkSpec) DeepCopyInto(out *NetworkSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Node ¶
type Node struct { Name string `json:"name,omitempty"` Location string `json:"location,omitempty"` Resources v1.ResourceRequirements `json:"resources,omitempty"` Config map[string]string `json:"config"` Selection }
func (*Node) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node.
func (*Node) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type NodesByName ¶
type NodesByName []Node
NodesByName implements an interface to sort nodes by name
func (NodesByName) Len ¶
func (s NodesByName) Len() int
func (NodesByName) Less ¶
func (s NodesByName) Less(i, j int) bool
func (NodesByName) Swap ¶
func (s NodesByName) Swap(i, j int)
type Placement ¶
type Placement struct { NodeAffinity *v1.NodeAffinity `json:"nodeAffinity,omitempty"` PodAffinity *v1.PodAffinity `json:"podAffinity,omitempty"` PodAntiAffinity *v1.PodAntiAffinity `json:"podAntiAffinity,omitempty"` Tolerations []v1.Toleration `json:"tolerations,omitempty"` }
func ConvertLegacyPlacement ¶
func ConvertLegacyPlacement(legacyPlacement rookv1alpha1.Placement) Placement
ConvertLegacyPlacement takes a legacy rookv1alpha1 Placement object and converts it to a current rookv1alpha2 Placement object.
func (Placement) ApplyToPodSpec ¶
ApplyToPodSpec adds placement to a pod spec
func (*Placement) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Placement.
func (*Placement) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PlacementSpec ¶
func (PlacementSpec) All ¶
func (p PlacementSpec) All() Placement
type PortSpec ¶
func (*PortSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PortSpec.
func (*PortSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ResourceSpec ¶
type ResourceSpec map[string]v1.ResourceRequirements
type Selection ¶
type Selection struct { // Whether to consume all the storage devices found on a machine UseAllDevices *bool `json:"useAllDevices,omitempty"` // A regular expression to allow more fine-grained selection of devices on nodes across the cluster DeviceFilter string `json:"deviceFilter,omitempty"` Devices []Device `json:"devices,omitempty"` Directories []Directory `json:"directories,omitempty"` }
func (*Selection) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Selection.
func (*Selection) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Selection) GetUseAllDevices ¶
type StorageScopeSpec ¶
type StorageScopeSpec struct { metav1.TypeMeta `json:",inline"` Nodes []Node `json:"nodes,omitempty"` UseAllNodes bool `json:"useAllNodes,omitempty"` NodeCount int `json:"nodeCount,omitempty"` Location string `json:"location,omitempty"` Config map[string]string `json:"config"` Selection }
func (*StorageScopeSpec) AnyUseAllDevices ¶
func (s *StorageScopeSpec) AnyUseAllDevices() bool
AnyUseAllDevices gets whether to use all devices
func (*StorageScopeSpec) ClearUseAllDevices ¶
func (s *StorageScopeSpec) ClearUseAllDevices()
ClearUseAllDevices clears all devices
func (*StorageScopeSpec) DeepCopy ¶
func (in *StorageScopeSpec) DeepCopy() *StorageScopeSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageScopeSpec.
func (*StorageScopeSpec) DeepCopyInto ¶
func (in *StorageScopeSpec) DeepCopyInto(out *StorageScopeSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*StorageScopeSpec) DeepCopyObject ¶
func (in *StorageScopeSpec) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*StorageScopeSpec) ResolveNode ¶
func (s *StorageScopeSpec) ResolveNode(nodeName string) *Node
Fully resolves the config of the given node name, taking into account cluster level and node level specified config. In general, the more fine grained the configuration is specified, the more precedence it takes. Fully resolved configuration for the node has the following order of precedence. 1) Node (config defined on the node itself) 2) Cluster (config defined on the cluster) 3) Default values (if no config exists for the node or cluster)
type Volume ¶
type Volume struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata"` Attachments []Attachment `json:"attachments"` }
func ConvertLegacyVolume ¶
func ConvertLegacyVolume(legacyVolume rookv1alpha1.VolumeAttachment) *Volume
ConvertLegacyVolume takes a legacy rookv1alpha1 VolumeAttacment object and converts it to a current rookv1alpha2 Volume object.
func NewVolume ¶
func NewVolume(name, namespace, node, podNamespace, podName, clusterName, mountDir string, readOnly bool) *Volume
NewVolume creates a reference of a Volumeattach CRD object
func (*Volume) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Volume.
func (*Volume) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Volume) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type VolumeList ¶
type VolumeList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []Volume `json:"items"` }
func (*VolumeList) DeepCopy ¶
func (in *VolumeList) DeepCopy() *VolumeList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeList.
func (*VolumeList) DeepCopyInto ¶
func (in *VolumeList) DeepCopyInto(out *VolumeList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*VolumeList) DeepCopyObject ¶
func (in *VolumeList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.