# Is GCE Discovery still a thing?

**URL:** <https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363>\
**Category:** Elasticsearch\
**Created:** [April 27, 2021, 11:08am UTC](https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363 "2021-04-27T11:08:07Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![ppuschmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppuschmann/32/146751_2.png) [@ppuschmann](https://discuss.elastic.co/u/ppuschmann)\
**Post date:** [April 27, 2021, 11:08am UTC](https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363/1 "2021-04-27T11:08:07Z")

</div>

Hi there,

currently I'm investigating if it was sensible to enable the GCE-discovery in Elasticsearch.

According to this (older) thread, there are some hints about documentation and possibly implementation being outdated:

- [Why does discovery-gce need write permissions](https://discuss.elastic.co/t/why-does-discovery-gce-need-write-permissions/138972)

The documentation for the GCE-discovery in the current version 7.12: [Setting up GCE Discovery | Elasticsearch Plugins and Integrations [7.12] | Elastic](https://www.elastic.co/guide/en/elasticsearch/plugins/7.12/discovery-gce-usage-long.html) and I wonder if everything inside these docs is still up-to-date and if this was a sane thing to do.

Currently we're configuring ES with Ansible, passing initial cluster members with Ansible.  
I wonder if GCE discovery would be of any help / improvement.

I currently would think the documentation is outdated and might be no longer valid.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 27, 2021, 1:47pm UTC](https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363/2 "2021-04-27T13:47:06Z")

</div>

It is indeed still a thing, but there's certainly a few areas of the docs that could do with updating. However ...

> [@ppuschmann](#):
>
> passing initial cluster members

... do you mean the `cluster.initial_master_nodes` setting? That's nothing to do with discovery plugins like `discovery-gce`.

---

<div class="post-metadata">

**Author:** ![ppuschmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppuschmann/32/146751_2.png) [@ppuschmann](https://discuss.elastic.co/u/ppuschmann)\
**Post date:** [April 27, 2021, 2:47pm UTC](https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363/3 "2021-04-27T14:47:34Z")

</div>

Well, I don't like the concept of `cluster.initial_master_nodes` that much, especially because I have to apply a static configuration to a cluster, that might be outdated later on.  
I think this setting `cluster.initial_master_nodes` should even get removed after successful bootstrapping, like only stated on _[this page]_([Important Elasticsearch configuration | Elasticsearch Guide [master] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/master/important-settings.html#initial_master_nodes)):

> After the cluster forms successfully for the first time, remove the `cluster.initial_master_nodes` setting from each nodes' configuration. Do not use this setting when restarting a cluster or adding a new node to an existing cluster.

> **[Bootstrapping a cluster | Elasticsearch Guide \[7.16\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/7.16/modules-discovery-bootstrap-cluster.html)**

Coming back to the original topic:

We're using [GitHub - elastic/ansible-elasticsearch: Ansible playbook for Elasticsearch](https://github.com/elastic/ansible-elasticsearch) to configure Elasticsearch.

Unfortunately this role doesn't support plugins yet, so I have to either to extend our custom wrapper around this `ansible-elasticsearch` or extend the upstream-role to install the plugins.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 27, 2021, 3:18pm UTC](https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363/4 "2021-04-27T15:18:01Z")

</div>

> [@ppuschmann](#):
>
> I think this setting `cluster.initial_master_nodes` should even get removed after successful bootstrapping, but I can't find the quote, currently, correct?

Correct, [these are the docs you're thinking of](https://www.elastic.co/guide/en/elasticsearch/reference/7.x/important-settings.html#initial_master_nodes). But to repeat myself, this is nothing to do with discovery. For instance, you are required to set `cluster.initial_master_nodes` to the same value on every node, but there is no auto-discovery mechanism that can satisfy that requirement.

---

<div class="post-metadata">

**Author:** ![ppuschmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppuschmann/32/146751_2.png) [@ppuschmann](https://discuss.elastic.co/u/ppuschmann)\
**Post date:** [April 27, 2021, 3:25pm UTC](https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363/5 "2021-04-27T15:25:01Z")

</div>

Thank you very much for the kind answers.  
Yes, these topics are independent and I mixed them up.

GCE-discovery is working and I've to find out if tags work as I thought they do (like in the docs).  
I will then also try to improve the documentation.

---

<div class="post-metadata">

**Author:** ![ppuschmann](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppuschmann/32/146751_2.png) [@ppuschmann](https://discuss.elastic.co/u/ppuschmann)\
**Post date:** [April 28, 2021, 6:30am UTC](https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363/6 "2021-04-28T06:30:47Z")

</div>

@DavidTurner Do you know why the plugin does a call via this API `compute.instances.updateNetworkInterface` ?

I can see usage of these permissions:

```auto
compute.addresses.list
compute.instanceGroups.get
compute.instances.get
compute.instances.list
compute.instances.updateNetworkInterface
compute.zoneOperations.get
compute.zones.list

```

Only read-only access would be nice.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 28, 2021, 7:02am UTC](https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363/7 "2021-04-28T07:02:44Z")

</div>

AFAICS and from what I recall, we are only calling the "get" APIs of the Google client. See [elasticsearch/GceSeedHostsProvider.java at master · elastic/elasticsearch · GitHub](https://github.com/elastic/elasticsearch/blob/master/plugins/discovery-gce/src/main/java/org/elasticsearch/discovery/gce/GceSeedHostsProvider.java)

I was also surprised when I tested it that a `compute-rw` was needed by the Google client. 🤔

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [April 28, 2021, 8:06am UTC](https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363/8 "2021-04-28T08:06:37Z")

</div>

No, sorry, I don't have a lot of knowledge about GCE specifics and I can't see anything obvious in the code. It gets info about the network interfaces if you use the `_gce:..._` special values for `network.host` etc, but shouldn't be updating anything AFAIK

Can you forbid that specific permission? If so, does it break? Can you share logs and/or stack traces so we can see where it's being used?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 26, 2021, 8:07am UTC](https://discuss.elastic.co/t/is-gce-discovery-still-a-thing/271363/9 "2021-05-26T08:07:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
