The provider-specific cloud manager should be placed under pkg/adaptor/cloud/cloudmgr/
.
Under pkg/adaptor/cloud/<provider>
, start by adding a new file called types.go
. This file defines a configuration struct that contains the required parameters for a cloud provider.
Create a provider-specific manager file called manager.go
, which implements the following methods for parsing command-line flags, loading environment variables, and creating a new provider.
- ParseCmd
- LoadEnv
- NewProvider
The Provider interface defines a set of methods that need to be implemented by the cloud provider for managing virtual instances. Add the required methods:
- CreateInstance
- DeleteInstance
- Teardown
Also, consider adding additional files to modularize the code. You can refer to existing providers such as aws
, azure
, ibmcloud
, and libvirt
for guidance. Adding unit tests wherever necessary is good practice.
For using the provider, a pod VM image needs to be created in order to create the peer pod instances. Add the instructions for building the peer pod VM image at the root directory similar to the other providers.
For more information, please refer to the section on adding support for a new cloud provider in the E2E testing documentation.