Skip to content

Commit 18eb42e

Browse files
authored
Merge pull request #21904 from ComradeProgrammer/bootcamp
[ci]: migrate kubernetes bootcamp image to prow
2 parents f7a9245 + 13beb2e commit 18eb42e

File tree

4 files changed

+52
-1
lines changed

4 files changed

+52
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM node:slim
2+
RUN apt-get update && apt-get install curl -y
3+
EXPOSE 8080
4+
COPY server.js .
5+
CMD [ "node", "server.js" ]
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
var http = require('http');
2+
var requests = 0;
3+
var podname = process.env.HOSTNAME;
4+
var startTime;
5+
var host;
6+
var handleRequest = function(request, response) {
7+
response.setHeader('Content-Type', 'text/plain');
8+
response.writeHead(200);
9+
response.write('Hello Kubernetes bootcamp! | Hostname: ');
10+
response.write(host);
11+
response.end(' | v=2\n');
12+
console.log('Hostname:', host, '| Total Requests:', ++requests, '| App Uptime:', (new Date() - startTime)/1000 , 'seconds', '| Log Time:', new Date());
13+
}
14+
var www = http.createServer(handleRequest);
15+
www.listen(8080, function () {
16+
startTime = new Date();
17+
host = process.env.HOSTNAME;
18+
console.log('Kubernetes Bootcamp App Started At:', startTime, '| Running On:', host, '\n');
19+
});
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# See https://cloud.google.com/cloud-build/docs/build-config
2+
options:
3+
substitution_option: ALLOW_LOOSE
4+
steps:
5+
- name: gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20250513-9264efb079
6+
entrypoint: make
7+
env:
8+
- DOCKER_CLI_EXPERIMENTAL=enabled
9+
- _GIT_TAG=$_GIT_TAG
10+
- _PULL_BASE_REF=$_PULL_BASE_REF
11+
args:
12+
- push-kubernetes-bootcamp
13+
substitutions:
14+
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and
15+
# can be used as a substitution
16+
_GIT_TAG: '12345'
17+
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build -
18+
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'.
19+
_PULL_BASE_REF: 'master'

hack/prow/prow.mk

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,12 @@ build-mini-test: # build minitest binary
2121
setup-prow-gcp-ssh-keys: # set up ssh keys for gcloud cli. These env vars are set by test/infra
2222
mkdir -p -m 0700 ~/.ssh
2323
cp -f "${GCE_SSH_PRIVATE_KEY_FILE}" ~/.ssh/google_compute_engine
24-
cp -f "${GCE_SSH_PUBLIC_KEY_FILE}" ~/.ssh/google_compute_engine.pub
24+
cp -f "${GCE_SSH_PUBLIC_KEY_FILE}" ~/.ssh/google_compute_engine.pub
25+
26+
.PHONY: push-kubernetes-bootcamp
27+
push-kubernetes-bootcamp:
28+
docker run --rm --privileged tonistiigi/binfmt:latest --install all
29+
docker buildx create --name multiarch --bootstrap
30+
docker buildx build --builder multiarch --push --platform linux/amd64,linux/arm64 \
31+
-t us-central1-docker.pkg.dev/k8s-staging-images/minikube/kubernetes-bootcamp:$(_GIT_TAG) -t us-central1-docker.pkg.dev/k8s-staging-images/minikube/kubernetes-bootcamp:latest deploy/image/kubernetes-bootcamp
32+
docker buildx rm multiarch

0 commit comments

Comments
 (0)