mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #46002 from bowei/ip-alias-to-beta
Automatic merge from submit-queue Update cluster startup scripts to use gcloud beta for alias IP support The feature has gone from alpha to beta. ```release-note NONE ```
This commit is contained in:
		@@ -188,7 +188,7 @@ ENABLE_RESCHEDULER="${KUBE_ENABLE_RESCHEDULER:-true}"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Optional: Enable allocation of pod IPs using IP aliases.
 | 
					# Optional: Enable allocation of pod IPs using IP aliases.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# ALPHA FEATURE.
 | 
					# BETA FEATURE.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# IP_ALIAS_SIZE is the size of the podCIDR allocated to a node.
 | 
					# IP_ALIAS_SIZE is the size of the podCIDR allocated to a node.
 | 
				
			||||||
# IP_ALIAS_SUBNETWORK is the subnetwork to allocate from. If empty, a
 | 
					# IP_ALIAS_SUBNETWORK is the subnetwork to allocate from. If empty, a
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -221,14 +221,14 @@ ENABLE_RESCHEDULER="${KUBE_ENABLE_RESCHEDULER:-true}"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Optional: Enable allocation of pod IPs using IP aliases.
 | 
					# Optional: Enable allocation of pod IPs using IP aliases.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# ALPHA FEATURE.
 | 
					# BETA FEATURE.
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# IP_ALIAS_SIZE is the size of the podCIDR allocated to a node.
 | 
					# IP_ALIAS_SIZE is the size of the podCIDR allocated to a node.
 | 
				
			||||||
# IP_ALIAS_SUBNETWORK is the subnetwork to allocate from. If empty, a
 | 
					# IP_ALIAS_SUBNETWORK is the subnetwork to allocate from. If empty, a
 | 
				
			||||||
#   new subnetwork will be created for the cluster.
 | 
					#   new subnetwork will be created for the cluster.
 | 
				
			||||||
ENABLE_IP_ALIASES=${KUBE_GCE_ENABLE_IP_ALIASES:-false}
 | 
					ENABLE_IP_ALIASES=${KUBE_GCE_ENABLE_IP_ALIASES:-false}
 | 
				
			||||||
