forked from kubernetes-retired/contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into 404-server-parse-flags
- Loading branch information
Showing
7,960 changed files
with
2,429,394 additions
and
928,008 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM busybox | ||
FROM BASEIMAGE | ||
MAINTAINER Prashanth B <[email protected]> | ||
ADD server server | ||
COPY server / | ||
ENTRYPOINT ["/server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,69 @@ | ||
# 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. | ||
|
||
# Build the default backend binary or image for amd64, arm, arm64 and ppc64le | ||
# | ||
# Usage: | ||
# [PREFIX=gcr.io/google_containers/defaultbackend] [ARCH=amd64] [TAG=1.1] make (server|container|push) | ||
|
||
|
||
all: push | ||
|
||
# 0.0 shouldn't clobber any released builds | ||
TAG = 0.0 | ||
PREFIX = gcr.io/google_containers/defaultbackend | ||
TAG=1.1 | ||
PREFIX?=gcr.io/google_containers/defaultbackend | ||
ARCH?=amd64 | ||
GOLANG_VERSION=1.6 | ||
TEMP_DIR:=$(shell mktemp -d) | ||
|
||
# Set default base image dynamically for each arch | ||
ifeq ($(ARCH),amd64) | ||
BASEIMAGE?=busybox | ||
endif | ||
ifeq ($(ARCH),arm) | ||
BASEIMAGE?=armel/busybox | ||
endif | ||
ifeq ($(ARCH),arm64) | ||
BASEIMAGE?=aarch64/busybox | ||
endif | ||
ifeq ($(ARCH),ppc64le) | ||
BASEIMAGE?=ppc64le/busybox | ||
endif | ||
|
||
server: server.go | ||
CGO_ENABLED=0 GOOS=linux godep go build -a -installsuffix cgo -ldflags '-w' -o server ./server.go | ||
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) GOARM=6 go build -a -installsuffix cgo -ldflags '-w' -o server ./server.go | ||
|
||
container: server | ||
docker build -t $(PREFIX):$(TAG) . | ||
container: | ||
# Copy the whole directory to a temporary dir and set the base image | ||
cp -r ./* $(TEMP_DIR) | ||
cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile | ||
|
||
# Compile the binary inside a container for reliable builds | ||
docker run --rm -it -v $(TEMP_DIR):/build golang:$(GOLANG_VERSION) /bin/bash -c "make -C /build server ARCH=$(ARCH)" | ||
|
||
docker build -t $(PREFIX)-$(ARCH):$(TAG) $(TEMP_DIR) | ||
|
||
rm -rf $(TEMP_DIR) | ||
|
||
push: container | ||
gcloud docker push $(PREFIX)-$(ARCH):$(TAG) | ||
|
||
push-legacy: container | ||
ifeq ($(ARCH),amd64) | ||
# Backward compatibility. TODO: deprecate this image tag | ||
docker tag -f $(PREFIX)-$(ARCH):$(TAG) $(PREFIX):$(TAG) | ||
gcloud docker push $(PREFIX):$(TAG) | ||
endif | ||
|
||
clean: | ||
rm -f server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
assignees: | ||
- bprashanth | ||
- luxas | ||
- mikedanese | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# 404-server (default backend) | ||
|
||
404-server is a simple webserver that satisfies the ingress, which means it has to do two things: | ||
|
||
1. Serves a 404 page at `/` | ||
2. Serves 200 on a `/healthz` | ||
|
||
## How to release: | ||
|
||
The `404-server` Makefile supports multiple architecures, which means it may cross-compile and build an docker image easily. | ||
If you are releasing a new version, please bump the `TAG` value in the `Makefile` before building the images. | ||
|
||
How to build and push all images: | ||
``` | ||
# Build for linux/amd64 (default) | ||
$ make push | ||
$ make push ARCH=amd64 | ||
# ---> gcr.io/google_containers/defaultbackend-amd64:TAG | ||
$ make push-legacy ARCH=amd64 | ||
# ---> gcr.io/google_containers/defaultbackend:TAG (image with backwards compatible naming) | ||
$ make push ARCH=arm | ||
# ---> gcr.io/google_containers/defaultbackend-arm:TAG | ||
$ make push ARCH=arm64 | ||
# ---> gcr.io/google_containers/defaultbackend-arm64:TAG | ||
$ make push ARCH=ppc64le | ||
# ---> gcr.io/google_containers/defaultbackend-ppc64le:TAG | ||
``` | ||
|
||
Of course, if you don't want to push the images, just run `make container` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
assignees: | ||
- bprashanth | ||
- eparis | ||
- lavalamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.