<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Unicorn Research Ltd.</title>
    <description>The latest articles on DEV Community by Unicorn Research Ltd. (unicornresltd).</description>
    <link>https://dev.to/unicornresltd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F15845%2F029877d4-7596-4d64-9be9-c03bc2375684.png</url>
      <title>DEV Community: Unicorn Research Ltd.</title>
      <link>https://dev.to/unicornresltd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/unicornresltd"/>
    <language>en</language>
    <item>
      <title>Reverse Terraforming GCP Load Balancers with OpenTofu</title>
      <dc:creator>Chuma Takahiro</dc:creator>
      <pubDate>Wed, 04 Nov 2026 15:06:01 +0000</pubDate>
      <link>https://dev.to/unicornresltd/reverse-terraforming-gcp-load-balancers-with-opentofu-pl5</link>
      <guid>https://dev.to/unicornresltd/reverse-terraforming-gcp-load-balancers-with-opentofu-pl5</guid>
      <description>&lt;p&gt;GCP Load Balancers are often built using the web console or CLI, which makes backup and restoration difficult. By using &lt;a href="https://opentofu.org/" rel="noopener noreferrer"&gt;OpenTofu&lt;/a&gt; or Terraform, you can implement Infrastructure as Code (IaC) even for existing resources.&lt;/p&gt;

&lt;p&gt;By preparing an &lt;code&gt;import.tf&lt;/code&gt; like the following and running &lt;code&gt;tofu plan -generate-config-out=export.tf&lt;/code&gt;, you can export the current configuration. Since &lt;code&gt;tofu plan&lt;/code&gt; queries GCP, you must be authenticated with a user who has appropriate access rights to GCP objects via &lt;code&gt;gcloud auth application-default login&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="c"&gt;# gcloud compute forwarding-rules list --global --uri &lt;/span&gt;
&lt;span class="n"&gt;import&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"projects/&amp;lt;project-id&amp;gt;/global/forwardingRules/&amp;lt;object-id&amp;gt;"&lt;/span&gt;
  &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;google_compute_global_forwarding_rule.&amp;lt;unique-name&amp;gt;
}

# gcloud compute target-https-proxies list --global --uri
import &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"projects/&amp;lt;project-id&amp;gt;/global/targetHttpsProxies/&amp;lt;object-id&amp;gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;google_compute_target_https_proxy.&amp;lt;unique-name&amp;gt;
}

# gcloud compute target-http-proxies list --global --uri
import &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"projects/&amp;lt;project-id&amp;gt;/global/targetHttpProxies/&amp;lt;object-id&amp;gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;google_compute_target_http_proxy.&amp;lt;unique-name&amp;gt;
}

# gcloud compute url-maps list --uri
import &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"projects/&amp;lt;project-id&amp;gt;/global/urlMaps/&amp;lt;object-id&amp;gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;google_compute_url_map.&amp;lt;unique-name&amp;gt;
}

# gcloud compute backend-buckets list --uri
import &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"projects/&amp;lt;project-id&amp;gt;/global/backendBuckets/&amp;lt;object-id&amp;gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;google_compute_global_backend_bucket.&amp;lt;unique-name&amp;gt;
}

# gcloud compute backend-services list --uri
import &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"projects/&amp;lt;project-id&amp;gt;/global/backendServices/&amp;lt;object-id&amp;gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;google_compute_backend_service.&amp;lt;unique-name&amp;gt;
}

# gcloud compute health-checks list --uri
import &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"projects/&amp;lt;project-id&amp;gt;/global/healthChecks/&amp;lt;object-id&amp;gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;google_compute_health_check.&amp;lt;unique-name&amp;gt;
}

# gcloud compute firewall-rules list --uri
import &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"projects/&amp;lt;project-id&amp;gt;/global/firewalls/&amp;lt;object-id&amp;gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;google_compute_firewall.&amp;lt;unique-name&amp;gt;
}

# gcloud compute ssl-certificates list --global --uri
# NOTE: TLS certificates can be used for configuration changes if managed. Unmanaged ones are hard to manage declaratively.
import &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"projects/&amp;lt;project-id&amp;gt;/global/sslCertificates/&amp;lt;object-id&amp;gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;google_compute_ssl_certificate.&amp;lt;unique-name&amp;gt;
}

# gcloud compute addresses list --global --uri
# NOTE: IP addresses are hard to manage declaratively.
import &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;"projects/&amp;lt;project-id&amp;gt;/global/addresses/&amp;lt;object-id&amp;gt;"&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;google_compute_global_address.&amp;lt;unique-name&amp;gt;
}
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For the &lt;code&gt;id&lt;/code&gt;, specify the URL of the target resource obtained with &lt;code&gt;gcloud compute &amp;lt;gcp-object-type&amp;gt; list&lt;/code&gt;. For &lt;code&gt;to&lt;/code&gt;, specify the type corresponding to the GCP object as the prefix, and provide a &lt;code&gt;&amp;lt;unique-name&amp;gt;&lt;/code&gt; for identification within OpenTofu.&lt;/p&gt;

