Documentation ¶
Overview ¶
This file transforms a Nomad scheduler as an orchestration platform for persistent volume placement. OpenEBS calls this as placement of storage pod.
Package nomad provides Nomad implementation of orchestration provider that aligns by the interfaces suggested by mayaserver's orchprovider.
This file plugs the following:
- Generic orchprovider &
- Nomad orchprovider
Index ¶
- func JobEvalToPv(jobName string, eval *api.Evaluation) (*v1.Volume, error)
- func JobToPv(job *api.Job) (*v1.Volume, error)
- func MakeJob(name string) (*api.Job, error)
- func NewNomadOrchestrator(label v1.NameLabel, name v1.OrchProviderRegistry) (orchprovider.OrchestratorInterface, error)
- func VolToJob(vol *v1.Volume) (*api.Job, error)
- func VolToJobName(vol *v1.Volume) (string, error)
- type NomadApiInterface
- type NomadClients
- type NomadOrchestrator
- func (n *NomadOrchestrator) AddStorage(volProProfile volProfile.VolumeProvisionerProfile) (*v1.Volume, error)
- func (n *NomadOrchestrator) DeleteStorage(volProProfile volProfile.VolumeProvisionerProfile) (bool, error)
- func (n *NomadOrchestrator) Label() string
- func (n *NomadOrchestrator) ListStorage(volProProfile volProfile.VolumeProvisionerProfile) (*v1.VolumeList, error)
- func (n *NomadOrchestrator) Name() string
- func (n *NomadOrchestrator) ReadStorage(volProProfile volProfile.VolumeProvisionerProfile) (*v1.Volume, error)
- func (n *NomadOrchestrator) Region() string
- func (n *NomadOrchestrator) StorageOps() (orchprovider.StorageOps, bool)
- type NomadUtilInterface
- type StorageApis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JobEvalToPv ¶
JobEvalToPv Transform the evaluation of a job to a PersistentVolume
func NewNomadOrchestrator ¶
func NewNomadOrchestrator(label v1.NameLabel, name v1.OrchProviderRegistry) (orchprovider.OrchestratorInterface, error)
NewNomadOrchestrator provides a new instance of NomadOrchestrator. This is invoked during binary startup. func NewNomadOrchestrator(name v1.OrchProviderRegistry, region string, config io.Reader) (orchprovider.OrchestratorInterface, error) {
Types ¶
type NomadApiInterface ¶
type NomadApiInterface interface { // Name of the Nomad API implementor Name() string // This returns a concrete implementation of StorageApis StorageApis() (StorageApis, bool) }
NomadApiInterface provides a means to issue APIs against a Nomad cluster. These APIs are futher categorized into Networking & Storage specific APIs.
type NomadClients ¶
type NomadClients interface { // Http returns the http client that is capable to communicate // with Nomad Http(profileMap map[string]string) (*api.Client, error) }
NomadClients is an abstraction over various connection modes (http, rpc) to Nomad. Http client is currently supported.
NOTE:
This abstraction makes use of Nomad's api package. Nomad's api
package provides:
1. http client abstraction & 2. structures that can send http requests to Nomad's APIs.
type NomadOrchestrator ¶
type NomadOrchestrator struct {
// contains filtered or unexported fields
}
NomadOrchestrator is a concrete representation of following interfaces:
- orchprovider.OrchestratorInterface, &
- orchprovider.StoragePlacements
func (*NomadOrchestrator) AddStorage ¶
func (n *NomadOrchestrator) AddStorage(volProProfile volProfile.VolumeProvisionerProfile) (*v1.Volume, error)
AddStorage will add persistent volume running as containers. In OpenEBS terms AddStorage will add a VSM.
func (*NomadOrchestrator) DeleteStorage ¶
func (n *NomadOrchestrator) DeleteStorage(volProProfile volProfile.VolumeProvisionerProfile) (bool, error)
DeleteStorage will remove the VSM.
func (*NomadOrchestrator) Label ¶
func (n *NomadOrchestrator) Label() string
Label provides the label assigned against this orchestrator. This is used along with Name() method. This is an implementation of the orchprovider.OrchestratorInterface interface.
func (*NomadOrchestrator) ListStorage ¶
func (n *NomadOrchestrator) ListStorage(volProProfile volProfile.VolumeProvisionerProfile) (*v1.VolumeList, error)
ListStorage will list a collections of VSMs
func (*NomadOrchestrator) Name ¶
func (n *NomadOrchestrator) Name() string
Name provides the name of this orchestrator. This is an implementation of the orchprovider.OrchestratorInterface interface.
func (*NomadOrchestrator) ReadStorage ¶
func (n *NomadOrchestrator) ReadStorage(volProProfile volProfile.VolumeProvisionerProfile) (*v1.Volume, error)
ReadStorage will fetch information about the persistent volume
func (*NomadOrchestrator) Region ¶
func (n *NomadOrchestrator) Region() string
Region provides the region where this orchestrator is running. This is an implementation of the orchprovider.OrchestratorInterface interface.
func (*NomadOrchestrator) StorageOps ¶
func (n *NomadOrchestrator) StorageOps() (orchprovider.StorageOps, bool)
StorageOps deals with storage related operations e.g. scheduling, placements, removal, etc. of persistent volume containers. The low level workings are delegated to the orchestration provider.
NOTE:
This is orchestration provider's implementation of
orchprovider.OrchestratorInterface interface.
type NomadUtilInterface ¶
type NomadUtilInterface interface { // Name of nomad utility Name() string // This is a builder for NomadClients interface. Will return // false if not supported. NomadClients() (NomadClients, bool) }
NomadUtilInterface is an abstraction over Hashicorp's Nomad properties & communication utilities.
type StorageApis ¶
type StorageApis interface { // Create makes a request to Nomad to create a storage resource CreateStorage(job *api.Job, profileMap map[string]string) (*api.Evaluation, error) // Delete makes a request to Nomad to delete the storage resource DeleteStorage(job *api.Job, profileMap map[string]string) (*api.Evaluation, error) // Info provides the storage information w.r.t the provided job name StorageInfo(jobName string, profileMap map[string]string) (*api.Job, error) }
StorageApis provides a means to communicate with Nomad Apis w.r.t storage.
NOTE:
A Nomad job spec is treated as a persistent volume storage
spec & then submitted to a Nomad deployment.
NOTE:
Nomad has no notion of Persistent Volume.