Use GKE specific configuration in startup scripts in GKE deployment.

This commit is contained in:
Ben Hu 2021-04-02 00:10:53 +00:00
parent a651804427
commit a2d094797d
2 changed files with 10 additions and 3 deletions

View File

@ -1269,6 +1269,9 @@ EOF
function create-kubeconfig { function create-kubeconfig {
local component=$1 local component=$1
local token=$2 local token=$2
if [[ -e "${KUBE_HOME}/bin/gke-internal-configure-helper.sh" ]]; then
gke-internal-create-kubeconfig "${component}" "${token}"
else
echo "Creating kubeconfig file for component ${component}" echo "Creating kubeconfig file for component ${component}"
mkdir -p "/etc/srv/kubernetes/${component}" mkdir -p "/etc/srv/kubernetes/${component}"
cat <<EOF >"/etc/srv/kubernetes/${component}/kubeconfig" cat <<EOF >"/etc/srv/kubernetes/${component}/kubeconfig"
@ -1290,6 +1293,7 @@ contexts:
name: ${component} name: ${component}
current-context: ${component} current-context: ${component}
EOF EOF
fi
} }
# Arg 1: the IP address of the API server # Arg 1: the IP address of the API server

View File

@ -95,6 +95,9 @@ function start-kube-apiserver {
if [[ -n "${TLS_CIPHER_SUITES:-}" ]]; then if [[ -n "${TLS_CIPHER_SUITES:-}" ]]; then
params+=" --tls-cipher-suites=${TLS_CIPHER_SUITES}" params+=" --tls-cipher-suites=${TLS_CIPHER_SUITES}"
fi fi
if [[ -e "${KUBE_HOME}/bin/gke-internal-configure-helper.sh" ]]; then
gke-kube-apiserver-internal-sni-param params
fi
params+=" --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname" params+=" --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname"
if [[ -s "${REQUESTHEADER_CA_CERT_PATH:-}" ]]; then if [[ -s "${REQUESTHEADER_CA_CERT_PATH:-}" ]]; then
params+=" --requestheader-client-ca-file=${REQUESTHEADER_CA_CERT_PATH}" params+=" --requestheader-client-ca-file=${REQUESTHEADER_CA_CERT_PATH}"