&lt;p&gt;The exported configuration file will likely not be optimal, so refactoring is necessary. You will likely want to remove many attributes that &lt;code&gt;tofu&lt;/code&gt; specifies by default. Since the meaning of each field is not always self-evident even if concise, it's important to verify them in the reference documentation. Additionally, using &lt;code&gt;for_each&lt;/code&gt; can help consolidate blocks where only a few parameters differ, maintaining code brevity.&lt;/p&gt;

&lt;p&gt;The workflow consists of checking the definitions with &lt;code&gt;tofu plan&lt;/code&gt; and applying changes with &lt;code&gt;tofu apply&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Management Points
&lt;/h2&gt;

&lt;p&gt;As shown in the previous examples, Load Balancers have many associated objects, which can make the configuration difficult to understand later. Bundling them by purpose in OpenTofu HCL makes management easier. Especially when building multiple clusters within a project, native tools like the Cloud Console list GCP objects by type, which can obscure dependency relationships.&lt;/p&gt;

&lt;h3&gt;
  
  
  Firewalls
&lt;/h3&gt;

&lt;p&gt;Among Load Balancer related objects, firewall rule settings can be the most difficult to understand. There are prerequisites described in &lt;a href="https://docs.cloud.google.com/load-balancing/docs/firewall-rules" rel="noopener noreferrer"&gt;Firewall rules for load balancing&lt;/a&gt;. Without firewall settings, health checks will fail first. A point often not explicitly mentioned in the documentation is that actual traffic also follows these conditions. If you only permit the health check target port and don't configure settings for actual traffic on a different port, you may experience a confusing situation where the console shows everything is up, but requests time out. Since firewalls are global objects, it's almost impossible to track which cluster depends on which rule without codifying them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Adding &lt;code&gt;depends_on&lt;/code&gt; Blocks
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;depends_on&lt;/code&gt; blocks are useful for structuring code. These are not recognized automatically and must be added manually. You define them using the HCL names:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight toml"&gt;&lt;code&gt;&lt;span class="n"&gt;resource&lt;/span&gt; &lt;span class="s"&gt;"google_compute_target_https_proxy"&lt;/span&gt; &lt;span class="s"&gt;"proxy_set"&lt;/span&gt; &lt;span class="err"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;depends_on&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="err"&gt;google_compute_url_map.url_map,
    google_compute_firewall.allow_hc_v&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="err"&gt;google_compute_firewall.allow_hc_v&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="err"&gt;google_compute_firewall.allow_glb_v&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="err"&gt;google_compute_firewall.allow_glb_v&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="err"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As in this example, there are constraints such as not being able to mix IPv6 and IPv4 or HTTPS and HTTP within a single object. As the Load Balancer configuration grows, defining dependencies allows &lt;code&gt;tofu plan&lt;/code&gt; to detect inconsistencies before applying changes. Furthermore, there are actual dependencies between GCP objects; requesting a build in a flat manner can result in errors due to missing prerequisite objects. &lt;code&gt;depends_on&lt;/code&gt; ensures that execution waits according to the definitions, leading to stable behavior during clean builds.&lt;/p&gt;

&lt;h3&gt;
  
  
  Obtaining IP Addresses
&lt;/h3&gt;

&lt;p&gt;One strategy is to not manage GCP IP addresses in HCL. While they can be created with &lt;code&gt;tofu&lt;/code&gt;, IP addresses are not resources where you can "gain" a specific desired address, so the effect of declaration is weak. If you simply obtain and lock an IP address from the Cloud Console, you can just specify it in &lt;code&gt;google_compute_global_forwarding_rule.ip_address&lt;/code&gt;. If you want to obtain an ephemeral IP, specify &lt;code&gt;IPV4|IPV6&lt;/code&gt; in &lt;code&gt;google_compute_global_forwarding_rule.ip_version&lt;/code&gt;. After startup, lock it as a static IP in the Cloud Console and update the HCL accordingly. SSL certificates are handled similarly; if you are registering and updating them on GCP via an external process, you can simply reference those objects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cleanup after Export
&lt;/h2&gt;

&lt;p&gt;Files generated by &lt;code&gt;tofu plan -generate-config-out&lt;/code&gt; contain many fields automatically assigned by GCP and read-only attributes that do not need management in HCL. Leaving these can make the code hard to read and may cause unnecessary drifts during future provider updates.&lt;/p&gt;

