mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Make log-dump use 'gcloud ssh' for GKE also
This commit is contained in:
parent
b05d8ad1ec
commit
05fcefc0df
@ -56,9 +56,10 @@ readonly systemd_services="kubelet docker"
|
|||||||
# file descriptors for large clusters.
|
# file descriptors for large clusters.
|
||||||
readonly max_scp_processes=25
|
readonly max_scp_processes=25
|
||||||
|
|
||||||
|
# TODO: Get rid of all the sourcing of bash dependencies eventually.
|
||||||
function setup() {
|
function setup() {
|
||||||
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||||
if [[ -z "${use_custom_instance_list}" ]]; then
|
if [[ -z "${use_custom_instance_list}" ]]; then
|
||||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
|
||||||
: ${KUBE_CONFIG_FILE:="config-test.sh"}
|
: ${KUBE_CONFIG_FILE:="config-test.sh"}
|
||||||
echo "Sourcing kube-util.sh"
|
echo "Sourcing kube-util.sh"
|
||||||
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||||
@ -66,6 +67,8 @@ function setup() {
|
|||||||
detect-project 2>&1
|
detect-project 2>&1
|
||||||
elif [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
|
elif [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
|
||||||
echo "Using 'use_custom_instance_list' with gke, skipping check for LOG_DUMP_SSH_KEY and LOG_DUMP_SSH_USER"
|
echo "Using 'use_custom_instance_list' with gke, skipping check for LOG_DUMP_SSH_KEY and LOG_DUMP_SSH_USER"
|
||||||
|
# Source the below script for the ssh-to-node utility function.
|
||||||
|
source "${KUBE_ROOT}/cluster/gce/util.sh"
|
||||||
elif [[ -z "${LOG_DUMP_SSH_KEY:-}" ]]; then
|
elif [[ -z "${LOG_DUMP_SSH_KEY:-}" ]]; then
|
||||||
echo "LOG_DUMP_SSH_KEY not set, but required when using log_dump_custom_get_instances"
|
echo "LOG_DUMP_SSH_KEY not set, but required when using log_dump_custom_get_instances"
|
||||||
exit 1
|
exit 1
|
||||||
@ -76,7 +79,7 @@ function setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function log-dump-ssh() {
|
function log-dump-ssh() {
|
||||||
if [[ -z "${use_custom_instance_list}" ]]; then
|
if [[ "${gcloud_supported_providers}" =~ "${KUBERNETES_PROVIDER}" ]]; then
|
||||||
ssh-to-node "$@"
|
ssh-to-node "$@"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user