satelit is a framework for the internal cloud. It has some components.
You can switch components to another backend that implemented interface
.
NewSatelit()
(code) in satelit/cmd/cmd.go
return api.SatelitServer
.
api.SatelitServer
has some implemented codes.
return &api.SatelitServer{
Europa: targetds,
IPAM: ipamBackend,
Datastore: ds,
Ganymede: libvirtBackend,
Scheduler: schedulerBackend,
}, nil
The component has interface
in Go. So you can switch to another implement without change the original code of satelit.
e.g.) interface.go in europa
// Europa is interface of volume operation.
type Europa interface {
CreateVolume(ctx context.Context, name uuid.UUID, capacityGB int) (*Volume, error)
CreateVolumeFromImage(ctx context.Context, name uuid.UUID, capacityGB int, imageID uuid.UUID) (*Volume, error)
DeleteVolume(ctx context.Context, id string) error
ListVolume(ctx context.Context) ([]Volume, error)
GetVolume(ctx context.Context, id string) (*Volume, error)
AttachVolumeTeleskop(ctx context.Context, id string, hostname string) (int, string, error)
AttachVolumeSatelit(ctx context.Context, id string, hostname string) (int, string, error)
DetachVolume(ctx context.Context, id string) error
GetImage(imageID uuid.UUID) (*BaseImage, error)
ListImage() ([]BaseImage, error)
UploadImage(ctx context.Context, image []byte, name, description string, imageSizeGB int) (*BaseImage, error)
DeleteImage(ctx context.Context, id uuid.UUID) error
}
Europa is a component of storage.
implemented backends:
- open-iscsi/targetd
- OceanStor Dorado
- Memory (for testing only. do not operation volume)
Ganymede is a component of the virtual machine.
implemented backends:
Datastore is a component of persistent data.
implemented backends:
- MySQL Server
- Memory (for testing only. do not operation persistent data)
satelit has more components, but they depend on only datastore
.
So you can use it directly in many cases.