v1alpha2

package
v1.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

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

View Source
const (
	CustomResourceGroup = "rook.io"
	Version             = "v1alpha2"
)
View Source
const (
	KeyAll = "all"
)
View Source
const (
	LocationEnvVarName = "ROOK_LOCATION"
)

Variables

View Source
var (
	// SchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder runtime.SchemeBuilder

	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: rookio.GroupName, Version: Version}

SchemeGroupVersion is group version used to register these objects

Functions

func GetLocationFromContainer

func GetLocationFromContainer(container v1.Container) string

func LocationEnvVar

func LocationEnvVar(location string) v1.EnvVar

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Annotations added in v1.0.0

type Annotations map[string]string

func (Annotations) ApplyToObjectMeta added in v1.0.0

func (a Annotations) ApplyToObjectMeta(t *metav1.ObjectMeta)

ApplyToObjectMeta adds or overwrites if exists annotations to object meta.

func (Annotations) DeepCopy added in v1.0.0

func (in Annotations) DeepCopy() Annotations

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Annotations.

func (Annotations) DeepCopyInto added in v1.0.0

func (in Annotations) DeepCopyInto(out *Annotations)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Annotations) GetMapStringString added in v1.0.0

func (a Annotations) GetMapStringString() map[string]string

GetMapStringString return the Annotations as a

func (Annotations) Merge added in v1.0.0

func (a Annotations) Merge(with Annotations) Annotations

Merge returns an Annotations which results from merging the attributes of the original Annotations with the attributes of the supplied one. The supplied Placement's attributes will override the original ones if defined.

type AnnotationsSpec added in v1.0.0

type AnnotationsSpec map[KeyType]Annotations

func (AnnotationsSpec) All added in v1.0.0

func (a AnnotationsSpec) All() Annotations

func (AnnotationsSpec) DeepCopy added in v1.0.0

func (in AnnotationsSpec) DeepCopy() AnnotationsSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AnnotationsSpec.

func (AnnotationsSpec) DeepCopyInto added in v1.0.0

func (in AnnotationsSpec) DeepCopyInto(out *AnnotationsSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

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            `json:"fullpath,omitempty"`
	Config   map[string]string `json:"config"`
}

func (*Device) DeepCopy

func (in *Device) DeepCopy() *Device

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Device.

func (*Device) DeepCopyInto

func (in *Device) DeepCopyInto(out *Device)

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

func (in *Directory) DeepCopy() *Directory

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Directory.

func (*Directory) DeepCopyInto

func (in *Directory) DeepCopyInto(out *Directory)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type KeyType added in v1.0.0

type KeyType string

KeyType

type NetworkSpec

type NetworkSpec struct {
	// Provider is what provides network connectivity to the cluster e.g. "host" or "multus"
	Provider string `json:"provider"`

	// Selectors string values describe what networks will be used to connect the cluster.
	// Meanwhile the keys describe each network respective responsibilities or any metadata
	// storage provider decide.
	Selectors map[string]string `json:"selectors"`
}

NetworkSpec represents cluster network settings

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.

func (*NetworkSpec) IsHost added in v1.1.0

func (net *NetworkSpec) IsHost() bool

IsHost get whether to use host network provider

func (*NetworkSpec) IsMultus added in v1.1.0

func (net *NetworkSpec) IsMultus() bool

IsMultus get whether to use multus network provider

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

func (in *Node) DeepCopy() *Node

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Node.

func (*Node) DeepCopyInto

func (in *Node) DeepCopyInto(out *Node)

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) DeepCopy added in v0.9.0

func (in NodesByName) DeepCopy() NodesByName

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodesByName.

func (NodesByName) DeepCopyInto added in v0.9.0

func (in NodesByName) DeepCopyInto(out *NodesByName)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

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 (Placement) ApplyToPodSpec

func (p Placement) ApplyToPodSpec(t *v1.PodSpec)

ApplyToPodSpec adds placement to a pod spec

func (*Placement) DeepCopy

func (in *Placement) DeepCopy() *Placement

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Placement.

func (*Placement) DeepCopyInto

func (in *Placement) DeepCopyInto(out *Placement)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (Placement) Merge

func (p Placement) Merge(with Placement) Placement

Merge returns a Placement which results from merging the attributes of the original Placement with the attributes of the supplied one. The supplied Placement's attributes will override the original ones if defined.

