[ Web Proxy ]
URL:
Viewing: https://cloud.google.com/service-directory/docs/configuring-netlb-in-sd [Back]  [Original]

Register a regional external passthrough Network Load Balancer  |  Service Directory  |  Google Cloud Documentation Skip to main content
Google Cloud Documentation [Google Cloud Documentation]
Send feedback

Register a regional external passthrough Network Load Balancer Stay organized with collections Save and categorize content based on your preferences.

This page provides information about how to configure a regional external passthrough Network Load Balancer so that it is automatically registered in Service Directory.

When you create your load balancer, you can register it as an endpoint in an existing Service Directory namespace and service of your choice. Client applications can then use Service Directory (using HTTP or gRPC) to resolve the address of the regional external passthrough Network Load Balancer service and connect to it directly.

Permissions required for this task

To perform this task, you must have been granted the following permissions and IAM roles.

Permissions

Roles

Limitations

Service Directory integration with regional external passthrough Network Load Balancers has the following limitations:

Before you begin

These instructions require the following:

Set up forwarding rules to register a regional external passthrough Network Load Balancer in Service Directory

You must set up a forwarding rule to register the regional external passthrough Network Load Balancer in Service Directory. To register a regional external passthrough Network Load Balancer, see the following section.

Register a regional external passthrough Network Load Balancer

To register a regional external passthrough Network Load Balancer, run the gcloud compute forwarding-rules create command and set the service-directory-registration flag:

gcloud beta compute forwarding-rules create FORWARDING_RULE_NAME \
    --region=REGION \
    --load-balancing-scheme=EXTERNAL \
    --address=RESERVED_IP_ADDRESS \
    --ip-protocol=PROTOCOL_TYPE \
    --ports=PORT_NUMBER \
    --backend-service=BACKEND_SERVICE_NAME \
    --backend-service-region=REGION \
    --service-directory-registration=SD_SERVICE_NAME

Replace the following:

Verify the endpoint

The Service Directory endpoints that are created when you register a regional external passthrough Network Load Balancer have the following characteristics:

To confirm that the endpoint is created, resolve the service in Service Directory. You should see an endpoint with the same name as the name of the forwarding rule with the specified port number.

To resolve the service in Service Directory, run the gcloud service-directory services resolve command:

gcloud service-directory services resolve SD_SERVICE_NAME \
    --namespace=SD_NAMESPACE_NAME \
    --location=REGION

Replace the following:

Cleanup

To delete the resources that you created, follow these steps.

  1. To delete the forwarding rule, run the gcloud compute forwarding-rules delete command:

    gcloud compute forwarding-rules delete FORWARDING_RULE_NAME \
      --region=REGION
    

    Replace the following:

    • FORWARDING_RULE_NAME: the name of the forwarding rule that you created
    • REGION: the region for the forwarding rule

    For further details, see Deleting a forwarding rule.

    To confirm that deleting the forwarding rule has automatically deleted the endpoint from Service Directory, run the gcloud service-directory services resolve command described in Verify the endpoint section on your Service Directory service.

  2. To delete the Service Directory namespace and service, see Delete resources.

What's next

Send feedback

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-08-11 UTC.

Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-08-11 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page