Skip to content

Commit faf23f1

Browse files
committed
Update nwtwork settings
1 parent 740f9c3 commit faf23f1

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

tests/scripts/cleanup-vm.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ fi
1515

1616
gcloud compute instances delete "${RESOURCE_NAME}" --quiet --project="${GKE_PROJECT}" --zone="${GKE_CLUSTER_ZONE}"
1717

18+
gcloud compute firewall-rules delete "${RESOURCE_NAME}" --quiet --project="${GKE_PROJECT}"
19+
1820
# Clean up the custom network and subnet if IPv6 was enabled
1921
if [ "${IPV6_ENABLED}" = "true" ]; then
2022
gcloud compute networks subnets delete ${RESOURCE_NAME} --region=${GKE_CLUSTER_REGION} --quiet || true
2123
gcloud compute networks delete ${RESOURCE_NAME} --quiet || true
2224
fi
23-
24-
gcloud compute firewall-rules delete "${RESOURCE_NAME}" --quiet --project="${GKE_PROJECT}"

tests/scripts/create-and-setup-gcp-vm.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ set -o pipefail
55
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
66
REPO_DIR=$(dirname $(dirname "$SCRIPT_DIR"))
77

8+
# Default network settings
89
NETWORK=default
10+
STACK_TYPE="IPV4_ONLY"
11+
NETWORK_TIER="network-tier=PREMIUM"
912

1013
source scripts/vars.env
1114

@@ -20,6 +23,8 @@ if [ "${IPV6_ENABLED}" = "true" ]; then
2023
--region=${GKE_CLUSTER_REGION}
2124

2225
NETWORK=${RESOURCE_NAME}
26+
NETWORK_TIER="ipv6-network-tier=PREMIUM"
27+
STACK_TYPE="IPV6_ONLY"
2328
fi
2429

2530
gcloud compute firewall-rules create "${RESOURCE_NAME}" \
@@ -33,12 +38,10 @@ gcloud compute firewall-rules create "${RESOURCE_NAME}" \
3338
--target-tags="${NETWORK_TAGS}"
3439

3540
gcloud compute instances create "${RESOURCE_NAME}" --project="${GKE_PROJECT}" --zone="${GKE_CLUSTER_ZONE}" --machine-type=n2-standard-2 \
36-
--network-interface=network-tier=PREMIUM,stack-type=IPV4_ONLY,subnet=default --maintenance-policy=MIGRATE \
41+
--network-interface=${NETWORK_TIER},stack-type=${STACK_TYPE},subnet=${NETWORK} --maintenance-policy=MIGRATE \
3742
--provisioning-model=STANDARD --service-account="${GKE_SVC_ACCOUNT}" \
3843
--scopes=https://www.googleapis.com/auth/devstorage.read_only,https://www.googleapis.com/auth/logging.write,https://www.googleapis.com/auth/monitoring.write,https://www.googleapis.com/auth/servicecontrol,https://www.googleapis.com/auth/service.management.readonly,https://www.googleapis.com/auth/trace.append,https://www.googleapis.com/auth/cloud-platform \
39-
--tags="${NETWORK_TAGS}" --create-disk=auto-delete=yes,boot=yes,device-name="${RESOURCE_NAME}",image-family=projects/"${GKE_PROJECT}"/global/images/ngf-debian,mode=rw,size=20 --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --labels=goog-ec-src=vm_add-gcloud --reservation-affinity=any \
40-
--network=${NETWORK} \
41-
--subnet=${NETWORK}
44+
--tags="${NETWORK_TAGS}" --create-disk=auto-delete=yes,boot=yes,device-name="${RESOURCE_NAME}",image-family=projects/"${GKE_PROJECT}"/global/images/ngf-debian,mode=rw,size=20 --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --labels=goog-ec-src=vm_add-gcloud --reservation-affinity=any
4245

4346
# Add VM IP to GKE master control node access, if required
4447
if [ "${ADD_VM_IP_AUTH_NETWORKS}" = "true" ]; then

0 commit comments

Comments
 (0)