#!/bin/bash # Copyright 2014 The Kubernetes Authors All rights reserved. # # 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. # The business logic for whether a given object should be created # was already enforced by salt, and /etc/kubernetes/addons is the # managed result is of that. Start everything below that directory. KUBECTL=${KUBECTL_BIN:-/usr/local/bin/kubectl} ADDON_CHECK_INTERVAL_SEC=${TEST_ADDON_CHECK_INTERVAL_SEC:-600} SYSTEM_NAMESPACE=kube-system token_dir=${TOKEN_DIR:-/srv/kubernetes} function create-kubeconfig-secret() { local -r token=$1 local -r username=$2 local -r server=$3 local -r safe_username=$(tr -s ':_' '--' <<< "${username}") # Make a kubeconfig file with the token. if [[ ! -z "${CA_CERT:-}" ]]; then # If the CA cert is available, put it into the secret rather than using # insecure-skip-tls-verify. read -r -d '' kubeconfig <