@@ -245,17 +245,19 @@ function undeploy_linux_command_pod {
245
245
${kubectl} delete deployment $linux_command_deployment
246
246
}
247
247
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
250
253
windows_webserver_replicas=1
251
254
252
255
function deploy_windows_webserver_pod {
253
256
echo " Writing example deployment to $windows_webserver_deployment .yaml"
254
257
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
259
261
apiVersion: apps/v1
260
262
kind: Deployment
261
263
metadata:
@@ -273,8 +275,10 @@ spec:
273
275
app: $windows_webserver_pod_label
274
276
spec:
275
277
containers:
276
- - name: nettest
277
- image: e2eteam/nettest:1.0
278
+ - name: agnhost
279
+ image: e2eteam/agnhost:2.8
280
+ args:
281
+ - serve-hostname
278
282
nodeSelector:
279
283
beta.kubernetes.io/os: windows
280
284
tolerations:
@@ -332,6 +336,7 @@ windows_command_deployment=windows-powershell
332
336
windows_command_pod_label=powershell
333
337
windows_command_replicas=1
334
338
339
+ # Deploys a multi-arch Windows pod capable of running PowerShell.
335
340
function deploy_windows_command_pod {
336
341
echo " Writing example deployment to $windows_command_deployment .yaml"
337
342
cat << EOF > $windows_command_deployment .yaml
@@ -352,8 +357,8 @@ spec:
352
357
app: $windows_command_pod_label
353
358
spec:
354
359
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
357
362
nodeSelector:
358
363
beta.kubernetes.io/os: windows
359
364
tolerations:
@@ -422,7 +427,7 @@ function test_linux_pod_to_linux_pod {
422
427
local linux_webserver_pod_ip
423
428
linux_webserver_pod_ip=" $( get_linux_webserver_pod_ip) "
424
429
425
- if ! $kubectl exec " $linux_command_pod " -- curl -m 20 \
430
+ if ! $kubectl exec " $linux_command_pod " -- curl -s - m 20 \
426
431
" http://$linux_webserver_pod_ip " & > $output_file ; then
427
432
cleanup_deployments
428
433
echo " Failing output: $( cat $output_file ) "
@@ -444,8 +449,8 @@ function test_linux_pod_to_windows_pod {
444
449
local windows_webserver_pod_ip
445
450
windows_webserver_pod_ip=" $( get_windows_webserver_pod_ip) "
446
451
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
449
454
cleanup_deployments
450
455
echo " Failing output: $( cat $output_file ) "
451
456
echo " FAILED: ${FUNCNAME[0]} "
@@ -461,7 +466,7 @@ function test_linux_pod_to_internet {
461
466
# A stable (hopefully) HTTP server provided by Cloudflare.
462
467
local internet_ip=" 1.1.1.1"
463
468
464
- if ! $kubectl exec " $linux_command_pod " -- curl -m 20 \
469
+ if ! $kubectl exec " $linux_command_pod " -- curl -s - m 20 \
465
470
" http://$internet_ip " > $output_file ; then
466
471
cleanup_deployments
467
472
echo " Failing output: $( cat $output_file ) "
@@ -486,7 +491,7 @@ function test_linux_pod_to_k8s_service {
486
491
# curl-ing the metrics-server service downloads 14 bytes of unprintable binary
487
492
# data and sets a return code of success (0).
488
493
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
490
495
cleanup_deployments
491
496
echo " Failing output: $( cat $output_file ) "
492
497
echo " FAILED: ${FUNCNAME[0]} "
@@ -534,7 +539,7 @@ function test_windows_pod_to_windows_pod {
534
539
windows_webserver_pod_ip=" $( get_windows_webserver_pod_ip) "
535
540
536
541
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 " \
538
543
> $output_file ; then
539
544
cleanup_deployments
540
545
echo " Failing output: $( cat $output_file ) "
0 commit comments