Replace godep with dep
This commit is contained in:
parent
1e7489927c
commit
bf5616c65b
14883 changed files with 3937406 additions and 361781 deletions
14
vendor/k8s.io/kubernetes/federation/cluster/BUILD
generated
vendored
Normal file
14
vendor/k8s.io/kubernetes/federation/cluster/BUILD
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
filegroup(
|
||||
name = "package-srcs",
|
||||
srcs = glob(["**"]),
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:private"],
|
||||
)
|
||||
|
||||
filegroup(
|
||||
name = "all-srcs",
|
||||
srcs = [":package-srcs"],
|
||||
tags = ["automanaged"],
|
||||
)
|
||||
117
vendor/k8s.io/kubernetes/federation/cluster/common.sh
generated
vendored
Normal file
117
vendor/k8s.io/kubernetes/federation/cluster/common.sh
generated
vendored
Normal file
|
|
@ -0,0 +1,117 @@
|
|||
# Copyright 2014 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.
|
||||
|
||||
# required:
|
||||
# KUBE_ROOT: path of the root of the Kubernetes repository
|
||||
|
||||
: "${KUBE_ROOT?Must set KUBE_ROOT env var}"
|
||||
|
||||
# Provides the $KUBERNETES_PROVIDER, kubeconfig-federation-context()
|
||||
# and detect-project function
|
||||
source "${KUBE_ROOT}/cluster/kube-util.sh"
|
||||
|
||||
# kubefed configuration
|
||||
FEDERATION_NAME="${FEDERATION_NAME:-e2e-federation}"
|
||||
FEDERATION_NAMESPACE=${FEDERATION_NAMESPACE:-federation-system}
|
||||
FEDERATION_KUBE_CONTEXT="${FEDERATION_KUBE_CONTEXT:-${FEDERATION_NAME}}"
|
||||
HOST_CLUSTER_ZONE="${FEDERATION_HOST_CLUSTER_ZONE:-}"
|
||||
# If $HOST_CLUSTER_ZONE isn't specified, arbitrarily choose
|
||||
# last zone as the host cluster zone.
|
||||
if [[ -z "${HOST_CLUSTER_ZONE}" ]]; then
|
||||
E2E_ZONES_ARR=(${E2E_ZONES:-})
|
||||
if [[ ${#E2E_ZONES_ARR[@]} > 0 ]]; then
|
||||
HOST_CLUSTER_ZONE=${E2E_ZONES_ARR[-1]}
|
||||
fi
|
||||
fi
|
||||
|
||||
HOST_CLUSTER_CONTEXT="${FEDERATION_HOST_CLUSTER_CONTEXT:-}"
|
||||
if [[ -z "${HOST_CLUSTER_CONTEXT}" ]]; then
|
||||
# Sets ${CLUSTER_CONTEXT}
|
||||
if [[ -z "${HOST_CLUSTER_ZONE:-}" ]]; then
|
||||
echo "At least one of FEDERATION_HOST_CLUSTER_CONTEXT, FEDERATION_HOST_CLUSTER_ZONE or E2E_ZONES is required."
|
||||
exit 1
|
||||
fi
|
||||
kubeconfig-federation-context "${HOST_CLUSTER_ZONE:-}"
|
||||
HOST_CLUSTER_CONTEXT="${CLUSTER_CONTEXT}"
|
||||
fi
|
||||
|
||||
function federation_cluster_contexts() {
|
||||
local -r contexts=$("${KUBE_ROOT}/cluster/kubectl.sh" config get-contexts -o name)
|
||||
federation_contexts=()
|
||||
for context in ${contexts}; do
|
||||
# Skip federation context
|
||||
if [[ "${context}" == "${FEDERATION_NAME}" ]]; then
|
||||
continue
|
||||
fi
|
||||
# Skip contexts not beginning with "federation"
|
||||
if [[ "${context}" != federation* ]]; then
|
||||
continue
|
||||
fi
|
||||
federation_contexts+=("${context}")
|
||||
done
|
||||
echo ${federation_contexts[@]}
|
||||
}
|
||||
|
||||
|
||||
source "${KUBE_ROOT}/cluster/common.sh"
|
||||
|
||||
host_kubectl="${KUBE_ROOT}/cluster/kubectl.sh --namespace=${FEDERATION_NAMESPACE}"
|
||||
|
||||
function cleanup-federation-api-objects {
|
||||
# This is a cleanup function. We cannot stop on errors here. So disable
|
||||
# errexit in this function.
|
||||
set +o errexit
|
||||
|
||||
echo "Cleaning Federation control plane objects"
|
||||
kube::log::status "Removing namespace \"${FEDERATION_NAMESPACE}\" from \"${FEDERATION_KUBE_CONTEXT}\""
|
||||
# Try deleting until the namespace is completely gone.
|
||||
while $host_kubectl --context="${FEDERATION_KUBE_CONTEXT}" delete namespace "${FEDERATION_NAMESPACE}" >/dev/null 2>&1; do
|
||||
# It is usually slower to remove a namespace because it involves
|
||||
# performing a cascading deletion of all the resources in the
|
||||
# namespace. So we sleep a little longer than other resources
|
||||
# before retrying
|
||||
sleep 5
|
||||
done
|
||||
kube::log::status "Removed namespace \"${FEDERATION_NAMESPACE}\" from \"${FEDERATION_KUBE_CONTEXT}\""
|
||||
|
||||
# This is a big hammer. We get rid of federation-system namespace from
|
||||
# all the clusters
|
||||
for context in $(federation_cluster_contexts); do
|
||||
(
|
||||
local -r role="federation-controller-manager:${FEDERATION_NAME}-${context}-${HOST_CLUSTER_CONTEXT}"
|
||||
kube::log::status "Removing namespace \"${FEDERATION_NAMESPACE}\", cluster role \"${role}\" and cluster role binding \"${role}\" from \"${context}\""
|
||||
# Try deleting until the namespace is completely gone.
|
||||
while $host_kubectl --context="${context}" delete namespace "${FEDERATION_NAMESPACE}" >/dev/null 2>&1; do
|
||||
# It is usually slower to remove a namespace because it involves
|
||||
# performing a cascading deletion of all the resources in the
|
||||
# namespace. So we sleep a little longer than other resources
|
||||
# before retrying
|
||||
sleep 5
|
||||
done
|
||||
kube::log::status "Removed namespace \"${FEDERATION_NAMESPACE}\" from \"${context}\""
|
||||
|
||||
while $host_kubectl --context="${context}" delete clusterrole "${role}" >/dev/null 2>&1; do
|
||||
sleep 2
|
||||
done
|
||||
kube::log::status "Removed cluster role \"${role}\" from \"${context}\""
|
||||
|
||||
while $host_kubectl --context="${context}" delete clusterrolebinding "${role}" >/dev/null 2>&1; do
|
||||
sleep 2
|
||||
done
|
||||
kube::log::status "Removed cluster role binding \"${role}\" from \"${context}\""
|
||||
) &
|
||||
done
|
||||
wait
|
||||
set -o errexit
|
||||
}
|
||||
75
vendor/k8s.io/kubernetes/federation/cluster/federation-down.sh
generated
vendored
Executable file
75
vendor/k8s.io/kubernetes/federation/cluster/federation-down.sh
generated
vendored
Executable file
|
|
@ -0,0 +1,75 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 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 -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(readlink -m $(dirname "${BASH_SOURCE}")/../../)
|
||||
|
||||
# For $FEDERATION_NAME, $FEDERATION_NAMESPACE, $FEDERATION_KUBE_CONTEXT,
|
||||
# and $HOST_CLUSTER_CONTEXT.
|
||||
source "${KUBE_ROOT}/federation/cluster/common.sh"
|
||||
|
||||
# federation_clusters returns a list of all the clusters in
|
||||
# federation, if at all the federation control plane exists
|
||||
# and there are any clusters registered.
|
||||
function federation_clusters() {
|
||||
if clusters=$("${KUBE_ROOT}/cluster/kubectl.sh" \
|
||||
--context="${FEDERATION_KUBE_CONTEXT}" \
|
||||
-o jsonpath --template '{.items[*].metadata.name}' \
|
||||
get clusters) ; then
|
||||
echo ${clusters}
|
||||
return
|
||||
fi
|
||||
echo ""
|
||||
}
|
||||
|
||||
# unjoin_clusters unjoins all the clusters from federation.
|
||||
function unjoin_clusters() {
|
||||
# Unjoin only those clusters that are registered with the
|
||||
# given federation. This is slightly different than
|
||||
# joining clusters where we join all the clusters in the
|
||||
# current kubeconfig with the "federation" prefix.
|
||||
for context in $(federation_clusters); do
|
||||
kube::log::status "Unjoining cluster \"${context}\" from federation \"${FEDERATION_NAME}\""
|
||||
|
||||
"${KUBE_ROOT}/federation/develop/kubefed.sh" unjoin \
|
||||
"${context}" \
|
||||
--federation-system-namespace=${FEDERATION_NAMESPACE} \
|
||||
--context="${FEDERATION_KUBE_CONTEXT}" \
|
||||
--host-cluster-context="${HOST_CLUSTER_CONTEXT}" \
|
||||
--v=4
|
||||
done
|
||||
}
|
||||
|
||||
unjoin_clusters
|
||||
|
||||
if cleanup-federation-api-objects; then
|
||||
# TODO(madhusudancs): This is an arbitrary amount of sleep to give
|
||||
# Kubernetes clusters enough time to delete the underlying cloud
|
||||
# provider resources corresponding to the Kubernetes resources we
|
||||
# deleted as part of the test tear downs. It is shameful that we
|
||||
# are doing this, but this is just a bandage to stop the bleeding.
|
||||
# Please don't use this pattern anywhere. Remove this when proper
|
||||
# cloud provider cleanups are implemented in the individual test
|
||||
# `AfterEach` blocks.
|
||||
# Also, we wait only if the cleanup succeeds.
|
||||
kube::log::status "Waiting for 2 minutes to allow controllers to clean up federation components..."
|
||||
sleep 2m
|
||||
else
|
||||
echo "Couldn't cleanup federation api objects"
|
||||
fi
|
||||
140
vendor/k8s.io/kubernetes/federation/cluster/federation-up.sh
generated
vendored
Executable file
140
vendor/k8s.io/kubernetes/federation/cluster/federation-up.sh
generated
vendored
Executable file
|
|
@ -0,0 +1,140 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright 2014 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 -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# This script is only used for e2e tests! Don't use it in production!
|
||||
# This is also a temporary bridge to slowly switch over everything to
|
||||
# federation/develop.sh. Carefully moving things step-by-step, ensuring
|
||||
# things don't break.
|
||||
# TODO(madhusudancs): Remove this script and its dependencies.
|
||||
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
# For `kube::log::status` function since it already sources
|
||||
# "${KUBE_ROOT}/cluster/lib/logging.sh" and DEFAULT_KUBECONFIG
|
||||
source "${KUBE_ROOT}/cluster/common.sh"
|
||||
# For $FEDERATION_NAME, $FEDERATION_NAMESPACE, $FEDERATION_KUBE_CONTEXT,
|
||||
# and $HOST_CLUSTER_CONTEXT.
|
||||
source "${KUBE_ROOT}/federation/cluster/common.sh"
|
||||
|
||||
DNS_ZONE_NAME="${FEDERATION_DNS_ZONE_NAME:-}"
|
||||
DNS_PROVIDER="${FEDERATION_DNS_PROVIDER:-google-clouddns}"
|
||||
|
||||
# get_version returns the version in KUBERNETES_RELEASE or defaults to the
|
||||
# value in the federation `versions` file.
|
||||
# TODO(madhusudancs): This is a duplicate of the function in
|
||||
# federation/develop/develop.sh with a minor difference. This
|
||||
# function tries to default to the version information in
|
||||
# _output/federation/versions file where as the one in develop.sh
|
||||
# tries to default to the version in the kubernetes versions file.
|
||||
# These functions should be consolidated to read the version from
|
||||
# kubernetes version defs file.
|
||||
function get_version() {
|
||||
local -r versions_file="${KUBE_ROOT}/_output/federation/versions"
|
||||
|
||||
if [[ -n "${KUBERNETES_RELEASE:-}" ]]; then
|
||||
echo "${KUBERNETES_RELEASE//+/_}"
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ ! -f "${versions_file}" ]]; then
|
||||
echo "Couldn't determine the release version: neither the " \
|
||||
"KUBERNETES_RELEASE environment variable is set, nor does " \
|
||||
"the versions file exist at ${versions_file}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Read the version back from the versions file if no version is given.
|
||||
local -r kube_version="$(cat "${versions_file}" | python -c '\
|
||||
import json, sys;\
|
||||
print json.load(sys.stdin)["KUBE_VERSION"]')"
|
||||
|
||||
echo "${kube_version//+/_}"
|
||||
}
|
||||
|
||||
function wait_for_rbac() {
|
||||
# The very first thing that kubefed does when it comes up is run RBAC API
|
||||
# discovery. If it doesn't appear to be available, issue 'get role' to ensure
|
||||
# that kubectl updates its cache.
|
||||
${KUBE_ROOT}/cluster/kubectl.sh get role
|
||||
local i=1
|
||||
local timeout=60
|
||||
while [[ ${i} -le ${timeout} ]]; do
|
||||
if [[ "$(${KUBE_ROOT}/cluster/kubectl.sh api-versions)" =~ "rbac.authorization.k8s.io/" ]]; then
|
||||
break
|
||||
fi
|
||||
${KUBE_ROOT}/cluster/kubectl.sh get role
|
||||
sleep 1
|
||||
i=$((i+1))
|
||||
done
|
||||
if [[ ${i} -gt ${timeout} ]]; then
|
||||
kube::log::status "rbac.authorization.k8s.io API group not available after at least ${timeout} seconds:"
|
||||
kube::log::status "$(${KUBE_ROOT}/cluster/kubectl.sh api-versions)"
|
||||
exit 123
|
||||
fi
|
||||
kube::log::status "rbac.authorization.k8s.io API group is available"
|
||||
}
|
||||
|
||||
# Initializes the control plane.
|
||||
# TODO(madhusudancs): Move this to federation/develop.sh.
|
||||
function init() {
|
||||
kube::log::status "Deploying federation control plane for ${FEDERATION_NAME} in cluster ${HOST_CLUSTER_CONTEXT}"
|
||||
|
||||
local -r project="${KUBE_PROJECT:-${PROJECT:-}}"
|
||||
local -r kube_registry="${KUBE_REGISTRY:-gcr.io/${project}}"
|
||||
local -r kube_version="$(get_version)"
|
||||
|
||||
kube::log::status "DNS_ZONE_NAME: \"${DNS_ZONE_NAME}\", DNS_PROVIDER: \"${DNS_PROVIDER}\""
|
||||
kube::log::status "Image: \"${kube_registry}/hyperkube-amd64:${kube_version}\""
|
||||
|
||||
wait_for_rbac
|
||||
|
||||
# Send INT after 20m and KILL 1m after that if process is still alive.
|
||||
timeout --signal=INT --kill-after=1m 20m \
|
||||
"${KUBE_ROOT}/federation/develop/kubefed.sh" init \
|
||||
"${FEDERATION_NAME}" \
|
||||
--federation-system-namespace=${FEDERATION_NAMESPACE} \
|
||||
--host-cluster-context="${HOST_CLUSTER_CONTEXT}" \
|
||||
--dns-zone-name="${DNS_ZONE_NAME}" \
|
||||
--dns-provider="${DNS_PROVIDER}" \
|
||||
--image="${kube_registry}/hyperkube-amd64:${kube_version}" \
|
||||
--apiserver-enable-basic-auth=true \
|
||||
--apiserver-enable-token-auth=true \
|
||||
--apiserver-arg-overrides="--runtime-config=api/all=true,--v=4" \
|
||||
--controllermanager-arg-overrides="--v=4" \
|
||||
--v=4
|
||||
}
|
||||
|
||||
# join_clusters joins the clusters in the local kubeconfig to federation. The clusters
|
||||
# and their kubeconfig entries in the local kubeconfig are created while deploying clusters, i.e. when kube-up is run.
|
||||
function join_clusters() {
|
||||
for context in $(federation_cluster_contexts); do
|
||||
kube::log::status "Joining cluster with name '${context}' to federation with name '${FEDERATION_NAME}'"
|
||||
|
||||
"${KUBE_ROOT}/federation/develop/kubefed.sh" join \
|
||||
"${context}" \
|
||||
--federation-system-namespace=${FEDERATION_NAMESPACE} \
|
||||
--host-cluster-context="${HOST_CLUSTER_CONTEXT}" \
|
||||
--context="${FEDERATION_KUBE_CONTEXT}" \
|
||||
--v=4
|
||||
done
|
||||
}
|
||||
|
||||
init
|
||||
join_clusters
|
||||
89
vendor/k8s.io/kubernetes/federation/cluster/log-dump.sh
generated
vendored
Executable file
89
vendor/k8s.io/kubernetes/federation/cluster/log-dump.sh
generated
vendored
Executable file
|
|
@ -0,0 +1,89 @@
|
|||
#!/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.
|
||||
|
||||
# Call this to dump all Federation pod logs into the folder specified in $1
|
||||
# (defaults to _artifacts).
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
# For FEDERATION_NAMESPACE
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
source "${KUBE_ROOT}/federation/cluster/common.sh"
|
||||
|
||||
readonly REPORT_DIR="${1:-_artifacts}"
|
||||
OUTPUT_DIR="${REPORT_DIR}/federation"
|
||||
|
||||
# Dumps logs for all pods in a federation.
|
||||
function dump_federation_pod_logs() {
|
||||
local -r federation_pod_names_string="$(kubectl get pods -l 'app=federated-cluster' --namespace=${FEDERATION_NAMESPACE} -o name)"
|
||||
if [[ -z "${federation_pod_names_string}" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local -r federation_pod_names=(${federation_pod_names_string})
|
||||
for pod_name in ${federation_pod_names[@]}; do
|
||||
# The API server pod has two containers
|
||||
if [[ "${pod_name}" == *apiserver* ]]; then
|
||||
dump_apiserver_pod_logs "${pod_name}"
|
||||
continue
|
||||
fi
|
||||
|
||||
kubectl logs "${pod_name}" --namespace="${FEDERATION_NAMESPACE}" \
|
||||
>"${OUTPUT_DIR}/${pod_name#pods/}.log"
|
||||
done
|
||||
}
|
||||
|
||||
# Dumps logs from all containers in an API server pod.
|
||||
# Arguments:
|
||||
# - the name of the API server pod, with a pods/ prefix.
|
||||
function dump_apiserver_pod_logs() {
|
||||
local -r apiserver_pod_containers=(apiserver etcd)
|
||||
for container in ${apiserver_pod_containers[@]}; do
|
||||
kubectl logs "${1}" -c "${container}" --namespace="${FEDERATION_NAMESPACE}" \
|
||||
>"${OUTPUT_DIR}/${1#pods/}-${container}.log"
|
||||
done
|
||||
}
|
||||
|
||||
# Dumps logs from all containers in the DNS pods.
|
||||
# TODO: This currently only grabs DNS pod logs from the host cluster. It should
|
||||
# grab those logs from all clusters in the federation.
|
||||
function dump_dns_pod_logs() {
|
||||
local -r dns_pod_names_string="$(kubectl get pods -l 'k8s-app=kube-dns' --namespace=kube-system -o name)"
|
||||
if [[ -z "${dns_pod_names_string}" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local -r dns_pod_names=(${dns_pod_names_string})
|
||||
local -r dns_pod_containers=(kubedns dnsmasq sidecar)
|
||||
|
||||
for pod_name in ${dns_pod_names[@]}; do
|
||||
# As of 3/2017, the only pod that matches the kube-dns label is kube-dns, and
|
||||
# it has three containers.
|
||||
for container in ${dns_pod_containers[@]}; do
|
||||
kubectl logs "${pod_name}" -c "${container}" --namespace=kube-system \
|
||||
>"${OUTPUT_DIR}/${pod_name#pods/}-${container}.log"
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
echo "Dumping Federation and DNS pod logs to ${REPORT_DIR}"
|
||||
mkdir -p "${OUTPUT_DIR}"
|
||||
|
||||
dump_federation_pod_logs
|
||||
dump_dns_pod_logs
|
||||
46
vendor/k8s.io/kubernetes/federation/cluster/upgrade.sh
generated
vendored
Executable file
46
vendor/k8s.io/kubernetes/federation/cluster/upgrade.sh
generated
vendored
Executable file
|
|
@ -0,0 +1,46 @@
|
|||
#!/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 -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../..
|
||||
# For `kube::log::status` function since it already sources
|
||||
# "${KUBE_ROOT}/cluster/lib/logging.sh"
|
||||
source "${KUBE_ROOT}/cluster/common.sh"
|
||||
# For $FEDERATION_NAME, $FEDERATION_NAMESPACE, $HOST_CLUSTER_CONTEXT,
|
||||
source "${KUBE_ROOT}/federation/cluster/common.sh"
|
||||
|
||||
KUBE_VERSION="${1}"
|
||||
|
||||
host_kubectl="${KUBE_ROOT}/cluster/kubectl.sh --context=${HOST_CLUSTER_CONTEXT} --namespace=${FEDERATION_NAMESPACE}"
|
||||
|
||||
function upgrade() {
|
||||
local -r project="${KUBE_PROJECT:-${PROJECT:-}}"
|
||||
local -r kube_registry="${KUBE_REGISTRY:-gcr.io/${project}}"
|
||||
local -r image_version="${kube_registry}/hyperkube-amd64:${KUBE_VERSION}"
|
||||
|
||||
kube::log::status "Upgrading federation control plane ${FEDERATION_NAME} with image ${image_version}"
|
||||
|
||||
# Upgrade apiserver image
|
||||
${host_kubectl} set image deployment/federation-apiserver apiserver=${image_version}
|
||||
|
||||
# Upgrade controller-manager image
|
||||
${host_kubectl} set image deployment/federation-controller-manager controller-manager=${image_version}
|
||||
}
|
||||
|
||||
upgrade
|
||||
Loading…
Add table
Add a link
Reference in a new issue