type PlacementSpec

type PlacementSpec map[KeyType]Placement

func (PlacementSpec) All

func (p PlacementSpec) All() Placement

func (PlacementSpec) DeepCopy added in v0.9.0

func (in PlacementSpec) DeepCopy() PlacementSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlacementSpec.

func (PlacementSpec) DeepCopyInto added in v0.9.0

func (in PlacementSpec) DeepCopyInto(out *PlacementSpec)

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

func (ResourceSpec) DeepCopy added in v0.9.0

func (in ResourceSpec) DeepCopy() ResourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSpec.

func (ResourceSpec) DeepCopyInto added in v0.9.0

func (in ResourceSpec) DeepCopyInto(out *ResourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

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"`
	// List of devices to use as storage devices
	Devices []Device `json:"devices,omitempty"`
	// List of host directories to use as storage
	Directories []Directory `json:"directories,omitempty"`
	// PersistentVolumeClaims to use as storage
	VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"`
}

func (*Selection) DeepCopy

func (in *Selection) DeepCopy() *Selection

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Selection.

func (*Selection) DeepCopyInto

func (in *Selection) DeepCopyInto(out *Selection)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Selection) GetUseAllDevices

func (s *Selection) GetUseAllDevices() bool

GetUseAllDevices return if all devices should be used.

type StorageClassDeviceSet added in v1.1.0

type StorageClassDeviceSet struct {
	Name                 string                     `json:"name,omitempty"`                 // A unique identifier for the set
	Count                int                        `json:"count,omitempty"`                // Number of devices in this set
	Resources            v1.ResourceRequirements    `json:"resources,omitempty"`            // Requests/limits for the devices
	Placement            Placement                  `json:"placement,omitempty"`            // Placement constraints for the devices
	Config               map[string]string          `json:"config,omitempty"`               // Provider-specific device configuration
	VolumeClaimTemplates []v1.PersistentVolumeClaim `json:"volumeClaimTemplates,omitempty"` // List of PVC templates for the underlying storage devices
	Portable             bool                       `json:"portable,omitempty"`             // OSD portablity across the hosts
}

func (*StorageClassDeviceSet) DeepCopy added in v1.1.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StorageClassDeviceSet.

func (*StorageClassDeviceSet) DeepCopyInto added in v1.1.0

func (in *StorageClassDeviceSet) DeepCopyInto(out *StorageClassDeviceSet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type StorageScopeSpec

type StorageScopeSpec struct {
	Nodes         []Node            `json:"nodes,omitempty"`
	UseAllNodes   bool              `json:"useAllNodes,omitempty"`
	TopologyAware bool              `json:"topologyAware,omitempty"`
	NodeCount     int               `json:"nodeCount,omitempty"`
	Location      string            `json:"location,omitempty"`
	Config        map[string]string `json:"config"`
	Selection
	VolumeSources          []VolumeSource          `json:"volumeSources,omitempty"`
	StorageClassDeviceSets []StorageClassDeviceSet `json:"storageClassDeviceSets"`
}

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) NodeWithNameExists added in v1.0.0

func (s *StorageScopeSpec) NodeWithNameExists(name string) bool

NodeWithNameExists returns true if the storage spec defines a node with the given name.

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 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

func (in *Volume) DeepCopy() *Volume

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Volume.

func (*Volume) DeepCopyInto

func (in *Volume) DeepCopyInto(out *Volume)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Volume) DeepCopyObject

func (in *Volume) DeepCopyObject() runtime.Object

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.

type VolumeSource added in v1.1.0

type VolumeSource struct {
	Name                        string                               `json:"name,omitempty"`
	PersistentVolumeClaimSource v1.PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaimSource,omitempty"`
	Resources                   v1.ResourceRequirements              `json:"resources,omitempty"`
	Placement                   Placement                            `json:"placement,omitempty"`
	Config                      map[string]string                    `json:"config,omitempty"`
	Portable                    bool                                 `json:"portable,omitempty"` // OSD portablity across the hosts
}

func (*VolumeSource) DeepCopy added in v1.1.0

func (in *VolumeSource) DeepCopy() *VolumeSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VolumeSource.

func (*VolumeSource) DeepCopyInto added in v1.1.0

func (in *VolumeSource) DeepCopyInto(out *VolumeSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL