Commit 911d1065 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #38638 from madhusudancs/fed-bootstrap-e2e-logs-firewall

Automatic merge from submit-queue Use the cluster name in the names of the firewall rules that allow cluster-internal traffic to disambiguate the rules belonging to different clusters. Also dropping the network name from these firewall rule names. Network name was used to disambiguate firewall rules in a given network. However, since two clusters cannot share a name in a GCE project, this sufficiently disambiguates the firewall rule names. A potential confusion arises when someone tries to create a firewall rule with the same name in a different network, but that's also an indication that they shouldn't be doing that. @jszczepkowski due to PR #33094 @ixdy for test-infra cc @kubernetes/sig-federation @nikhiljindal
parents 6893017b 17485650
......@@ -654,8 +654,8 @@ function create-network() {
gcloud compute networks create --project "${PROJECT}" "${NETWORK}" --range "10.240.0.0/16"
fi
if ! gcloud compute firewall-rules --project "${PROJECT}" describe "${NETWORK}-default-internal-master" &>/dev/null; then
gcloud compute firewall-rules create "${NETWORK}-default-internal-master" \
if ! gcloud compute firewall-rules --project "${PROJECT}" describe "${CLUSTER_NAME}-default-internal-master" &>/dev/null; then
gcloud compute firewall-rules create "${CLUSTER_NAME}-default-internal-master" \
--project "${PROJECT}" \
--network "${NETWORK}" \
--source-ranges "10.0.0.0/8" \
......@@ -663,8 +663,8 @@ function create-network() {
--target-tags "${MASTER_TAG}"&
fi
if ! gcloud compute firewall-rules --project "${PROJECT}" describe "${NETWORK}-default-internal-node" &>/dev/null; then
gcloud compute firewall-rules create "${NETWORK}-default-internal-node" \
if ! gcloud compute firewall-rules --project "${PROJECT}" describe "${CLUSTER_NAME}-default-internal-node" &>/dev/null; then
gcloud compute firewall-rules create "${CLUSTER_NAME}-default-internal-node" \
--project "${PROJECT}" \
--network "${NETWORK}" \
--source-ranges "10.0.0.0/8" \
......@@ -1455,8 +1455,8 @@ function kube-down() {
# Delete all remaining firewall rules and network.
delete-firewall-rules \
"${NETWORK}-default-internal-master" \
"${NETWORK}-default-internal-node" \
"${CLUSTER_NAME}-default-internal-master" \
"${CLUSTER_NAME}-default-internal-node" \
"${NETWORK}-default-ssh" \
"${NETWORK}-default-internal" # Pre-1.5 clusters
if [[ "${KUBE_DELETE_NETWORK}" == "true" ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment