Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
037fabd8
Commit
037fabd8
authored
Aug 30, 2018
by
Benjamin Elder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add make targets for building server images
parent
83030032
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
125 additions
and
1 deletion
+125
-1
common.sh
build/common.sh
+1
-1
release.sh
build/lib/release.sh
+30
-0
release-images.sh
build/release-images.sh
+39
-0
Makefile
build/root/Makefile
+38
-0
golang.sh
hack/lib/golang.sh
+17
-0
No files found.
build/common.sh
View file @
037fabd8
...
...
@@ -90,7 +90,7 @@ readonly KUBE_CONTAINER_RSYNC_PORT=8730
kube::build::get_docker_wrapped_binaries
()
{
debian_iptables_version
=
v10.1
### If you change any of these lists, please also update DOCKERIZED_BINARIES
### in build/BUILD.
### in build/BUILD.
And kube::golang::server_image_targets
case
$1
in
"amd64"
)
local
targets
=(
...
...
build/lib/release.sh
View file @
037fabd8
...
...
@@ -193,6 +193,36 @@ function kube::release::package_node_tarballs() {
done
}
# Package up all of the server binaries in docker images
function
kube::release::build_server_images
()
{
# Clean out any old images
rm
-rf
"
${
RELEASE_IMAGES
}
"
local
platform
for
platform
in
"
${
KUBE_SERVER_PLATFORMS
[@]
}
"
;
do
local
platform_tag
=
${
platform
/\//-
}
# Replace a "/" for a "-"
local arch
=
$(
basename
"
${
platform
}
"
)
kube::log::status
"Building images:
$platform_tag
"
local
release_stage
=
"
${
RELEASE_STAGE
}
/server/
${
platform_tag
}
/kubernetes"
rm
-rf
"
${
release_stage
}
"
mkdir
-p
"
${
release_stage
}
/server/bin"
mkdir
-p
"
${
release_stage
}
/addons"
# This fancy expression will expand to prepend a path
# (${LOCAL_OUTPUT_BINPATH}/${platform}/) to every item in the
# KUBE_SERVER_IMAGE_BINARIES array.
cp
"
${
KUBE_SERVER_IMAGE_BINARIES
[@]/#/
${
LOCAL_OUTPUT_BINPATH
}
/
${
platform
}
/
}
"
\
"
${
release_stage
}
/server/bin/"
# if we are building hyperkube, we also need to copy that binary
if
[[
"
${
KUBE_BUILD_HYPERKUBE
}
"
=
~
[
yY]
]]
;
then
cp
"
${
LOCAL_OUTPUT_BINPATH
}
/
${
platform
}
/hyperkube"
"
${
release_stage
}
/server/bin"
fi
kube::release::create_docker_images_for_server
"
${
release_stage
}
/server/bin"
"
${
arch
}
"
done
}
# Package up all of the server binaries
function
kube::release::package_server_tarballs
()
{
local
platform
...
...
build/release-images.sh
0 → 100755
View file @
037fabd8
#!/usr/bin/env bash
# Copyright 2018 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.
# Build Kubernetes release images. This will build the server target binaries,
# and create wrap them in Docker images, see `make release` for full releases
set
-o
errexit
set
-o
nounset
set
-o
pipefail
KUBE_ROOT
=
$(
dirname
"
${
BASH_SOURCE
}
"
)
/..
source
"
${
KUBE_ROOT
}
/build/common.sh"
source
"
${
KUBE_ROOT
}
/build/lib/release.sh"
CMD_TARGETS
=
"
${
KUBE_SERVER_IMAGE_TARGETS
[*]
}
"
if
[[
"
${
KUBE_BUILD_HYPERKUBE
}
"
=
~
[
yY]
]]
;
then
CMD_TARGETS
=
"
${
CMD_TARGETS
}
cmd/hyperkube"
fi
kube::build::verify_prereqs
kube::build::build_image
kube::build::run_build_command make all
WHAT
=
"
${
CMD_TARGETS
}
"
KUBE_BUILD_PLATFORMS
=
"
${
KUBE_SERVER_PLATFORMS
[*]
}
"
kube::build::copy_output
kube::release::build_server_images
build/root/Makefile
View file @
037fabd8
...
...
@@ -386,6 +386,24 @@ release-in-a-container:
build/release-in-a-container.sh
endif
define
RELEASE_IMAGES_HELP_INFO
# Build release images
#
# Args:
# KUBE_BUILD_HYPERKUBE: Whether to build hyperkube image as well. Set to 'n' to skip.
#
# Example:
# make release-images
endef
.PHONY
:
release-images
ifeq
($(PRINT_HELP),y)
release-images
:
@
echo
"
$$
RELEASE_IMAGES_HELP_INFO"
else
release-images
:
build/release-images.sh
endif
define
RELEASE_SKIP_TESTS_HELP_INFO
# Build a release, but skip tests
#
...
...
@@ -408,6 +426,26 @@ release-skip-tests quick-release:
build/release.sh
endif
define
QUICK_RELEASE_IMAGES_HELP_INFO
# Build release images, but only for linux/amd64
#
# Args:
# KUBE_FASTBUILD: Whether to cross-compile for other architectures. Set to 'false' to do so.
# KUBE_BUILD_HYPERKUBE: Whether to build hyperkube image as well. Set to 'n' to skip.
#
# Example:
# make quick-release-images
endef
.PHONY
:
quick-release-images
ifeq
($(PRINT_HELP),y)
quick-release-images
:
@
echo
"
$$
QUICK_RELEASE_IMAGES_HELP_INFO"
else
quick-release-images
:
KUBE_FASTBUILD = true
quick-release-images
:
build/release-images.sh
endif
define
PACKAGE_HELP_INFO
# Package tarballs
# Use the 'package-tarballs' target to run the final packaging steps of
...
...
hack/lib/golang.sh
View file @
037fabd8
...
...
@@ -40,6 +40,23 @@ IFS=" " read -ra KUBE_SERVER_TARGETS <<< "$(kube::golang::server_targets)"
readonly
KUBE_SERVER_TARGETS
readonly
KUBE_SERVER_BINARIES
=(
"
${
KUBE_SERVER_TARGETS
[@]##*/
}
"
)
# The set of server targets we build docker images for
kube::golang::server_image_targets
()
{
# NOTE: this contains cmd targets for kube::build::get_docker_wrapped_binaries
local
targets
=(
cmd/cloud-controller-manager
cmd/kube-apiserver
cmd/kube-controller-manager
cmd/kube-scheduler
cmd/kube-proxy
)
echo
"
${
targets
[@]
}
"
}
IFS
=
" "
read
-ra
KUBE_SERVER_IMAGE_TARGETS
<<<
"
$(
kube::golang::server_image_targets
)
"
readonly
KUBE_SERVER_IMAGE_TARGETS
readonly
KUBE_SERVER_IMAGE_BINARIES
=(
"
${
KUBE_SERVER_IMAGE_TARGETS
[@]##*/
}
"
)
# The set of server targets that we are only building for Kubernetes nodes
# If you update this list, please also update build/BUILD.
kube::golang::node_targets
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment