Search code examples
netflixspinnaker

Spinnaker custom clouddriver


I'm trying to use Spinnaker to deploy applications to Mesos / Marathon. As this cloud driver does not exist, I'm looking at coding it myself.

I looked at spinnaker-clouddriver, and tried to get inspiration from azure, cf and google ones. But I think I miss some informations about how I is supposed to work.

Do you know any documentation about contributing to spinnaker-clouddriver ? Or could someone explain to me the steps to create my custom driver ?

Thanks.

So far I created :

@Component
class MarathonCloudProvider implements CloudProvider

@Component
class MarathonApplicationProvider implements ApplicationProvider 

But I really don't understand what to put in here.


Solution

  • Kubernetes has a nice commit stream ( https://github.com/spinnaker/clouddriver/pulls?utf8=%E2%9C%93&q=kubernetes ) you can follow as examples.

    This is the initial PR to introduce the cloud provider - https://github.com/spinnaker/clouddriver/pull/214/files

    From there, you would need to implement all the operations and descriptions to fit this.

    Essentially, to create a new cloud provider, you would need to do the following:

    1. Sort out how you would map the concepts in your cloud provider to Spinnaker concepts of Server Groups, Security Groups, Load Balancers and Jobs. Some cloud providers won't have this, but you would at the very least have the notion of a server group you would like to index.

    2. Implement caching agents and providers to get an internal cache of your infrastructure. Here is where you would map the existing infrastructure to spinnaker concepts.

    3. Implement cloud operations ( such as deploy, enable / disable ).

    4. Provide an UI.

    Adding a new cloud provider is not really trivial, I wouldn't recommend it as an individual undertaking.