&lt;p&gt;Specifically, you should review or remove the following fields:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;id&lt;/code&gt;, &lt;code&gt;self_link&lt;/code&gt;: Attributes fixed after resource creation.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;creation_timestamp&lt;/code&gt;: The creation date and time.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;project&lt;/code&gt;: If configured at the provider level, it doesn't need to be specified for each resource.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;fingerprint&lt;/code&gt;: Values for preventing update conflicts, often found in &lt;code&gt;backend_service&lt;/code&gt;. Not needed during initial import.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Consolidating common values such as project IDs and regions into &lt;code&gt;locals&lt;/code&gt; or &lt;code&gt;variables&lt;/code&gt; makes it easier to deploy to multiple environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verification and Achieving Zero-drift
&lt;/h2&gt;

&lt;p&gt;After completing the &lt;code&gt;tofu apply&lt;/code&gt; with the import blocks, immediately run a standard &lt;code&gt;tofu plan&lt;/code&gt; to verify that it shows "No changes".&lt;/p&gt;

&lt;p&gt;OpenTofu compares the actual GCP configuration with the &lt;code&gt;terraform.tfstate&lt;/code&gt; (state file), which records the state of managed resources. Since the state file plays a critical role as the "source of truth" in IaC, establishing a zero-diff state immediately after import is a fundamental prerequisite for stable long-term operation.&lt;/p&gt;

&lt;p&gt;If there are differences, the generated HCL definitions slightly mismatch the actual configuration on GCP.&lt;/p&gt;

&lt;p&gt;Be particularly careful if a resource recreation (Replace) occurs, such as &lt;strong&gt;"Plan: 1 to add, 0 to change, 1 to destroy"&lt;/strong&gt;. Recreating a Load Balancer can lead to IP address changes or service downtime. You must carefully examine the differences and adjust the HCL to match the actual configuration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Standard Workflow Preparation
&lt;/h2&gt;

&lt;p&gt;Once IaC implementation is complete, setting up a safe operational environment for the entire team is essential. The codebase should be tracked using version control systems like Git.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;.tfstate&lt;/code&gt;: The state file (&lt;code&gt;.tfstate&lt;/code&gt;) is the only source of truth defining the current state of your system. Even if you have the HCL, losing this file means OpenTofu can no longer recognize your existing resources. This creates a severe risk where an accidental &lt;code&gt;apply&lt;/code&gt; might attempt to recreate or overwrite resources that are already in production, leading to potential collisions or unintended destruction, and requiring a dangerous, labor-intensive re-import process to recover.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;.terraform.lock.hcl&lt;/code&gt;: Pin the &lt;code&gt;google&lt;/code&gt; provider version in a &lt;code&gt;required_providers&lt;/code&gt; block and include &lt;code&gt;.terraform.lock.hcl&lt;/code&gt; in the repository to prevent unexpected behavior from provider specification changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Additionally, automatically running &lt;code&gt;tofu plan&lt;/code&gt; during pull requests via CI/CD ensures that the impact of changes is visualized beforehand and prevents unintended infrastructure changes from being mixed into production.&lt;/p&gt;

&lt;h2&gt;
  
  
  Integration with Google Kubernetes Engine
&lt;/h2&gt;

&lt;p&gt;This method assumes a configuration connecting from a &lt;code&gt;backendService&lt;/code&gt; to a &lt;code&gt;Service&lt;/code&gt; with Standalone NEG. It can connect to standard Kubernetes Services and Pods, but adding annotations to the &lt;code&gt;Service&lt;/code&gt; and setting up to accept GCP health checks is necessary.&lt;/p&gt;

&lt;p&gt;This approach foregoes the adoption of Gateway API. Even if you could build using Gateway API, it is possible to export the full set of GCP objects with OpenTofu. However, in reality, there are many cases where Gateway API cannot fully support requirements—for example, it has long lacked support for housing a &lt;code&gt;backendBucket&lt;/code&gt; in the same Load Balancer. Without Gateway API, this network access layer won't be codified, necessitating the use of HCL.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dual-stack NEGs
&lt;/h3&gt;

&lt;p&gt;Network Endpoint Groups are added via annotations, but the dual-stack setting is determined by the &lt;code&gt;Service&lt;/code&gt; spec. If the default is IPv4 only, the following setting allows the NEG to also accept IPv6:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Service&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;annotations&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;cloud.google.com/neg&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;{"exposed_ports":&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;{"443":&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;{"name":&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;"web-neg"}}}'&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ClusterIP&lt;/span&gt;
  &lt;span class="na"&gt;ipFamilyPolicy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;PreferDualStack&lt;/span&gt;
  &lt;span class="na"&gt;ipFamilies&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;IPv6&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;IPv4&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, the application within the Pod must obviously listen not only on &lt;code&gt;0.0.0.0&lt;/code&gt; but also on &lt;code&gt;[::]&lt;/code&gt;. Also, the order of &lt;code&gt;ipFamilies&lt;/code&gt; is significant.&lt;/p&gt;

</description>
      <category>gcp</category>
    </item>
  </channel>
</rss>
