<p>I have a cluster with multiple nodes. I've set up a Cloud Endpoints Portal and deployed my <code>api_config.yaml</code></p>

<pre><code>#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# A Bookstore example API configuration.
#
# Below, replace MY_PROJECT_ID with your Google Cloud Project ID.
#

# The configuration schema is defined by service.proto file
# https://github.com/googleapis/googleapis/blob/master/google/api/service.proto
type: google.api.Service
config_version: 3

#
# Name of the service configuration.
#
name: MY-SERVICE.service.endpoints.MY-PROJECT-ID.cloud.goog

#
# API title to appear in the user interface (Google Cloud Console).
#
title: MyService gRPC API
apis:
  - name: endpoints.MY-PROJECT-ID.service.MY-SERVICE.MyService

</code></pre>

<p>My issue is I think pretty simple: <strong>How can I use the url as API endpoint instead of the external IP of my node?</strong> Because if my IP change, I don't want to have to change anything in the code in term on configuration, but just update my 'addresses binding'</p>

<p>I can access the API Documentation from the URL and my service is available from the External IP. I am just looking to bind these both</p>

<p>Right now I have the following behavior:</p>

<pre><code>MBP-de-Emixam23:service-interface emixam23$ gcloud endpoints services deploy service.pb api_config.yaml
ERROR: (gcloud.endpoints.services.deploy) INVALID_ARGUMENT: Cannot convert to service config.
'location: "api_config.yaml:36"
kind: ERROR
message: "Cannot resolve api \'endpoints.MY-PROJECT-ID.service.MY-SERVICE.MyService\'."
'
</code></pre>

<p>Thanks!</p>

<h1>EDIT v2 (based on Andres S comment/answer)</h1>

<pre><code>host: "&lt;YOUR_NAMING&gt;.endpoints.YOUR_PROJECT_ID.cloud.goog"
x-google-endpoints:
- name: "&lt;YOUR_NAMING&gt;.endpoints.YOUR_PROJECT_ID.cloud.goog"
  target: "IP_ADDRESS"
# host: "test.service.endpoints.example-project.cloud.goog"
  # x-google-endpoints:
  # - name: "test.service.endpoints.example-project.cloud.goog"
  # target: "23.11.95.72"
</code></pre>

<blockquote>
  <p>ERROR: (gcloud.endpoints.services.deploy) Unable to parse Open API, or Google Service Configuration specification from api_config.yaml</p>
</blockquote>

Emixam23
<p>These lines have to be added to your api_config.yaml according to this <a href="https://cloud.google.com/endpoints/docs/grpc/cloud-goog-dns-configure" rel="nofollow noreferrer">doc</a></p>

<pre><code>endpoints:
- name: name.projectid.cloud.goog
  target: "X.X.X.X"
</code></pre>

<p>I tested by following the <a href="https://cloud.google.com/endpoints/docs/grpc/get-started-kubernetes-engine" rel="nofollow noreferrer">quickstart for gRPC endpoints / GKE</a> </p>

<p>And ultimately was able to get an answer from the endpoint using the domain</p>

<p>(emerald-cumulus-260322 is my temporal projectid used for testing)</p>

<pre><code>$ python bookstore_client.py --host bookstore.endpoints.emerald-cumulus-260322.cloud.goog --port 80                                 
ListShelves: shelves {
  id: 1
  theme: "Fiction"
}
shelves {
  id: 2
  theme: "Fantasy"
}
</code></pre>

<p>My final api_config.yaml looks like this:</p>

<pre><code># Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# A Bookstore example API configuration.
#
# Below, replace MY_PROJECT_ID with your Google Cloud Project ID.
#

# The configuration schema is defined by service.proto file
# https://github.com/googleapis/googleapis/blob/master/google/api/service.proto
type: google.api.Service
name: bookstore.endpoints.projectidhere.cloud.goog
endpoints:
- name: bookstore.endpoints.projectidhere.cloud.goog
  target: "X.X.X.X"

config_version: 3

#
# Name of the service configuration.
#

#
# API title to appear in the user interface (Google Cloud Console).
#
title: Bookstore gRPC API
apis:
- name: endpoints.examples.bookstore.Bookstore

#
# API usage restrictions.
#
usage:
  rules:
  # ListShelves methods can be called without an API Key.
  - selector: endpoints.examples.bookstore.Bookstore.ListShelves
    allow_unregistered_calls: true
</code></pre>
