Skip to content

Commit 9f44f7e

Browse files
authored
Merge pull request kubernetes#87632 from pjh/multi-arch-smoke-test
Update GCE Windows smoke-test script to work with 1909 nodes.
2 parents 5ced53c + cb942c2 commit 9f44f7e

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

cluster/gce/windows/README-GCE-Windows-kube-up.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,15 @@ Now bring up a cluster using one of the following two methods:
8484
```
8585
# Invoke kube-up.sh with these environment variables:
8686
# PROJECT: text name of your GCP project.
87-
# KUBERNETES_SKIP_CONFIRM: skips any kube-up prompts.
88-
PROJECT=${CLOUDSDK_CORE_PROJECT} KUBERNETES_SKIP_CONFIRM=y ./cluster/kube-up.sh
87+
# KUBE_UP_AUTOMATIC_CLEANUP (optional): cleans up existing cluster without
88+
# prompting.
89+
PROJECT=${CLOUDSDK_CORE_PROJECT} KUBE_UP_AUTOMATIC_CLEANUP=true ./cluster/kube-up.sh
8990
```
9091

9192
To teardown the cluster run:
9293

9394
```
94-
PROJECT=${CLOUDSDK_CORE_PROJECT} KUBERNETES_SKIP_CONFIRM=y ./cluster/kube-down.sh
95+
PROJECT=${CLOUDSDK_CORE_PROJECT} ./cluster/kube-down.sh
9596
```
9697

9798
#### 2b. Create a Kubernetes end-to-end (E2E) test cluster

cluster/gce/windows/smoke-test.sh

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -245,17 +245,19 @@ function undeploy_linux_command_pod {
245245
${kubectl} delete deployment $linux_command_deployment
246246
}
247247

248-
windows_webserver_deployment=windows-nettest
249-
windows_webserver_pod_label=nettest
248+
windows_webserver_deployment=windows-agnhost
249+
windows_webserver_pod_label=agnhost
250+
# The default port for 'agnhost serve-hostname'. The documentation says that
251+
# this can be changed but the --port arg does not seem to work.
252+
windows_webserver_port=9376
250253
windows_webserver_replicas=1
251254

252255
function deploy_windows_webserver_pod {
253256
echo "Writing example deployment to $windows_webserver_deployment.yaml"
254257
cat <<EOF > $windows_webserver_deployment.yaml
255-
# You can run a pod with the e2eteam/nettest:1.0 image (which should listen on
256-
# <podIP>:8080) and create another pod on a different node (linux would be
257-
# easier) to curl the http server:
258-
# curl http://<pod_ip>:8080/read
258+
# A multi-arch Windows container that runs an HTTP server on port
259+
# $windows_webserver_port that serves the container's hostname.
260+
# curl -s http://<pod_ip>:$windows_webserver_port
259261
apiVersion: apps/v1
260262
kind: Deployment
261263
metadata:
@@ -273,8 +275,10 @@ spec:
273275
app: $windows_webserver_pod_label
274276
spec:
275277
containers:
276-
- name: nettest
277-
image: e2eteam/nettest:1.0
278+
- name: agnhost
279+
image: e2eteam/agnhost:2.8
280+
args:
281+
- serve-hostname
278282
nodeSelector:
279283
beta.kubernetes.io/os: windows
280284
tolerations:
@@ -332,6 +336,7 @@ windows_command_deployment=windows-powershell
332336
windows_command_pod_label=powershell
333337
windows_command_replicas=1
334338

339+
# Deploys a multi-arch Windows pod capable of running PowerShell.
335340
function deploy_windows_command_pod {
336341
echo "Writing example deployment to $windows_command_deployment.yaml"
337342
cat <<EOF > $windows_command_deployment.yaml
@@ -352,8 +357,8 @@ spec:
352357
app: $windows_command_pod_label
353358
spec:
354359
containers:
355-
- name: nettest
356-
image: e2eteam/nettest:1.0
360+
- name: pause-win
361+
image: gcr.io/gke-release/pause-win:1.1.0
357362
nodeSelector:
358363
beta.kubernetes.io/os: windows
359364
tolerations:
@@ -422,7 +427,7 @@ function test_linux_pod_to_linux_pod {
422427
local linux_webserver_pod_ip
423428
linux_webserver_pod_ip="$(get_linux_webserver_pod_ip)"
424429

425-
if ! $kubectl exec "$linux_command_pod" -- curl -m 20 \
430+
if ! $kubectl exec "$linux_command_pod" -- curl -s -m 20 \
426431
"http://$linux_webserver_pod_ip" &> $output_file; then
427432
cleanup_deployments
428433
echo "Failing output: $(cat $output_file)"
@@ -444,8 +449,8 @@ function test_linux_pod_to_windows_pod {
444449
local windows_webserver_pod_ip
445450
windows_webserver_pod_ip="$(get_windows_webserver_pod_ip)"
446451

447-
if ! $kubectl exec "$linux_command_pod" -- curl -m 20 \
448-
"http://$windows_webserver_pod_ip:8080/read" &> $output_file; then
452+
if ! $kubectl exec "$linux_command_pod" -- curl -s -m 20 \
453+
"http://$windows_webserver_pod_ip:$windows_webserver_port" &> $output_file; then
449454
cleanup_deployments
450455
echo "Failing output: $(cat $output_file)"
451456
echo "FAILED: ${FUNCNAME[0]}"
@@ -461,7 +466,7 @@ function test_linux_pod_to_internet {
461466
# A stable (hopefully) HTTP server provided by Cloudflare.
462467
local internet_ip="1.1.1.1"
463468

464-
if ! $kubectl exec "$linux_command_pod" -- curl -m 20 \
469+
if ! $kubectl exec "$linux_command_pod" -- curl -s -m 20 \
465470
"http://$internet_ip" > $output_file; then
466471
cleanup_deployments
467472
echo "Failing output: $(cat $output_file)"
@@ -486,7 +491,7 @@ function test_linux_pod_to_k8s_service {
486491
# curl-ing the metrics-server service downloads 14 bytes of unprintable binary
487492
# data and sets a return code of success (0).
488493
if ! $kubectl exec "$linux_command_pod" -- \
489-
curl -m 20 "http://$service_ip:$service_port" &> $output_file; then
494+
curl -s -m 20 "http://$service_ip:$service_port" &> $output_file; then
490495
cleanup_deployments
491496
echo "Failing output: $(cat $output_file)"
492497
echo "FAILED: ${FUNCNAME[0]}"
@@ -534,7 +539,7 @@ function test_windows_pod_to_windows_pod {
534539
windows_webserver_pod_ip="$(get_windows_webserver_pod_ip)"
535540

536541
if ! $kubectl exec "$windows_command_pod" -- powershell.exe \
537-
"curl -UseBasicParsing http://$windows_webserver_pod_ip:8080/read" \
542+
"curl -UseBasicParsing http://$windows_webserver_pod_ip:$windows_webserver_port" \
538543
> $output_file; then
539544
cleanup_deployments
540545
echo "Failing output: $(cat $output_file)"

0 commit comments

Comments
 (0)