From 9a217217c13dd85ecc6b6c4dca5efc705aba48bb Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 25 Oct 2017 16:40:08 -0400 Subject: [PATCH] Fix log collection for kubeadm-gce tests Separate out kuberenetes-anywhere provider under cluster/ but delegate all the functionality to the "gce" one since the code would be the same. Except for the name of the node, the NODE_INSTANCE_PREFIX will be different, so account for that. --- cluster/gce/util.sh | 3 ++- cluster/kubernetes-anywhere/util.sh | 20 ++++++++++++++++++++ cluster/log-dump/log-dump.sh | 8 ++++---- 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100755 cluster/kubernetes-anywhere/util.sh diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index 334fe6970d5..5508be0fe42 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -84,7 +84,8 @@ if [[ "${ENABLE_CLUSTER_AUTOSCALER}" == "true" ]]; then fi fi -NODE_INSTANCE_PREFIX="${INSTANCE_PREFIX}-minion" +NODE_INSTANCE_PREFIX=${NODE_INSTANCE_PREFIX:-"${INSTANCE_PREFIX}-minion"} + NODE_TAGS="${NODE_TAG}" ALLOCATE_NODE_CIDRS=true diff --git a/cluster/kubernetes-anywhere/util.sh b/cluster/kubernetes-anywhere/util.sh new file mode 100755 index 00000000000..8d80b103dab --- /dev/null +++ b/cluster/kubernetes-anywhere/util.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -x + +NODE_INSTANCE_PREFIX=${NODE_INSTANCE_PREFIX:-"${INSTANCE_PREFIX}-node"} + +source "${KUBE_ROOT}/cluster/gce/util.sh" diff --git a/cluster/log-dump/log-dump.sh b/cluster/log-dump/log-dump.sh index bb13ef3838a..9e29a8989ea 100755 --- a/cluster/log-dump/log-dump.sh +++ b/cluster/log-dump/log-dump.sh @@ -37,9 +37,9 @@ else readonly use_custom_instance_list= fi -readonly master_ssh_supported_providers="gce aws" -readonly node_ssh_supported_providers="gce gke aws" -readonly gcloud_supported_providers="gce gke" +readonly master_ssh_supported_providers="gce aws kubernetes-anywhere" +readonly node_ssh_supported_providers="gce gke aws kubernetes-anywhere" +readonly gcloud_supported_providers="gce gke kubernetes-anywhere" readonly master_logfiles="kube-apiserver kube-apiserver-audit kube-scheduler rescheduler kube-controller-manager etcd etcd-events glbc cluster-autoscaler kube-addon-manager fluentd" readonly node_logfiles="kube-proxy fluentd node-problem-detector" @@ -141,7 +141,7 @@ function save-logs() { fi else case "${KUBERNETES_PROVIDER}" in - gce|gke) + gce|gke|kubernetes-anywhere) files="${files} ${gce_logfiles}" ;; aws)