# Bootstrap on GCE

**URL:** <https://discuss.akka.io/t/bootstrap-on-gce/2411>\
**Category:** Akka Cluster\
**Created:** [October 16, 2018, 1:17am UTC](https://discuss.akka.io/t/bootstrap-on-gce/2411 "2018-10-16T01:17:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![nafg](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/nafg/32/401_2.png) [@nafg](https://discuss.akka.io/u/nafg)\
**Post date:** [October 16, 2018, 1:17am UTC](https://discuss.akka.io/t/bootstrap-on-gce/2411/1 "2018-10-16T01:17:47Z")

</div>

I (think) I would like to use akka-management-cluster-bootstrap on GCE, however AFAICT there is no DNS record for all instances of a managed instance group. I can call GCP APIs, however I don’t know where to start to define a custom discovery mechanism.

Background: I would like to implement a task queue an an app that’s autoscaled, and to ensure that the same task doesn’t get executed on two nodes simultaneously I thought of having the nodes form a cluster and specifying that I want a single instance of an actor on them. I’ve used akka actors before (though not typed, which I might prefer to use), but not in a cluster. I’m open to other ways of solving the objective too.

---

<div class="post-metadata">

**Author:** ![chbatey](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/chbatey/32/98_2.png) [@chbatey](https://discuss.akka.io/u/chbatey)\
**Post date:** [October 16, 2018, 11:33am UTC](https://discuss.akka.io/t/bootstrap-on-gce/2411/2 "2018-10-16T11:33:48Z")

</div>

Bootstrap can work with any of the service discovery implementations (currently DNS, Consul, AWS API, Kubernetes API, Marathon API, etc). If you can’t get a DNS record then implementing a service discovery mechanism for GCE is a good idea, we have one for the AWS API.

Would you want to give it a try? Here is the AWS one for reference: [https://github.com/akka/akka-management/blob/master/discovery-aws-api-async/src/main/scala/akka/discovery/awsapi/ecs/AsyncEcsSimpleServiceDiscovery.scala](https://github.com/akka/akka-management/blob/master/discovery-aws-api-async/src/main/scala/akka/discovery/awsapi/ecs/AsyncEcsSimpleServiceDiscovery.scala) they are usually quite straight forward to implement.

You can start off by copying one of the other service discovery projects in Akka Management e.g. [https://github.com/akka/akka-management/tree/master/discovery-aws-api-async/](https://github.com/akka/akka-management/tree/master/discovery-aws-api-async/)

Once you get started you can raise a WIP PR to ask any questions / get guidance on whether you’re on the right track.

---

<div class="post-metadata">

**Author:** ![nafg](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/nafg/32/401_2.png) [@nafg](https://discuss.akka.io/u/nafg)\
**Post date:** [October 16, 2018, 4:52pm UTC](https://discuss.akka.io/t/bootstrap-on-gce/2411/3 "2018-10-16T16:52:34Z")

</div>

TBH I would probably implement it in my application codebase, at least initially. Once it’s working I can probably contribute it.

Thanks for the pointer.

Do you think my broader approach is right though?

---

<div class="post-metadata">

**Author:** ![chbatey](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/chbatey/32/98_2.png) [@chbatey](https://discuss.akka.io/u/chbatey)\
**Post date:** [October 17, 2018, 1:26pm UTC](https://discuss.akka.io/t/bootstrap-on-gce/2411/4 "2018-10-17T13:26:00Z")

</div>

Yes, it is the equivalent of the AWS API discovery mechanism, it would be great to have GCE API as well.

---

<div class="post-metadata">

**Author:** ![nafg](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.akka.io/nafg/32/401_2.png) [@nafg](https://discuss.akka.io/u/nafg)\
**Post date:** [October 17, 2018, 5:01pm UTC](https://discuss.akka.io/t/bootstrap-on-gce/2411/5 "2018-10-17T17:01:32Z")

</div>

After thinking about the the underlying problem more, I decided that I don’t really need a task queue after all. Perhaps one would make things more robust, but it’s not worth it right now.

Thanks for the help anyway
