Skip to content

Commit

Permalink
Stop using kube-apiserver flags that were removed in 1.24
Browse files Browse the repository at this point in the history
  • Loading branch information
Fedosin committed May 24, 2022
1 parent 1c7383c commit eeb6ba3
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ rules:
- apiGroups:
- "certificates.k8s.io"
resources:
- certificatesigningrequests
- certificatesigningrequests/nodeclient
verbs:
- "create"
Expand Down
11 changes: 0 additions & 11 deletions cluster/gce/gci/configure-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1988,7 +1988,6 @@ function start-konnectivity-server {
# DOCKER_REGISTRY
# FLEXVOLUME_HOSTPATH_MOUNT
# FLEXVOLUME_HOSTPATH_VOLUME
# INSECURE_PORT_MAPPING
function compute-master-manifest-variables {
CLOUD_CONFIG_OPT=""
CLOUD_CONFIG_VOLUME=""
Expand All @@ -2010,14 +2009,7 @@ function compute-master-manifest-variables {
FLEXVOLUME_HOSTPATH_VOLUME="{ \"name\": \"flexvolumedir\", \"hostPath\": {\"path\": \"${VOLUME_PLUGIN_DIR}\"}},"
fi

INSECURE_PORT_MAPPING=""
if [[ "${ENABLE_APISERVER_INSECURE_PORT:-false}" == "true" ]]; then
# INSECURE_PORT_MAPPING is used by sed
# shellcheck disable=SC2089
INSECURE_PORT_MAPPING='{ "name": "local", "containerPort": 8080, "hostPort": 8080},'
fi
# shellcheck disable=SC2090
export INSECURE_PORT_MAPPING
}

# A helper function that bind mounts kubelet dirs for running mount in a chroot
Expand Down Expand Up @@ -3430,9 +3422,6 @@ function main() {
fi
ADDON_MANAGER_TOKEN="$(secure_random 32)"
PDCSI_CONTROLLER_TOKEN="$(secure_random 32)"
if [[ "${ENABLE_APISERVER_INSECURE_PORT:-false}" != "true" ]]; then
KUBE_BOOTSTRAP_TOKEN="$(secure_random 32)"
fi
if [[ "${PREPARE_KONNECTIVITY_SERVICE:-false}" == "true" ]]; then
KONNECTIVITY_SERVER_TOKEN="$(secure_random 32)"
fi
Expand Down
11 changes: 0 additions & 11 deletions cluster/gce/gci/configure-kubeapiserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,13 @@ function configure-etcd-params {
# CLOUD_CONFIG_VOLUME
# CLOUD_CONFIG_MOUNT
# DOCKER_REGISTRY
# INSECURE_PORT_MAPPING
function start-kube-apiserver {
echo "Start kubernetes api-server"
prepare-log-file "${KUBE_API_SERVER_LOG_PATH:-/var/log/kube-apiserver.log}" "${KUBE_API_SERVER_RUNASUSER:-0}"
prepare-log-file "${KUBE_API_SERVER_AUDIT_LOG_PATH:-/var/log/kube-apiserver-audit.log}" "${KUBE_API_SERVER_RUNASUSER:-0}"

# Calculate variables and assemble the command line.
local params="${API_SERVER_TEST_LOG_LEVEL:-"--v=2"} ${APISERVER_TEST_ARGS:-} ${CLOUD_CONFIG_OPT}"
params+=" --address=127.0.0.1"
params+=" --allow-privileged=true"
params+=" --cloud-provider=external"
params+=" --client-ca-file=${CA_CERT_BUNDLE_PATH}"
Expand All @@ -76,10 +74,6 @@ function start-kube-apiserver {
configure-etcd-params params

params+=" --secure-port=443"
if [[ "${ENABLE_APISERVER_INSECURE_PORT:-false}" != "true" ]]; then
# Default is :8080
params+=" --insecure-port=0"
fi
params+=" --tls-cert-file=${APISERVER_SERVER_CERT_PATH}"
params+=" --tls-private-key-file=${APISERVER_SERVER_KEY_PATH}"
if [[ -n "${OLD_MASTER_IP:-}" ]]; then
Expand Down Expand Up @@ -137,10 +131,6 @@ function start-kube-apiserver {
params=$(append-param-if-not-present "${params}" "max-requests-inflight" 1500)
params=$(append-param-if-not-present "${params}" "max-mutating-requests-inflight" 500)
fi
# Set amount of memory available for apiserver based on number of nodes.
# TODO: Once we start setting proper requests and limits for apiserver
# we should reuse the same logic here instead of current heuristic.
params=$(append-param-if-not-present "${params}" "target-ram-mb" $((NUM_NODES * 60)))
fi
if [[ -n "${SERVICE_CLUSTER_IP_RANGE:-}" ]]; then
params+=" --service-cluster-ip-range=${SERVICE_CLUSTER_IP_RANGE}"
Expand Down Expand Up @@ -388,7 +378,6 @@ function start-kube-apiserver {
sed -i -e "s@{{pillar\['allow_privileged'\]}}@true@g" "${src_file}"
sed -i -e "s@{{liveness_probe_initial_delay}}@${KUBE_APISERVER_LIVENESS_PROBE_INITIAL_DELAY_SEC:-15}@g" "${src_file}"
sed -i -e "s@{{secure_port}}@443@g" "${src_file}"
sed -i -e "s@{{insecure_port_mapping}}@${INSECURE_PORT_MAPPING}@g" "${src_file}"
sed -i -e "s@{{additional_cloud_config_mount}}@@g" "${src_file}"
sed -i -e "s@{{additional_cloud_config_volume}}@@g" "${src_file}"
sed -i -e "s@{{webhook_authn_config_mount}}@${webhook_authn_config_mount}@g" "${src_file}"
Expand Down
1 change: 0 additions & 1 deletion cluster/gce/gci/testdata/kube-apiserver/base.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ readonly APISERVER_SERVER_KEY_PATH=/foo/bar
readonly APISERVER_CLIENT_CERT_PATH=/foo/bar
readonly CLOUD_CONFIG_MOUNT="{\"name\": \"cloudconfigmount\",\"mountPath\": \"/etc/gce.conf\", \"readOnly\": true},"
readonly CLOUD_CONFIG_VOLUME="{\"name\": \"cloudconfigmount\",\"hostPath\": {\"path\": \"/etc/gce.conf\", \"type\": \"FileOrCreate\"}},"
readonly INSECURE_PORT_MAPPING="{ \"name\": \"local\", \"containerPort\": 8080, \"hostPort\": 8080},"
readonly DOCKER_REGISTRY="k8s.gcr.io"
readonly ENABLE_LEGACY_ABAC=false
readonly ETC_MANIFESTS=${KUBE_HOME}/etc/kubernetes/manifests
Expand Down
1 change: 0 additions & 1 deletion cluster/gce/manifests/kube-apiserver.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"timeoutSeconds": 15
},
"ports":[
{{insecure_port_mapping}}
{ "name": "https",
"containerPort": {{secure_port}},
"hostPort": {{secure_port}}}
Expand Down

0 comments on commit eeb6ba3

Please sign in to comment.