github.com/deemoprobe/k8s-first-commit@v0.0.0-20230430165612-a541f1982be3/src/release/launch-kubernetes-base.sh (about)

     1  # Copyright 2014 Google Inc. All rights reserved.
     2  #
     3  # Licensed under the Apache License, Version 2.0 (the "License");
     4  # you may not use this file except in compliance with the License.
     5  # You may obtain a copy of the License at
     6  #
     7  #     http://www.apache.org/licenses/LICENSE-2.0
     8  #
     9  # Unless required by applicable law or agreed to in writing, software
    10  # distributed under the License is distributed on an "AS IS" BASIS,
    11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  # See the License for the specific language governing permissions and
    13  # limitations under the License.
    14  
    15  # Prerequisites
    16  # TODO (bburns): Perhaps install cloud SDK automagically if we can't find it?
    17  
    18  # Exit on any error
    19  set -e
    20  
    21  echo "Auto installer for launching Kubernetes"
    22  echo "Release: $RELEASE_PREFIX$RELEASE_NAME"
    23  
    24  # Make sure that prerequisites are installed.
    25  for x in gcloud gsutil; do
    26    if [ "$(which $x)" == "" ]; then
    27      echo "Can't find $x in PATH, please fix and retry."
    28      exit 1
    29    fi
    30  done
    31  
    32  # TODO(jbeda): Provide a way to install this in to someplace beyond a temp dir
    33  # so that users have access to local tools.
    34  TMPDIR=$(mktemp -d /tmp/installer.kubernetes.XXXXXX)
    35  
    36  cd $TMPDIR
    37  
    38  echo "Downloading support files"
    39  gsutil cp $RELEASE_FULL_PATH/launch-kubernetes.tgz .
    40  
    41  tar xzf launch-kubernetes.tgz
    42  
    43  ./src/scripts/kube-up.sh $RELEASE_FULL_PATH
    44  
    45  cd /
    46  
    47  # clean up
    48  # rm -rf $TMPDIR