PR-2 Making docker images availabe for s390x on gcr.io repository and enables s390x support to kube-dns , pause, addon-manager, etcd, hyperkube, kube-discovery modules

This commit is contained in:
gajju26 2016-11-18 19:22:21 +05:30
parent 6b9a944285
commit 70b92aab45
18 changed files with 91 additions and 18 deletions

View File

@ -120,6 +120,13 @@ kube::build::get_docker_wrapped_binaries() {
kube-scheduler,ppc64le/busybox
kube-proxy,gcr.io/google_containers/debian-iptables-ppc64le:v4
);;
"s390x")
local targets=(
kube-apiserver,s390x/busybox
kube-controller-manager,s390x/busybox
kube-scheduler,s390x/busybox
kube-proxy,gcr.io/google_containers/debian-iptables-s390x:v4
);;
esac
echo "${targets[@]}"

View File

@ -35,6 +35,10 @@ ifeq ($(ARCH),ppc64le)
BASEIMAGE?=ppc64le/debian:jessie
QEMUARCH=ppc64le
endif
ifeq ($(ARCH),s390x)
BASEIMAGE?=s390x/debian:jessie
QEMUARCH=s390x
endif
build:
cp ./* $(TEMP_DIR)

View File

@ -21,6 +21,9 @@ $ make push ARCH=arm64
$ make push ARCH=ppc64le
# ---> gcr.io/google_containers/debian-iptables-ppc64le:TAG
$ make push ARCH=s390x
# ---> gcr.io/google_containers/debian-iptables-s390x:TAG
```
If you don't want to push the images, run `make` or `make build` instead

View File

@ -41,6 +41,9 @@ endif
ifeq ($(ARCH),ppc64le)
BASEIMAGE?=ppc64le/busybox
endif
ifeq ($(ARCH),s390x)
BASEIMAGE?=s390x/busybox
endif
all: container

View File

@ -35,6 +35,9 @@ make container PREFIX=<your-docker-hub> TAG=rc
$ make push ARCH=ppc64le
# ---> gcr.io/google_containers/kube-dns-ppc64le:TAG
$ make push ARCH=s390x
# ---> gcr.io/google_containers/kube-dns-s390x:TAG
```
6. Manually deploy this to your own cluster by updating the replication

View File

@ -20,10 +20,10 @@ LEGACY_AMD64_IMAGE = $(REGISTRY)/pause
TAG = 3.0
# Architectures supported: amd64, arm, arm64 and ppc64le
# Architectures supported: amd64, arm, arm64, ppc64le and s390x
ARCH ?= amd64
ALL_ARCH = amd64 arm arm64 ppc64le
ALL_ARCH = amd64 arm arm64 ppc64le s390x
CFLAGS = -Os -Wall -static
KUBE_CROSS_IMAGE ?= gcr.io/google_containers/kube-cross
@ -48,6 +48,10 @@ ifeq ($(ARCH),ppc64le)
TRIPLE ?= powerpc64le-linux-gnu
endif
ifeq ($(ARCH),s390x)
TRIPLE ?= s390x-linux-gnu
endif
# If you want to build AND push all containers, see the 'all-push' rule.
all: all-container

View File

@ -30,6 +30,9 @@ endif
ifeq ($(ARCH),ppc64le)
BASEIMAGE?=ppc64le/debian
endif
ifeq ($(ARCH),s390x)
BASEIMAGE?=s390x/debian
endif
.PHONY: build push

View File

@ -29,6 +29,9 @@ $ make push ARCH=arm64
$ make push ARCH=ppc64le
# ---> gcr.io/google-containers/kube-addon-manager-ppc64le:VERSION
$ make push ARCH=s390x
# ---> gcr.io/google-containers/kube-addon-manager-s390x:VERSION
```
If you don't want to push the images, run `make` or `make build` instead

View File

@ -27,6 +27,7 @@
# * arm
# * arm64
# * ppc64le
# * s390x
#
# Set KUBERNETES_SKIP_CONFIRM to skip the installation confirmation prompt.
# Set KUBERNETES_RELEASE_URL to choose where to download binaries from.
@ -86,9 +87,12 @@ function detect_client_info() {
i?86*)
CLIENT_ARCH="386"
;;
s390x*)
CLIENT_ARCH="s390x"
;;
*)
echo "Unknown, unsupported architecture (${machine})." >&2
echo "Supported architectures x86_64, i686, arm, arm64." >&2
echo "Supported architectures x86_64, i686, arm, arm64, s390x." >&2
echo "Bailing out." >&2
exit 3
;;

View File

@ -46,6 +46,9 @@ endif
ifeq ($(ARCH),ppc64le)
BASEIMAGE?=ppc64le/busybox
endif
ifeq ($(ARCH),s390x)
BASEIMAGE?=s390x/busybox
endif
build:
# Copy the content in this dir to the temp dir,

View File

@ -21,6 +21,9 @@ $ make push ARCH=arm64
$ make push ARCH=ppc64le
# ---> gcr.io/google_containers/etcd-ppc64le:TAG
$ make push ARCH=s390x
# ---> gcr.io/google_containers/etcd-s390x:TAG
```
If you don't want to push the images, run `make` or `make build` instead

View File

@ -45,6 +45,10 @@ ifeq ($(ARCH),ppc64le)
BASEIMAGE?=ppc64le/debian:jessie
QEMUARCH=ppc64le
endif
ifeq ($(ARCH),s390x)
BASEIMAGE?=s390x/debian:jessie
QEMUARCH=s390x
endif
all: build

View File

@ -25,6 +25,9 @@ $ make push VERSION={target_version} ARCH=arm64
$ make push VERSION={target_version} ARCH=ppc64le
# ---> gcr.io/google_containers/hyperkube-ppc64le:VERSION
$ make push VERSION={target_version} ARCH=s390x
# ---> gcr.io/google_containers/hyperkube-s390x:VERSION
```
If you don't want to push the images, run `make` or `make build` instead

View File

@ -37,6 +37,10 @@ endif
ifeq ($(ARCH),ppc64le)
BASEIMAGE?=ppc64le/debian:jessie
endif
ifeq ($(ARCH),s390x)
BASEIMAGE?=s390x/debian:jessie
endif
all: build

View File

@ -478,7 +478,7 @@ def arch():
# Convert the binary result into a string.
architecture = architecture.decode('utf-8')
# Validate the architecture is supported by kubernetes.
if architecture not in ['amd64', 'arm', 'arm64', 'ppc64le']:
if architecture not in ['amd64', 'arm', 'arm64', 'ppc64le', 's390x']:
message = 'Unsupported machine architecture: {0}'.format(architecture)
status_set('blocked', message)
raise Exception(message)

View File

@ -61,6 +61,7 @@ else
linux/amd64
linux/arm
linux/arm64
linux/s390x
)
if [[ "${KUBE_BUILD_PPC64LE:-}" =~ ^[yY]$ ]]; then
KUBE_SERVER_PLATFORMS+=(linux/ppc64le)
@ -78,6 +79,7 @@ else
darwin/386
windows/amd64
windows/386
linux/s390x
)
if [[ "${KUBE_BUILD_PPC64LE:-}" =~ ^[yY]$ ]]; then
KUBE_CLIENT_PLATFORMS+=(linux/ppc64le)
@ -233,18 +235,32 @@ kube::golang::set_platform_envs() {
# Dynamic CGO linking for other server architectures than linux/amd64 goes here
# If you want to include support for more server platforms than these, add arch-specific gcc names here
if [[ ${platform} == "linux/arm" ]]; then
export CGO_ENABLED=1
export CC=arm-linux-gnueabi-gcc
# See https://github.com/kubernetes/kubernetes/issues/29904
export GOROOT=${K8S_PATCHED_GOROOT}
elif [[ ${platform} == "linux/arm64" ]]; then
export CGO_ENABLED=1
export CC=aarch64-linux-gnu-gcc
elif [[ ${platform} == "linux/ppc64le" ]]; then
export CGO_ENABLED=1
export CC=powerpc64le-linux-gnu-gcc
fi
case "${platform}" in
"linux/amd64")
;;
"linux/arm")
export CGO_ENABLED=1
export CC=arm-linux-gnueabi-gcc
# See https://github.com/kubernetes/kubernetes/issues/29904
export GOROOT=${K8S_PATCHED_GOROOT}
;;
"linux/arm64")
export CGO_ENABLED=1
export CC=aarch64-linux-gnu-gcc
;;
"linux/ppc64le")
export CGO_ENABLED=1
export CC=powerpc64le-linux-gnu-gcc
;;
"linux/s390x")
export CGO_ENABLED=1
export CC=s390x-linux-gnu-gcc
;;
*)
echo "Unsupported architecture to cross-compile from linux/amd64." >&2
exit 1
;;
esac
fi
}

View File

@ -24,10 +24,10 @@ TAG ?= v1.5
REGISTRY ?= gcr.io/google_containers
TEST_REGISTRY ?= b.gcr.io/k8s_authenticated_test
# Architectures supported: amd64, arm, arm64 and ppc64le
# Architectures supported: amd64, arm, arm64, ppc64le and s390x
ARCH ?= amd64
ALL_ARCH = amd64 arm arm64 ppc64le
ALL_ARCH = amd64 arm arm64 ppc64le s390x
GOARM=6
TEMP_DIR := $(shell mktemp -d)
@ -52,6 +52,9 @@ endif
ifeq ($(ARCH),ppc64le)
BASEIMAGE?=ppc64le/busybox
endif
ifeq ($(ARCH),s390x)
BASEIMAGE?=s390x/busybox
endif
# If you want to build AND push all containers, see the 'all-push' rule.
all: all-container

View File

@ -25,6 +25,9 @@ $ make push ARCH=arm64
$ make push ARCH=ppc64le
# ---> gcr.io/google_containers/serve_hostname-ppc64le:TAG
$ make push ARCH=s390x
# ---> gcr.io/google_containers/serve_hostname-s390x:TAG
```
Of course, if you don't want to push the images, run `make all-container` or `make container ARCH={target_arch}` instead.