Skip to content

Commit ed3775a

Browse files
committed
Add Kubernetes 1.19.0-rc.4
Signed-off-by: Chris Kim <[email protected]>
1 parent aa07f4b commit ed3775a

File tree

6 files changed

+90
-40
lines changed

6 files changed

+90
-40
lines changed

.drone.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ platform:
66
arch: amd64
77

88
steps:
9+
- name: prepare-amd64-binaries
10+
image: ubuntu:20.04
11+
commands:
12+
- apt-get -y update && apt-get -y install make curl tar
13+
- make k8s-binaries
14+
when:
15+
instance:
16+
- drone-publish.rancher.io
17+
event:
18+
- tag
19+
920
- name: publish-hyperkube-linux-amd64
1021
image: plugins/docker
1122
settings:
@@ -30,14 +41,25 @@ platform:
3041
arch: arm64
3142

3243
steps:
44+
- name: prepare-arm64-binaries
45+
image: ubuntu:20.04
46+
commands:
47+
- apt-get -y update && apt-get -y install make curl tar
48+
- make ARCH=arm64 k8s-binaries
49+
when:
50+
instance:
51+
- drone-publish.rancher.io
52+
event:
53+
- tag
54+
3355
- name: publish-hyperkube-linux-arm64
3456
image: plugins/docker
3557
settings:
3658
username:
3759
from_secret: docker_username
3860
password:
3961
from_secret: docker_password
40-
dockerfile: Dockerfile.arm64
62+
dockerfile: Dockerfile
4163
repo: rancher/hyperkube
4264
tag: "${DRONE_TAG}-linux-arm64"
4365
when:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
k8s-tars/
2+
k8s-binaries/

Dockerfile

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
1-
FROM gcr.io/google_containers/hyperkube:v1.18.6
2-
RUN sed -i -e 's!\bmain\b!main contrib!g' /etc/apt/sources.list && \
3-
apt-get update && apt-get upgrade -y && apt-get clean && \
4-
clean-install apt-transport-https gnupg1 curl zfsutils-linux \
5-
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ buster main" > \
6-
/etc/apt/sources.list.d/azure-cli.list \
7-
&& curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
8-
&& apt-get purge gnupg \
9-
&& clean-install \
10-
xfsprogs \
11-
open-iscsi \
12-
azure-cli \
13-
iproute2 \
14-
iputils-ping \
15-
procps \
16-
glusterfs-client \
17-
glusterfs-common \
18-
samba-common \
19-
arptables
1+
FROM rancher/hyperkube-base:v0.0.1-rc3
2+
3+
COPY k8s-binaries/kube* /usr/local/bin/

Dockerfile.arm64

Lines changed: 0 additions & 19 deletions
This file was deleted.

Dockerfile.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ RUN if (-not (Get-Command Expand-7Zip -ErrorAction Ignore)) { \
1010
Exit 1; \
1111
} \
1212
}
13-
ENV K8S_VERSION v1.18.6
13+
ENV K8S_VERSION v1.19.0-rc.4
1414
RUN $URL = ('https://dl.k8s.io/{0}/kubernetes-node-windows-amd64.tar.gz' -f $env:K8S_VERSION); \
1515
\
1616
function Expand-GZip ($inFile, $outFile) { \

Makefile

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
K8S_VERSION?=v1.19.0-rc.4
2+
BASEIMAGE?=docker.io/rancher/hyperkube-base:v0.0.1-rc3
3+
4+
ARCH?=amd64
5+
ALL_ARCH=amd64 arm64
6+
7+
IMAGE?=docker.io/rancher/hyperkube
8+
TAG?=v1.19.0-rc.4-rancher1
9+
10+
K8S_STAGING:=$(shell mktemp -d)
11+
12+
K8S_SERVER_TARBALL=kubernetes-server-linux-$(ARCH).tar.gz
13+
14+
all: all-push
15+
16+
sub-build-%:
17+
$(MAKE) ARCH=$* build
18+
19+
all-build: $(addprefix sub-build-,$(ALL_ARCH))
20+
21+
sub-push-image-%:
22+
$(MAKE) ARCH=$* push
23+
24+
all-push-images: $(addprefix sub-push-image-,$(ALL_ARCH))
25+
26+
all-push: all-push-images push-manifest
27+
28+
k8s-tars/${K8S_VERSION}/${ARCH}/${K8S_SERVER_TARBALL}:
29+
mkdir -p k8s-tars/${K8S_VERSION}/${ARCH}
30+
cd k8s-tars/${K8S_VERSION}/${ARCH} && curl -sSLO --retry 5 https://dl.k8s.io/${K8S_VERSION}/${K8S_SERVER_TARBALL}
31+
32+
k8s-binaries: k8s-tars/${K8S_VERSION}/${ARCH}/$(K8S_SERVER_TARBALL)
33+
mkdir -p ${K8S_STAGING}/k8s-server-untarred
34+
tar -xz -C ${K8S_STAGING}/k8s-server-untarred -f "k8s-tars/${K8S_VERSION}/${ARCH}/${K8S_SERVER_TARBALL}"
35+
36+
mkdir -p ${K8S_STAGING}/k8s-binaries
37+
38+
cp ${K8S_STAGING}/k8s-server-untarred/kubernetes/server/bin/kube-apiserver ${K8S_STAGING}/k8s-binaries
39+
cp ${K8S_STAGING}/k8s-server-untarred/kubernetes/server/bin/kube-controller-manager ${K8S_STAGING}/k8s-binaries
40+
cp ${K8S_STAGING}/k8s-server-untarred/kubernetes/server/bin/kube-proxy ${K8S_STAGING}/k8s-binaries
41+
cp ${K8S_STAGING}/k8s-server-untarred/kubernetes/server/bin/kube-scheduler ${K8S_STAGING}/k8s-binaries
42+
cp ${K8S_STAGING}/k8s-server-untarred/kubernetes/server/bin/kubectl ${K8S_STAGING}/k8s-binaries
43+
cp ${K8S_STAGING}/k8s-server-untarred/kubernetes/server/bin/kubelet ${K8S_STAGING}/k8s-binaries
44+
45+
mkdir -p k8s-binaries/${K8S_VERSION}/${ARCH}
46+
cp -r ${K8S_STAGING}/k8s-binaries k8s-binaries/${K8S_VERSION}/${ARCH}
47+
rm -rf ${K8S_STAGING}
48+
49+
clean:
50+
rm -rf k8s-tars
51+
rm -rf k8s-binaries
52+
53+
build: k8s-binaries
54+
docker build --pull -t $(IMAGE):$(TAG)-$(ARCH) -f Dockerfile .
55+
56+
push: build
57+
docker push $(IMAGE):$(TAG)-$(ARCH)
58+
59+
.PHONY: all build push clean all-build all-push-images all-push push-manifest k8s-binaries
60+
61+
.DEFAULT_GOAL := build

0 commit comments

Comments
 (0)