mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Update after review comment
Change-Id: Icc2281b98a0240e177f6d8b625a8ddc4f4161b79 Signed-off-by: Joakim Roubert <joakimr@axis.com>
This commit is contained in:
parent
251c4111d5
commit
c33672b010
@ -754,9 +754,9 @@ function construct-common-kubelet-flags {
|
|||||||
# Sets KUBELET_ARGS with the kubelet flags for Linux nodes.
|
# Sets KUBELET_ARGS with the kubelet flags for Linux nodes.
|
||||||
# $1: if 'true', we're rendering flags for a master, else a node
|
# $1: if 'true', we're rendering flags for a master, else a node
|
||||||
function construct-linux-kubelet-flags {
|
function construct-linux-kubelet-flags {
|
||||||
local node_type=$1
|
local node_type="$1"
|
||||||
local flags
|
local flags
|
||||||
flags=$(construct-common-kubelet-flags)
|
flags="$(construct-common-kubelet-flags)"
|
||||||
# Keep in sync with CONTAINERIZED_MOUNTER_HOME in configure-helper.sh
|
# Keep in sync with CONTAINERIZED_MOUNTER_HOME in configure-helper.sh
|
||||||
flags+=" --experimental-mounter-path=/home/kubernetes/containerized_mounter/mounter"
|
flags+=" --experimental-mounter-path=/home/kubernetes/containerized_mounter/mounter"
|
||||||
flags+=" --experimental-check-node-capabilities-before-mount=true"
|
flags+=" --experimental-check-node-capabilities-before-mount=true"
|
||||||
@ -816,7 +816,7 @@ function construct-linux-kubelet-flags {
|
|||||||
fi
|
fi
|
||||||
flags+=" --volume-plugin-dir=${VOLUME_PLUGIN_DIR}"
|
flags+=" --volume-plugin-dir=${VOLUME_PLUGIN_DIR}"
|
||||||
local node_labels
|
local node_labels
|
||||||
node_labels=$(build-linux-node-labels "${node_type}")
|
node_labels="$(build-linux-node-labels "${node_type}")"
|
||||||
if [[ -n "${node_labels:-}" ]]; then
|
if [[ -n "${node_labels:-}" ]]; then
|
||||||
flags+=" --node-labels=${node_labels}"
|
flags+=" --node-labels=${node_labels}"
|
||||||
fi
|
fi
|
||||||
@ -845,13 +845,13 @@ function construct-linux-kubelet-flags {
|
|||||||
# string delimiters.
|
# string delimiters.
|
||||||
function construct-windows-kubelet-flags {
|
function construct-windows-kubelet-flags {
|
||||||
local flags
|
local flags
|
||||||
flags=$(construct-common-kubelet-flags)
|
flags="$(construct-common-kubelet-flags)"
|
||||||
|
|
||||||
# Note: NODE_KUBELET_TEST_ARGS is empty in typical kube-up runs.
|
# Note: NODE_KUBELET_TEST_ARGS is empty in typical kube-up runs.
|
||||||
flags+=" ${NODE_KUBELET_TEST_ARGS:-}"
|
flags+=" ${NODE_KUBELET_TEST_ARGS:-}"
|
||||||
|
|
||||||
local node_labels
|
local node_labels
|
||||||
node_labels=$(build-windows-node-labels)
|
node_labels="$(build-windows-node-labels)"
|
||||||
if [[ -n "${node_labels:-}" ]]; then
|
if [[ -n "${node_labels:-}" ]]; then
|
||||||
flags+=" --node-labels=${node_labels}"
|
flags+=" --node-labels=${node_labels}"
|
||||||
fi
|
fi
|
||||||
@ -1843,7 +1843,8 @@ function get-env-val() {
|
|||||||
# Load the master env by calling get-master-env, and extract important values
|
# Load the master env by calling get-master-env, and extract important values
|
||||||
function parse-master-env() {
|
function parse-master-env() {
|
||||||
# Get required master env vars
|
# Get required master env vars
|
||||||
local master_env=$(get-master-env)
|
local master_env
|
||||||
|
master_env=$(get-master-env)
|
||||||
KUBE_PROXY_TOKEN=$(get-env-val "${master_env}" "KUBE_PROXY_TOKEN")
|
KUBE_PROXY_TOKEN=$(get-env-val "${master_env}" "KUBE_PROXY_TOKEN")
|
||||||
NODE_PROBLEM_DETECTOR_TOKEN=$(get-env-val "${master_env}" "NODE_PROBLEM_DETECTOR_TOKEN")
|
NODE_PROBLEM_DETECTOR_TOKEN=$(get-env-val "${master_env}" "NODE_PROBLEM_DETECTOR_TOKEN")
|
||||||
CA_CERT_BASE64=$(get-env-val "${master_env}" "CA_CERT")
|
CA_CERT_BASE64=$(get-env-val "${master_env}" "CA_CERT")
|
||||||
@ -2278,7 +2279,7 @@ function check-existing() {
|
|||||||
|
|
||||||
function check-network-mode() {
|
function check-network-mode() {
|
||||||
local mode
|
local mode
|
||||||
mode=$(gcloud compute networks list --filter="name=('${NETWORK}')" --project "${NETWORK_PROJECT}" --format='value(x_gcloud_subnet_mode)' || true)
|
mode="$(gcloud compute networks list --filter="name=('${NETWORK}')" --project "${NETWORK_PROJECT}" --format='value(x_gcloud_subnet_mode)' || true)"
|
||||||
# The deprecated field uses lower case. Convert to upper case for consistency.
|
# The deprecated field uses lower case. Convert to upper case for consistency.
|
||||||
echo "$mode" | tr '[:lower:]' '[:upper:]'
|
echo "$mode" | tr '[:lower:]' '[:upper:]'
|
||||||
}
|
}
|
||||||
@ -2370,8 +2371,9 @@ function create-subnetworks() {
|
|||||||
|
|
||||||
# Look for the alias subnet, it must exist and have a secondary
|
# Look for the alias subnet, it must exist and have a secondary
|
||||||
# range configured.
|
# range configured.
|
||||||
local subnet
|
# Deliberately declare and assign at the same time or the CI pipeline fails
|
||||||
subnet=$(gcloud compute networks subnets describe \
|
# shellcheck disable=SC2155
|
||||||
|
local subnet=$(gcloud compute networks subnets describe \
|
||||||
--project "${NETWORK_PROJECT}" \
|
--project "${NETWORK_PROJECT}" \
|
||||||
--region ${REGION} \
|
--region ${REGION} \
|
||||||
${IP_ALIAS_SUBNETWORK} 2>/dev/null)
|
${IP_ALIAS_SUBNETWORK} 2>/dev/null)
|
||||||
@ -2758,7 +2760,7 @@ function replicate-master() {
|
|||||||
--size "${MASTER_DISK_SIZE}"
|
--size "${MASTER_DISK_SIZE}"
|
||||||
|
|
||||||
local existing_master_replicas
|
local existing_master_replicas
|
||||||
existing_master_replicas=$(get-all-replica-names)
|
existing_master_replicas="$(get-all-replica-names)"
|
||||||
replicate-master-instance "${EXISTING_MASTER_ZONE}" "${EXISTING_MASTER_NAME}" "${existing_master_replicas}"
|
replicate-master-instance "${EXISTING_MASTER_ZONE}" "${EXISTING_MASTER_NAME}" "${existing_master_replicas}"
|
||||||
|
|
||||||
# Add new replica to the load balancer.
|
# Add new replica to the load balancer.
|
||||||
@ -2819,7 +2821,7 @@ function create-loadbalancer() {
|
|||||||
|
|
||||||
local EXISTING_MASTER_NAME
|
local EXISTING_MASTER_NAME
|
||||||
local EXISTING_MASTER_ZONE
|
local EXISTING_MASTER_ZONE
|
||||||
EXISTING_MASTER_NAME=$(get-all-replica-names)
|
EXISTING_MASTER_NAME="$(get-all-replica-names)"
|
||||||
EXISTING_MASTER_ZONE=$(gcloud compute instances list "${EXISTING_MASTER_NAME}" \
|
EXISTING_MASTER_ZONE=$(gcloud compute instances list "${EXISTING_MASTER_NAME}" \
|
||||||
--project "${PROJECT}" --format='value(zone)')
|
--project "${PROJECT}" --format='value(zone)')
|
||||||
|
|
||||||
@ -2910,7 +2912,7 @@ function create-internal-loadbalancer() {
|
|||||||
|
|
||||||
local EXISTING_MASTER_NAME
|
local EXISTING_MASTER_NAME
|
||||||
local EXISTING_MASTER_ZONE
|
local EXISTING_MASTER_ZONE
|
||||||
EXISTING_MASTER_NAME=$(get-all-replica-names)
|
EXISTING_MASTER_NAME="$(get-all-replica-names)"
|
||||||
EXISTING_MASTER_ZONE=$(gcloud compute instances list "${EXISTING_MASTER_NAME}" \
|
EXISTING_MASTER_ZONE=$(gcloud compute instances list "${EXISTING_MASTER_NAME}" \
|
||||||
--project "${PROJECT}" --format='value(zone)')
|
--project "${PROJECT}" --format='value(zone)')
|
||||||
|
|
||||||
@ -3190,7 +3192,8 @@ function create-windows-nodes() {
|
|||||||
function create-heapster-node() {
|
function create-heapster-node() {
|
||||||
local gcloud="gcloud"
|
local gcloud="gcloud"
|
||||||
|
|
||||||
local network=$(make-gcloud-network-argument \
|
local network
|
||||||
|
network=$(make-gcloud-network-argument \
|
||||||
"${NETWORK_PROJECT}" \
|
"${NETWORK_PROJECT}" \
|
||||||
"${REGION}" \
|
"${REGION}" \
|
||||||
"${NETWORK}" \
|
"${NETWORK}" \
|
||||||
@ -3525,7 +3528,7 @@ function kube-down() {
|
|||||||
detect-master
|
detect-master
|
||||||
local REMAINING_REPLICA_NAME
|
local REMAINING_REPLICA_NAME
|
||||||
local REMAINING_REPLICA_ZONE
|
local REMAINING_REPLICA_ZONE
|
||||||
REMAINING_REPLICA_NAME=$(get-all-replica-names)
|
REMAINING_REPLICA_NAME="$(get-all-replica-names)"
|
||||||
REMAINING_REPLICA_ZONE=$(gcloud compute instances list "${REMAINING_REPLICA_NAME}" \
|
REMAINING_REPLICA_ZONE=$(gcloud compute instances list "${REMAINING_REPLICA_NAME}" \
|
||||||
--project "${PROJECT}" --format='value(zone)')
|
--project "${PROJECT}" --format='value(zone)')
|
||||||
if gcloud compute forwarding-rules describe "${MASTER_NAME}" --region "${REGION}" --project "${PROJECT}" &>/dev/null; then
|
if gcloud compute forwarding-rules describe "${MASTER_NAME}" --region "${REGION}" --project "${PROJECT}" &>/dev/null; then
|
||||||
@ -3915,7 +3918,7 @@ function test-teardown() {
|
|||||||
"${NODE_TAG}-nodeports"
|
"${NODE_TAG}-nodeports"
|
||||||
if [[ ${MULTIZONE:-} == "true" && -n ${E2E_ZONES:-} ]]; then
|
if [[ ${MULTIZONE:-} == "true" && -n ${E2E_ZONES:-} ]]; then
|
||||||
local zones
|
local zones
|
||||||
while IFS= read -r line; do zones+=("$line"); done <<< "${E2E_ZONES}"
|
read -r -a zones <<< "${E2E_ZONES}"
|
||||||
# tear them down in reverse order, finally tearing down the master too.
|
# tear them down in reverse order, finally tearing down the master too.
|
||||||
for ((zone_num=${#zones[@]}-1; zone_num>0; zone_num--)); do
|
for ((zone_num=${#zones[@]}-1; zone_num>0; zone_num--)); do
|
||||||
KUBE_GCE_ZONE="${zones[zone_num]}" KUBE_USE_EXISTING_MASTER="true" "${KUBE_ROOT}/cluster/kube-down.sh"
|
KUBE_GCE_ZONE="${zones[zone_num]}" KUBE_USE_EXISTING_MASTER="true" "${KUBE_ROOT}/cluster/kube-down.sh"
|
||||||
|
Loading…
Reference in New Issue
Block a user