Documentation ¶
Index ¶
- func New() csitypes.Controller
- type Nodes
- func (nodes *Nodes) GetNodeByName(nodeName string) (*cnsvsphere.VirtualMachine, error)
- func (nodes *Nodes) GetSharedDatastoresForVMs(ctx context.Context, nodeVMs []*cnsvsphere.VirtualMachine) ([]*cnsvsphere.DatastoreInfo, error)
- func (nodes *Nodes) GetSharedDatastoresInK8SCluster(ctx context.Context) ([]*cnsvsphere.DatastoreInfo, error)
- func (nodes *Nodes) GetSharedDatastoresInTopology(ctx context.Context, topologyRequirement *csi.TopologyRequirement, ...) ([]*cnsvsphere.DatastoreInfo, map[string][]map[string]string, error)
- func (nodes *Nodes) Initialize() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Nodes ¶
type Nodes struct {
// contains filtered or unexported fields
}
Nodes is the type comprising cns node manager and kubernetes informer
func (*Nodes) GetNodeByName ¶
func (nodes *Nodes) GetNodeByName(nodeName string) (*cnsvsphere.VirtualMachine, error)
GetNodeByName returns VirtualMachine object for given nodeName This is called by ControllerPublishVolume and ControllerUnpublishVolume to perform attach and detach operations.
func (*Nodes) GetSharedDatastoresForVMs ¶
func (nodes *Nodes) GetSharedDatastoresForVMs(ctx context.Context, nodeVMs []*cnsvsphere.VirtualMachine) ([]*cnsvsphere.DatastoreInfo, error)
GetSharedDatastoresForVMs returns shared datastores accessible to specified nodeVMs list
func (*Nodes) GetSharedDatastoresInK8SCluster ¶
func (nodes *Nodes) GetSharedDatastoresInK8SCluster(ctx context.Context) ([]*cnsvsphere.DatastoreInfo, error)
GetSharedDatastoresInK8SCluster returns list of DatastoreInfo objects for datastores accessible to all kubernetes nodes in the cluster.
func (*Nodes) GetSharedDatastoresInTopology ¶
func (nodes *Nodes) GetSharedDatastoresInTopology(ctx context.Context, topologyRequirement *csi.TopologyRequirement, zoneCategoryName string, regionCategoryName string) ([]*cnsvsphere.DatastoreInfo, map[string][]map[string]string, error)
GetSharedDatastoresInTopology returns shared accessible datastores for specified topologyRequirement along with the map of datastore URL and array of accessibleTopology map for each datastore returned from this function. Here in this function, argument topologyRequirement can be passed in following form topologyRequirement [requisite:<segments:<key:"failure-domain.beta.kubernetes.io/region" value:"k8s-region-us" >
segments:<key:"failure-domain.beta.kubernetes.io/zone" value:"k8s-zone-us-east" > > requisite:<segments:<key:"failure-domain.beta.kubernetes.io/region" value:"k8s-region-us" > segments:<key:"failure-domain.beta.kubernetes.io/zone" value:"k8s-zone-us-west" > > preferred:<segments:<key:"failure-domain.beta.kubernetes.io/region" value:"k8s-region-us" > segments:<key:"failure-domain.beta.kubernetes.io/zone" value:"k8s-zone-us-west" > > preferred:<segments:<key:"failure-domain.beta.kubernetes.io/region" value:"k8s-region-us" > segments:<key:"failure-domain.beta.kubernetes.io/zone" value:"k8s-zone-us-east" > > ]
Return map datastoreTopologyMap looks like as below map[ ds:///vmfs/volumes/5d119112-7b28fe05-f51d-02000b3a3f4b/:
[map[failure-domain.beta.kubernetes.io/region:k8s-region-us failure-domain.beta.kubernetes.io/zone:k8s-zone-us-east]] ds:///vmfs/volumes/e54abc3f-f6a5bb1f-0000-000000000000/: [map[failure-domain.beta.kubernetes.io/region:k8s-region-us failure-domain.beta.kubernetes.io/zone:k8s-zone-us-east]] ds:///vmfs/volumes/vsan:524fae1aaca129a5-1ee55a87f26ae626/: [map[failure-domain.beta.kubernetes.io/region:k8s-region-us failure-domain.beta.kubernetes.io/zone:k8s-zone-us-west] map[failure-domain.beta.kubernetes.io/region:k8s-region-us failure-domain.beta.kubernetes.io/zone:k8s-zone-us-east]]]]
func (*Nodes) Initialize ¶
Initialize helps initialize node manager and node informer manager