if [ ${ENABLE_IP_ALIASES} = true ]; then
 | 
					if [ ${ENABLE_IP_ALIASES} = true ]; then
 | 
				
			||||||
  # Size of ranges allocated to each node. gcloud alpha supports only /32 and /24.
 | 
					  # Size of ranges allocated to each node. gcloud current supports only /32 and /24.
 | 
				
			||||||
  IP_ALIAS_SIZE=${KUBE_GCE_IP_ALIAS_SIZE:-/24}
 | 
					  IP_ALIAS_SIZE=${KUBE_GCE_IP_ALIAS_SIZE:-/24}
 | 
				
			||||||
  IP_ALIAS_SUBNETWORK=${KUBE_GCE_IP_ALIAS_SUBNETWORK:-${INSTANCE_PREFIX}-subnet-default}
 | 
					  IP_ALIAS_SUBNETWORK=${KUBE_GCE_IP_ALIAS_SUBNETWORK:-${INSTANCE_PREFIX}-subnet-default}
 | 
				
			||||||
  # NODE_IP_RANGE is used when ENABLE_IP_ALIASES=true. It is the primary range in
 | 
					  # NODE_IP_RANGE is used when ENABLE_IP_ALIASES=true. It is the primary range in
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,7 +67,7 @@ function replicate-master-instance() {
 | 
				
			|||||||
function create-master-instance-internal() {
 | 
					function create-master-instance-internal() {
 | 
				
			||||||
  local gcloud="gcloud"
 | 
					  local gcloud="gcloud"
 | 
				
			||||||
  if [[ "${ENABLE_IP_ALIASES:-}" == 'true' ]]; then
 | 
					  if [[ "${ENABLE_IP_ALIASES:-}" == 'true' ]]; then
 | 
				
			||||||
    gcloud="gcloud alpha"
 | 
					    gcloud="gcloud beta"
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  local -r master_name="${1}"
 | 
					  local -r master_name="${1}"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -515,7 +515,7 @@ function create-node-template() {
 | 
				
			|||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if [[ "${ENABLE_IP_ALIASES:-}" == 'true' ]]; then
 | 
					  if [[ "${ENABLE_IP_ALIASES:-}" == 'true' ]]; then
 | 
				
			||||||
    gcloud="gcloud alpha"
 | 
					    gcloud="gcloud beta"
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  local preemptible_minions=""
 | 
					  local preemptible_minions=""
 | 
				
			||||||
@@ -745,7 +745,7 @@ function create-subnetwork() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  # Look for the subnet, it must exist and have a secondary range
 | 
					  # Look for the subnet, it must exist and have a secondary range
 | 
				
			||||||
  # configured.
 | 
					  # configured.
 | 
				
			||||||
  local subnet=$(gcloud alpha compute networks subnets describe \
 | 
					  local subnet=$(gcloud beta compute networks subnets describe \
 | 
				
			||||||
    --project "${PROJECT}" \
 | 
					    --project "${PROJECT}" \
 | 
				
			||||||
    --region ${REGION} \
 | 
					    --region ${REGION} \
 | 
				
			||||||
    ${IP_ALIAS_SUBNETWORK} 2>/dev/null)
 | 
					    ${IP_ALIAS_SUBNETWORK} 2>/dev/null)
 | 
				
			||||||
@@ -762,7 +762,7 @@ function create-subnetwork() {
 | 
				
			|||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    echo "Creating subnet ${NETWORK}:${IP_ALIAS_SUBNETWORK}"
 | 
					    echo "Creating subnet ${NETWORK}:${IP_ALIAS_SUBNETWORK}"
 | 
				
			||||||
    gcloud alpha compute networks subnets create \
 | 
					    gcloud beta compute networks subnets create \
 | 
				
			||||||
      ${IP_ALIAS_SUBNETWORK} \
 | 
					      ${IP_ALIAS_SUBNETWORK} \
 | 
				
			||||||
      --description "Automatically generated subnet for ${INSTANCE_PREFIX} cluster. This will be removed on cluster teardown." \
 | 
					      --description "Automatically generated subnet for ${INSTANCE_PREFIX} cluster. This will be removed on cluster teardown." \
 | 
				
			||||||
      --project "${PROJECT}" \
 | 
					      --project "${PROJECT}" \
 | 
				
			||||||
@@ -812,11 +812,11 @@ function delete-subnetwork() {
 | 
				
			|||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  echo "Removing auto-created subnet ${NETWORK}:${IP_ALIAS_SUBNETWORK}"
 | 
					  echo "Removing auto-created subnet ${NETWORK}:${IP_ALIAS_SUBNETWORK}"
 | 
				
			||||||
  if [[ -n $(gcloud alpha compute networks subnets describe \
 | 
					  if [[ -n $(gcloud beta compute networks subnets describe \
 | 
				
			||||||
        --project "${PROJECT}" \
 | 
					        --project "${PROJECT}" \
 | 
				
			||||||
        --region ${REGION} \
 | 
					        --region ${REGION} \
 | 
				
			||||||
        ${IP_ALIAS_SUBNETWORK} 2>/dev/null) ]]; then
 | 
					        ${IP_ALIAS_SUBNETWORK} 2>/dev/null) ]]; then
 | 
				
			||||||
    gcloud alpha --quiet compute networks subnets delete \
 | 
					    gcloud beta --quiet compute networks subnets delete \
 | 
				
			||||||
      --project "${PROJECT}" \
 | 
					      --project "${PROJECT}" \
 | 
				
			||||||
      --region ${REGION} \
 | 
					      --region ${REGION} \
 | 
				
			||||||
      ${IP_ALIAS_SUBNETWORK}
 | 
					      ${IP_ALIAS_SUBNETWORK}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user