mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
don't ship kube-registry-proxy and pause in tars.
pause is built into containervm. if it's not on the machine we should just pull it. nobody that I'm aware of uses kube-registry-proxy and it makes build/deployment more complicated and slower.
This commit is contained in:
parent
0d0eb0119e
commit
32426d6e97
@ -130,12 +130,6 @@ kube::build::get_docker_wrapped_binaries() {
|
|||||||
echo "${targets[@]}"
|
echo "${targets[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# The set of addons images that should be prepopulated on linux/amd64
|
|
||||||
readonly KUBE_ADDON_PATHS=(
|
|
||||||
gcr.io/google_containers/pause:2.0
|
|
||||||
gcr.io/google_containers/kube-registry-proxy:0.3
|
|
||||||
)
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Basic setup functions
|
# Basic setup functions
|
||||||
|
|
||||||
@ -755,11 +749,6 @@ function kube::release::package_server_tarballs() {
|
|||||||
|
|
||||||
kube::release::create_docker_images_for_server "${release_stage}/server/bin" "${arch}"
|
kube::release::create_docker_images_for_server "${release_stage}/server/bin" "${arch}"
|
||||||
|
|
||||||
# Only release addon images for linux/amd64. These addon images aren't necessary for other architectures
|
|
||||||
if [[ ${platform} == "linux/amd64" ]]; then
|
|
||||||
kube::release::write_addon_docker_images_for_server "${release_stage}/addons"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Include the client binaries here too as they are useful debugging tools.
|
# Include the client binaries here too as they are useful debugging tools.
|
||||||
local client_bins=("${KUBE_CLIENT_BINARIES[@]}")
|
local client_bins=("${KUBE_CLIENT_BINARIES[@]}")
|
||||||
if [[ "${platform%/*}" == "windows" ]]; then
|
if [[ "${platform%/*}" == "windows" ]]; then
|
||||||
@ -864,40 +853,6 @@ function kube::release::create_docker_images_for_server() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# This will pull and save docker images for addons which need to placed
|
|
||||||
# on the nodes directly.
|
|
||||||
function kube::release::write_addon_docker_images_for_server() {
|
|
||||||
# Create a sub-shell so that we don't pollute the outer environment
|
|
||||||
(
|
|
||||||
local addon_path
|
|
||||||
for addon_path in "${KUBE_ADDON_PATHS[@]}"; do
|
|
||||||
(
|
|
||||||
kube::log::status "Pulling and writing Docker image for addon: ${addon_path}"
|
|
||||||
|
|
||||||
local dest_name="${addon_path//\//\~}"
|
|
||||||
if [[ -z $("${DOCKER[@]}" images | awk '{print ($1":"$2)}' | grep "${addon_path}") ]]; then
|
|
||||||
kube::log::status "Addon image ${addon_path} does not exist, pulling it..."
|
|
||||||
"${DOCKER[@]}" pull "${addon_path}"
|
|
||||||
fi
|
|
||||||
"${DOCKER[@]}" save "${addon_path}" > "${1}/${dest_name}.tar"
|
|
||||||
) &
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ ! -z "${BUILD_PYTHON_IMAGE:-}" ]]; then
|
|
||||||
(
|
|
||||||
kube::log::status "Building Docker python image"
|
|
||||||
|
|
||||||
local img_name=python:2.7-slim-pyyaml
|
|
||||||
"${DOCKER[@]}" build -t "${img_name}" "${KUBE_ROOT}/cluster/addons/python-image"
|
|
||||||
"${DOCKER[@]}" save "${img_name}" > "${1}/${img_name}.tar"
|
|
||||||
) &
|
|
||||||
fi
|
|
||||||
|
|
||||||
kube::util::wait-for-jobs || { kube::log::error "unable to pull or write addon image"; return 1; }
|
|
||||||
kube::log::status "Addon images done"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
# Package up the salt configuration tree. This is an optional helper to getting
|
# Package up the salt configuration tree. This is an optional helper to getting
|
||||||
# a cluster up and running.
|
# a cluster up and running.
|
||||||
function kube::release::package_salt_tarball() {
|
function kube::release::package_salt_tarball() {
|
||||||
|
25
cluster/addons/python-image/Makefile
Normal file
25
cluster/addons/python-image/Makefile
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# Copyright 2016 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.
|
||||||
|
|
||||||
|
IMAGE=gcr.io/google_containers/python
|
||||||
|
VERSION=v1
|
||||||
|
|
||||||
|
.PHONY: build push
|
||||||
|
|
||||||
|
build:
|
||||||
|
docker build -t "$(IMAGE):$(VERSION)" .
|
||||||
|
|
||||||
|
push:
|
||||||
|
gcloud docker push "$(IMAGE):$(VERSION)"
|
||||||
|
|
@ -65,10 +65,8 @@ done
|
|||||||
echo "+++ Install binaries from tar: $1"
|
echo "+++ Install binaries from tar: $1"
|
||||||
tar -xz -C "${KUBE_TEMP}" -f "$1"
|
tar -xz -C "${KUBE_TEMP}" -f "$1"
|
||||||
mkdir -p /srv/salt-new/salt/kube-bins
|
mkdir -p /srv/salt-new/salt/kube-bins
|
||||||
mkdir -p /srv/salt-new/salt/kube-addons-images
|
|
||||||
mkdir -p /srv/salt-new/salt/kube-docs
|
mkdir -p /srv/salt-new/salt/kube-docs
|
||||||
cp -v "${KUBE_TEMP}/kubernetes/server/bin/"* /srv/salt-new/salt/kube-bins/
|
cp -v "${KUBE_TEMP}/kubernetes/server/bin/"* /srv/salt-new/salt/kube-bins/
|
||||||
cp -v "${KUBE_TEMP}/kubernetes/addons/"* /srv/salt-new/salt/kube-addons-images/
|
|
||||||
cp -v "${KUBE_TEMP}/kubernetes/LICENSES" /srv/salt-new/salt/kube-docs/
|
cp -v "${KUBE_TEMP}/kubernetes/LICENSES" /srv/salt-new/salt/kube-docs/
|
||||||
|
|
||||||
kube_bin_dir="/srv/salt-new/salt/kube-bins";
|
kube_bin_dir="/srv/salt-new/salt/kube-bins";
|
||||||
|
@ -28,7 +28,7 @@ trusty_master=${TRUSTY_MASTER:-false}
|
|||||||
function ensure_python() {
|
function ensure_python() {
|
||||||
if ! python --version > /dev/null 2>&1; then
|
if ! python --version > /dev/null 2>&1; then
|
||||||
echo "No python on the machine, will use a python image"
|
echo "No python on the machine, will use a python image"
|
||||||
local -r PYTHON_IMAGE=python:2.7-slim-pyyaml
|
local -r PYTHON_IMAGE=gcr.io/google_containers/python:v1
|
||||||
export PYTHON="docker run --interactive --rm --net=none ${PYTHON_IMAGE} python"
|
export PYTHON="docker run --interactive --rm --net=none ${PYTHON_IMAGE} python"
|
||||||
else
|
else
|
||||||
export PYTHON=python
|
export PYTHON=python
|
||||||
@ -136,39 +136,11 @@ function create-resource-from-string() {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
# $1 is the directory containing all of the docker images
|
|
||||||
function load-docker-images() {
|
|
||||||
local success
|
|
||||||
local restart_docker
|
|
||||||
while true; do
|
|
||||||
success=true
|
|
||||||
restart_docker=false
|
|
||||||
for image in "$1/"*; do
|
|
||||||
timeout 30 docker load -i "${image}" &>/dev/null
|
|
||||||
rc=$?
|
|
||||||
if [[ "$rc" == 124 ]]; then
|
|
||||||
restart_docker=true
|
|
||||||
elif [[ "$rc" != 0 ]]; then
|
|
||||||
success=false
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
if [[ "$success" == "true" ]]; then break; fi
|
|
||||||
if [[ "$restart_docker" == "true" ]]; then service docker restart; fi
|
|
||||||
sleep 15
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
# The business logic for whether a given object should be created
|
# The business logic for whether a given object should be created
|
||||||
# was already enforced by salt, and /etc/kubernetes/addons is the
|
# was already enforced by salt, and /etc/kubernetes/addons is the
|
||||||
# managed result is of that. Start everything below that directory.
|
# managed result is of that. Start everything below that directory.
|
||||||
echo "== Kubernetes addon manager started at $(date -Is) with ADDON_CHECK_INTERVAL_SEC=${ADDON_CHECK_INTERVAL_SEC} =="
|
echo "== Kubernetes addon manager started at $(date -Is) with ADDON_CHECK_INTERVAL_SEC=${ADDON_CHECK_INTERVAL_SEC} =="
|
||||||
|
|
||||||
# Load any images that we may need. This is not needed for trusty master and
|
|
||||||
# the way it restarts docker daemon does not work for trusty.
|
|
||||||
if [[ "${trusty_master}" == "false" ]]; then
|
|
||||||
load-docker-images /srv/salt/kube-addons-images
|
|
||||||
fi
|
|
||||||
|
|
||||||
ensure_python
|
ensure_python
|
||||||
|
|
||||||
# Load the kube-env, which has all the environment variables we care
|
# Load the kube-env, which has all the environment variables we care
|
||||||
|
Loading…
Reference in New Issue
Block a user