A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/kubernetes-engine/docs/how-to/user-managed-firewall-rules below:

User-managed firewall rules for GKE LoadBalancer Services | Google Kubernetes Engine (GKE)

User-managed firewall rules for GKE LoadBalancer Services

Stay organized with collections Save and categorize content based on your preferences.

This page describes how to disable the ingress allow VPC firewall rules that GKE creates for LoadBalancer Services.

Disabling these automatically created firewall rules for LoadBalancer Services can be useful in the following situations:

To disable automatically created firewall rules for LoadBalancer Services, you must specify the --disable-l4-lb-firewall-reconciliation flag when you create or update a cluster. The --disable-l4-lb-firewall-reconciliation flag does not affect other automatically created VPC firewall rules, such as those facilitating communication between nodes or those that permit health checks for your Services.

Requirements Limitations

GKE supports disabling the automatic creation of firewall rules for these types of LoadBalancer Services:

You cannot disable the automatic creation of firewall rules for these types of LoadBalancer Services:

Before you begin

Before you start, make sure that you have performed the following tasks:

Strategies for manual firewall rule management

Before you disable automatic creation of VPC firewall rules for LoadBalancer Services in your GKE cluster, work with a Security Admin to develop a strategy for configuring firewall rules manually.

  1. Decide which type of firewall policy to use: a hierarchical firewall policy, a global network firewall policy, or a regional network firewall policy. For steps to create a firewall policy, see:

    You can also use VPC firewall rules, which don't use any policy.

  2. Your manually created firewall rules must be ingress allow rules because the implied deny ingress firewall rule prohibits incoming traffic. When you've disabled the automatic creation of VPC firewall rules, incoming traffic won't reach your nodes unless you've created ingress allow firewall rules that match traffic for your LoadBalancer Services.

    Depending on the firewall rule's parameters, a single ingress allow firewall rule can apply to one or more LoadBalancer Services. For each ingress allow firewall rule you create, define the following parameters:

    For steps to create firewall rules, see:

  3. To ensure that your manually created firewall rules are working correctly, run a Network Intelligence Center (NIC) Connectivity Test. When running the Connectivity Test:

    For more information, see Troubleshoot connectivity issues.

Disable creation of VPC firewall rules for your LoadBalancer Services

This section describes steps to disable the automatic creation of VPC firewall rules for LoadBalancer Services.

Create a new GKE cluster with VPC firewall rules creation disabled
  1. To disable the automatically created VPC firewall rules for LoadBalancer Services in a newly created cluster, create the cluster with the --disable-l4-lb-firewall-reconciliation flag:

    Autopilot:

    gcloud container clusters create-auto CLUSTER_NAME \
      --disable-l4-lb-firewall-reconciliation \
      --cluster-version=VERSION
    

    Standard:

    gcloud container clusters create CLUSTER_NAME \
      --disable-l4-lb-firewall-reconciliation \
      --enable-l4-ilb-subsetting \
      --cluster-version=VERSION
    

    Replace the following:

  2. Create an external or internal LoadBalancer Service:

  3. Verify that GKE doesn't create an ingress allow firewall rule for the LoadBalancer Service. (Automatically created ingress allow firewall rules have names of the following form: k8s2-[cluster-id]-[namespace]-[service-name]-[suffixhash]).

    The following command returns a list of firewall rules that contain k8s2:

    gcloud compute firewall-rules list --format="value(name)" | grep "k8s2"
    

    The response should return only the health check firewall rule of the form k8s2-[cluster-id]-[namespace]-[service-name]-[suffixhash]-fw if the externalTrafficPolicy parameter is set to Local. It uses the TCP port defined by the spec.healthCheckNodePort parameter. If unspecified, the Kubernetes control plane assigns a health check port from the node port range.

    k8s2-rkdld6go-default-ilb-svc-dluvsefq-fw  default  INGRESS  1000  tcp:30868  False
    

    If the externalTrafficPolicy parameter is set to Cluster, the following health check firewall rule is returned instead.

    k8s2-rkdld6go-l4-shared-hc-fw  default  INGRESS  1000  tcp:10256  False
    

    For more information about generated firewall rules for GKE Services, see Automatically created firewall rules.

Update an existing GKE cluster to disable VPC firewall rules creation

Before disabling VPC firewall rules creation, note the following points about updating an existing cluster:

To disable the automatic firewall rule creation on an existing cluster:

  1. Update the cluster to disable the automatic creation and management of firewall rules for LoadBalancer Services:

    gcloud container clusters update CLUSTER_NAME \
    --disable-l4-lb-firewall-reconciliation \
    --cluster-version=supported_version
    

    Replace the following:

  2. Create an external or internal LoadBalancer Service:

  3. Verify that GKE doesn't create an ingress allow firewall rule for the LoadBalancer Service. (Automatically created ingress allow firewall rules have names of the following form: k8s2-[cluster-id]-[namespace]-[service-name]-[suffixhash]).

    The following command returns a list of firewall rules that contain k8s2:

    gcloud compute firewall-rules list --format="value(name)" | grep "k8s2"
    

    The response should return only the health check firewall rule of the form k8s2-[cluster-id]-[namespace]-[service-name]-[suffixhash]-fw if the externalTrafficPolicy parameter is set to Local. It uses the TCP port defined by the spec.healthCheckNodePort parameter. If unspecified, the Kubernetes control plane assigns a health check port from the node port range.

    k8s2-rkdld6go-default-ilb-svc-dluvsefq-fw  default  INGRESS  1000  tcp:30868  False
    

    If the externalTrafficPolicy parameter is set to Cluster, the following health check firewall rule is returned instead.

    k8s2-rkdld6go-l4-shared-hc-fw  default  INGRESS  1000  tcp:10256  False
    

    For more information about generated firewall rules for GKE Services, see Automatically created firewall rules.

Troubleshoot connectivity issues

The following examples illustrate how to use Network Intelligence Center Connectivity Tests to test connectivity to an external LoadBalancer Service:cluster:

What's next

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 2025-08-12 UTC.

[[["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 2025-08-12 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4