mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #44363 from bowei/use-auto-net
Automatic merge from submit-queue Use auto mode networks instead of legacy networks in GCP Use of the --range flag creates legacy networks in GCP. Legacy networks will not support new GCP features. ```release-note NONE ```
This commit is contained in:
		@@ -695,7 +695,7 @@ function create-network() {
 | 
				
			|||||||
    echo "Creating new network: ${NETWORK}"
 | 
					    echo "Creating new network: ${NETWORK}"
 | 
				
			||||||
    # The network needs to be created synchronously or we have a race. The
 | 
					    # The network needs to be created synchronously or we have a race. The
 | 
				
			||||||
    # firewalls can be added concurrent with instance creation.
 | 
					    # firewalls can be added concurrent with instance creation.
 | 
				
			||||||
    gcloud compute networks create --project "${PROJECT}" "${NETWORK}" --range "10.240.0.0/16"
 | 
					    gcloud compute networks create --project "${PROJECT}" "${NETWORK}" --mode=auto
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if ! gcloud compute firewall-rules --project "${PROJECT}" describe "${CLUSTER_NAME}-default-internal-master" &>/dev/null; then
 | 
					  if ! gcloud compute firewall-rules --project "${PROJECT}" describe "${CLUSTER_NAME}-default-internal-master" &>/dev/null; then
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,7 +23,6 @@ NUM_NODES="${NUM_NODES:-3}"
 | 
				
			|||||||
ADDITIONAL_ZONES="${ADDITIONAL_ZONES:-}"
 | 
					ADDITIONAL_ZONES="${ADDITIONAL_ZONES:-}"
 | 
				
			||||||
CLUSTER_API_VERSION="${CLUSTER_API_VERSION:-}"
 | 
					CLUSTER_API_VERSION="${CLUSTER_API_VERSION:-}"
 | 
				
			||||||
NETWORK="${NETWORK:-default}"
 | 
					NETWORK="${NETWORK:-default}"
 | 
				
			||||||
NETWORK_RANGE="${NETWORK_RANGE:-10.240.0.0/16}"
 | 
					 | 
				
			||||||
FIREWALL_SSH="${FIREWALL_SSH:-${NETWORK}-allow-ssh}"
 | 
					FIREWALL_SSH="${FIREWALL_SSH:-${NETWORK}-allow-ssh}"
 | 
				
			||||||
GCLOUD="${GCLOUD:-gcloud}"
 | 
					GCLOUD="${GCLOUD:-gcloud}"
 | 
				
			||||||
CMD_GROUP="${CMD_GROUP:-}"
 | 
					CMD_GROUP="${CMD_GROUP:-}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -142,7 +142,7 @@ function kube-up() {
 | 
				
			|||||||
  # Make the specified network if we need to.
 | 
					  # Make the specified network if we need to.
 | 
				
			||||||
  if ! "${GCLOUD}" compute networks --project "${PROJECT}" describe "${NETWORK}" &>/dev/null; then
 | 
					  if ! "${GCLOUD}" compute networks --project "${PROJECT}" describe "${NETWORK}" &>/dev/null; then
 | 
				
			||||||
    echo "Creating new network: ${NETWORK}" >&2
 | 
					    echo "Creating new network: ${NETWORK}" >&2
 | 
				
			||||||
    with-retry 3 "${GCLOUD}" compute networks create "${NETWORK}" --project="${PROJECT}" --range "${NETWORK_RANGE}"
 | 
					    with-retry 3 "${GCLOUD}" compute networks create "${NETWORK}" --project="${PROJECT}" --mode=auto
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
    echo "... Using network: ${NETWORK}" >&2
 | 
					    echo "... Using network: ${NETWORK}" >&2
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user