solutions/gke/configconnector/gke-cluster-autopilot/host-project/firewall.yaml (20 lines of code) (raw):
# Copyright 2021 Google LLC
#
# 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.
######
# Firewall rule for lb health check
# AU-12 - Enable Logging for firewall
apiVersion: compute.cnrm.cloud.google.com/v1beta1
kind: ComputeFirewall
metadata:
name: project-id-cluster-name-lb-health-check # kpt-set: ${project-id}-${cluster-name}-lb-health-check
annotations:
cnrm.cloud.google.com/project-id: host-project-id # kpt-set: ${host-project-id}
spec:
resourceID: project-id-cluster-name-lb-health-check # kpt-set: ${project-id}-${cluster-name}-lb-health-check
allow:
- protocol: tcp
networkRef:
name: host-project-id-global-network-connectivity-profile-vpc # kpt-set: ${host-project-id}-global-${network-connectivity-profile}-vpc
namespace: client-name-networking # kpt-set: ${client-name}-networking
sourceRanges:
- "35.191.0.0/16"
- "130.211.0.0/22"
destinationRanges: # kpt-set: ${podIpv4Range}
- podIpv4Range
# AU-12
logConfig:
metadata: "INCLUDE_ALL_METADATA"