-
Notifications
You must be signed in to change notification settings - Fork 38.6k
/
e2e.sh
executable file
·1145 lines (1031 loc) · 45.7 KB
/
e2e.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
# Copyright 2015 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.
# kubernetes-e2e-{gce, gke, gke-ci} jobs: This script is triggered by
# the kubernetes-build job, or runs every half hour. We abort this job
# if it takes more than 75m. As of initial commit, it typically runs
# in about half an hour.
#
# The "Workspace Cleanup Plugin" is installed and in use for this job,
# so the ${WORKSPACE} directory (the current directory) is currently
# empty.
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
# Join all args with |
# Example: join_regex_allow_empty a b "c d" e => a|b|c d|e
function join_regex_allow_empty() {
local IFS="|"
echo "$*"
}
# Join all args with |, butin case of empty result prints "EMPTY\sSET" instead.
# Example: join_regex_no_empty a b "c d" e => a|b|c d|e
# join_regex_no_empty => EMPTY\sSET
function join_regex_no_empty() {
local IFS="|"
if [ -z "$*" ]; then
echo "EMPTY\sSET"
else
echo "$*"
fi
}
# GCP Project to fetch Trusty images.
TRUSTY_IMAGE_PROJECT="${TRUSTY_IMAGE_PROJECT:-}"
# Get the latest Trusty image for a Jenkins job.
function get_latest_trusty_image() {
local job_name="${1:-${JOB_NAME}}"
local image_index=""
if [[ "${job_name}" =~ trusty-dev ]]; then
image_index="trusty-dev"
elif [[ "${job_name}" =~ trusty-beta ]]; then
image_index="trusty-beta"
elif [[ "${job_name}" =~ trusty ]]; then
image_index="trusty"
fi
gsutil cat "gs://${TRUSTY_IMAGE_PROJECT}/image-indices/latest-test-image-${image_index}"
# Clean up gsutil artifacts otherwise the later test stage will complain.
rm -rf .config &> /dev/null
rm -rf .gsutil &> /dev/null
}
# Properly configure globals for an upgrade step in a GKE or GCE upgrade suite
#
# These suites:
# step1: launch a cluster at $old_version,
# step2: runs $new_version Kubectl e2es,
# step3: upgrades the master to $new_version,
# step4: runs $old_version e2es,
# step5: upgrades the rest of the cluster,
# step6: runs $old_version e2es again, then
# step7: runs $new_version e2es and tears down the cluster.
#
# Assumes globals:
# $JOB_NAME
# $KUBERNETES_PROVIDER
# $GKE_DEFAULT_SKIP_TESTS
# $GCE_DEFAULT_SKIP_TESTS
# $GCE_FLAKY_TESTS
# $GCE_SLOW_TESTS
#
# Args:
# $1 old_version: the version to deploy a cluster at, and old e2e tests to run
# against the upgraded cluster (should be something like
# 'release/latest', to work with JENKINS_PUBLISHED_VERSION logic)
# $2 new_version: the version to upgrade the cluster to, and new e2e tests to run
# against the upgraded cluster (should be something like
# 'ci/latest', to work with JENKINS_PUBLISHED_VERSION logic)
# $3 cluster_name: determines E2E_CLUSTER_NAME and E2E_NETWORK
# $4 project: determines PROJECT
function configure_upgrade_step() {
local -r old_version="$1"
local -r new_version="$2"
local -r cluster_name="$3"
local -r project="$4"
[[ "${JOB_NAME}" =~ .*-(step[1-7])-.* ]] || {
echo "JOB_NAME ${JOB_NAME} is not a valid upgrade job name, could not parse"
exit 1
}
local -r step="${BASH_REMATCH[1]}"
local -r gce_test_args="--ginkgo.skip=$(join_regex_allow_empty \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
)"
local -r gke_test_args="--ginkgo.skip=$(join_regex_allow_empty \
${GKE_DEFAULT_SKIP_TESTS[@]:+${GKE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
)"
if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
DOGFOOD_GCLOUD="true"
GKE_API_ENDPOINT="https://test-container.sandbox.googleapis.com/"
fi
E2E_CLUSTER_NAME="$cluster_name"
E2E_NETWORK="$cluster_name"
PROJECT="$project"
case $step in
step1)
# Deploy at old version
JENKINS_PUBLISHED_VERSION="${old_version}"
E2E_UP="true"
E2E_TEST="false"
E2E_DOWN="false"
if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
E2E_SET_CLUSTER_API_VERSION=y
fi
;;
step2)
# Run new e2e kubectl tests
JENKINS_PUBLISHED_VERSION="${new_version}"
JENKINS_FORCE_GET_TARS=y
E2E_OPT="--check_version_skew=false"
E2E_UP="false"
E2E_TEST="true"
E2E_DOWN="false"
GINKGO_TEST_ARGS="--ginkgo.focus=Kubectl"
;;
step3)
# Use upgrade logic of version we're upgrading to.
JENKINS_PUBLISHED_VERSION="${new_version}"
JENKINS_FORCE_GET_TARS=y
E2E_OPT="--check_version_skew=false"
E2E_UP="false"
E2E_TEST="true"
E2E_DOWN="false"
GINKGO_TEST_ARGS="--ginkgo.focus=Cluster\supgrade.*upgrade-master --upgrade-target=${new_version}"
;;
step4)
# Run old e2es
JENKINS_PUBLISHED_VERSION="${old_version}"
JENKINS_FORCE_GET_TARS=y
E2E_OPT="--check_version_skew=false"
E2E_UP="false"
E2E_TEST="true"
E2E_DOWN="false"
if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
GINKGO_TEST_ARGS="${gke_test_args}"
else
GINKGO_TEST_ARGS="${gce_test_args}"
fi
;;
step5)
# Use upgrade logic of version we're upgrading to.
JENKINS_PUBLISHED_VERSION="${new_version}"
JENKINS_FORCE_GET_TARS=y
E2E_OPT="--check_version_skew=false"
E2E_UP="false"
E2E_TEST="true"
E2E_DOWN="false"
GINKGO_TEST_ARGS="--ginkgo.focus=Cluster\supgrade.*upgrade-cluster --upgrade-target=${new_version}"
;;
step6)
# Run old e2es
JENKINS_PUBLISHED_VERSION="${old_version}"
JENKINS_FORCE_GET_TARS=y
E2E_OPT="--check_version_skew=false"
E2E_UP="false"
E2E_TEST="true"
E2E_DOWN="false"
if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
GINKGO_TEST_ARGS="${gke_test_args}"
else
GINKGO_TEST_ARGS="${gce_test_args}"
fi
;;
step7)
# Run new e2es
JENKINS_PUBLISHED_VERSION="${new_version}"
JENKINS_FORCE_GET_TARS=y
# TODO(15011): these really shouldn't be (very) version skewed, but
# because we have to get ci/latest again, it could get slightly out of
# whack.
E2E_OPT="--check_version_skew=false"
E2E_UP="false"
E2E_TEST="true"
E2E_DOWN="true"
if [[ "${KUBERNETES_PROVIDER}" == "gke" ]]; then
GINKGO_TEST_ARGS="${gke_test_args}"
else
GINKGO_TEST_ARGS="${gce_test_args}"
fi
;;
esac
}
echo "--------------------------------------------------------------------------------"
echo "Initial Environment:"
printenv | sort
echo "--------------------------------------------------------------------------------"
if [[ "${CIRCLECI:-}" == "true" ]]; then
JOB_NAME="circleci-${CIRCLE_PROJECT_USERNAME}-${CIRCLE_PROJECT_REPONAME}"
BUILD_NUMBER=${CIRCLE_BUILD_NUM}
WORKSPACE=`pwd`
else
# Jenkins?
export HOME=${WORKSPACE} # Nothing should want Jenkins $HOME
fi
# Additional parameters that are passed to hack/e2e.go
E2E_OPT=${E2E_OPT:-""}
# Set environment variables shared for all of the GCE Jenkins projects.
if [[ ${JOB_NAME} =~ ^kubernetes-.*-gce ]]; then
KUBERNETES_PROVIDER="gce"
: ${E2E_MIN_STARTUP_PODS:="1"}
: ${E2E_ZONE:="us-central1-f"}
: ${NUM_MINIONS_PARALLEL:="6"} # Number of nodes required to run all of the tests in parallel
elif [[ ${JOB_NAME} =~ ^kubernetes-.*-gke ]]; then
KUBERNETES_PROVIDER="gke"
: ${E2E_ZONE:="us-central1-f"}
elif [[ ${JOB_NAME} =~ ^kubernetes-.*-aws ]]; then
KUBERNETES_PROVIDER="aws"
: ${E2E_MIN_STARTUP_PODS:="1"}
: ${E2E_ZONE:="us-east-1a"}
: ${NUM_MINIONS_PARALLEL:="6"} # Number of nodes required to run all of the tests in parallel
fi
if [[ "${KUBERNETES_PROVIDER}" == "aws" ]]; then
if [[ "${PERFORMANCE:-}" == "true" ]]; then
: ${MASTER_SIZE:="m3.xlarge"}
: ${NUM_MINIONS:="100"}
: ${GINKGO_TEST_ARGS:="--ginkgo.focus=\[Performance\ssuite\]"}
else
: ${MASTER_SIZE:="m3.large"}
: ${MINION_SIZE:="m3.large"}
: ${NUM_MINIONS:="3"}
fi
fi
# CURRENT_RELEASE_PUBLISHED_VERSION is the JENKINS_PUBLISHED_VERSION for the
# release we are currently pointing our release testing infrastructure at.
# When 1.2.0-beta.0 comes out, e.g., this will become "ci/latest-1.2"
CURRENT_RELEASE_PUBLISHED_VERSION="ci/latest-1.1"
# Specialized to skip when running reboot tests.
REBOOT_SKIP_TESTS=(
"Skipped"
"Restart\sshould\srestart\sall\snodes"
"Example"
)
# Specialized tests which should be skipped by default for projects.
GCE_DEFAULT_SKIP_TESTS=(
"${REBOOT_SKIP_TESTS[@]}"
"Reboot"
"ServiceLoadBalancer"
)
# Tests which cannot be run on GKE, e.g. because they require
# master ssh access.
GKE_REQUIRED_SKIP_TESTS=(
"Nodes"
"Etcd\sFailure"
"MasterCerts"
"experimental\sresource\susage\stracking" # Expect --max-pods=100
"ServiceLoadBalancer" # issue: #16602
"Shell"
# Alpha features, remove from skip when these move to beta
"Daemon\sset"
"Deployment"
)
# Specialized tests which should be skipped by default for GKE.
GKE_DEFAULT_SKIP_TESTS=(
"Autoscaling\sSuite"
# Perf test, slow by design
"resource\susage\stracking"
"${GKE_REQUIRED_SKIP_TESTS[@]}"
)
# Tests which cannot be run on AWS.
AWS_REQUIRED_SKIP_TESTS=(
"experimental\sresource\susage\stracking" # Expect --max-pods=100
"GCE\sL7\sLoadBalancer\sController" # GCE L7 loadbalancing
)
# Tests which kills or restarts components and/or nodes.
DISRUPTIVE_TESTS=(
"DaemonRestart"
"Etcd\sfailure"
"Nodes\sResize"
"Reboot"
"Services.*restarting"
)
# The following tests are known to be flaky, and are thus run only in their own
# -flaky- build variants.
GCE_FLAKY_TESTS=(
"DaemonRestart\sController\sManager"
"Daemon\sset\sshould\srun\sand\sstop\scomplex\sdaemon"
"Resource\susage\sof\ssystem\scontainers"
"allows\sscheduling\sof\spods\son\sa\sminion\safter\sit\srejoins\sthe\scluster" # file: resize_nodes.go, issue: #13258
)
# The following tests are known to be slow running (> 2 min), and are
# thus run only in their own -slow- build variants. Note that tests
# can be slow by explicit design (e.g. some soak tests), or slow
# through poor implementation. Please indicate which applies in the
# comments below, and for poorly implemented tests, please quote the
# issue number tracking speed improvements.
GCE_SLOW_TESTS=(
# Before enabling this loadbalancer test in any other test list you must
# make sure the associated project has enough quota. At the time of this
# writing a GCE project is allowed 3 backend services by default. This
# test requires at least 5.
"GCE\sL7\sLoadBalancer\sController" # 10 min, file: ingress.go, slow by design
"SchedulerPredicates\svalidates\sMaxPods\slimit " # 8 min, file: scheduler_predicates.go, PR: #13315
"Nodes\sResize" # 3 min 30 sec, file: resize_nodes.go, issue: #13323
"resource\susage\stracking" # 1 hour, file: kubelet_perf.go, slow by design
"monotonically\sincreasing\srestart\scount" # 1.5 to 5 min, file: pods.go, slow by design
"Garbage\scollector\sshould" # 7 min, file: garbage_collector.go, slow by design
"KubeProxy\sshould\stest\skube-proxy" # 9 min 30 sec, file: kubeproxy.go, issue: #14204
"cap\sback-off\sat\sMaxContainerBackOff" # 20 mins file: manager.go, PR: #12648
)
# Tests which are not able to be run in parallel.
GCE_PARALLEL_SKIP_TESTS=(
"GCE\sL7\sLoadBalancer\sController" # namespaced watch flakes, issue: #17805
"Nodes\sNetwork"
"MaxPods"
"Resource\susage\sof\ssystem\scontainers"
"SchedulerPredicates"
"resource\susage\stracking"
"${DISRUPTIVE_TESTS[@]}"
)
# Tests which are known to be flaky when run in parallel.
GCE_PARALLEL_FLAKY_TESTS=(
"DaemonRestart"
"Elasticsearch"
"Namespaces.*should\sdelete\sfast"
"ServiceAccounts"
"Services.*identically\snamed" # error waiting for reachability, issue: #16285
)
# Tests that should not run on soak cluster.
GCE_SOAK_CONTINUOUS_SKIP_TESTS=(
"GCE\sL7\sLoadBalancer\sController" # issue: #17119
"Density.*30\spods"
"Elasticsearch"
"external\sload\sbalancer"
"identically\snamed\sservices"
"network\spartition"
"Services.*Type\sgoes\sfrom"
"${DISRUPTIVE_TESTS[@]}" # avoid component restarts.
)
GCE_RELEASE_SKIP_TESTS=(
)
TRUSTY_DEFAULT_SKIP_TESTS=(
# TODO(wonderfly): Remove this once
# https://github.com/kubernetes/kubernetes/issues/12689 is fixed.
"Services.*should\swork\safter\srestarting\skube-proxy"
)
TRUSTY_SKIP_TESTS=(
"${TRUSTY_DEFAULT_SKIP_TESTS[@]}"
# These tests rely on cadvisor, which doesn't quite work with Trusty and
# Trusty dev images yet. An internal issue has been filed to track the fix.
# TODO(wonderfly): Remove this once the internal issue is fixed.
"Monitoring\sshould\sverify\smonitoring\spods\sand\sall\scluster\snodes\sare\savailable\son\sinfluxdb\susing\sheapster"
"Horizontal\spod\sautoscaling"
)
TRUSTY_DEV_SKIP_TESTS=(
"${TRUSTY_DEFAULT_SKIP_TESTS[@]}"
# These tests rely on cadvisor, which doesn't quite work with Trusty and
# Trusty dev images yet. An internal issue has been filed to track the fix.
# TODO(wonderfly): Remove this once the internal issue is fixed.
"Monitoring\sshould\sverify\smonitoring\spods\sand\sall\scluster\snodes\sare\savailable\son\sinfluxdb\susing\sheapster"
"Horizontal\spod\sautoscaling"
)
TRUSTY_BETA_SKIP_TESTS=(
"${TRUSTY_DEFAULT_SKIP_TESTS[@]}"
)
# Define environment variables based on the Jenkins project name.
# NOTE: Not all jobs are defined here. The hack/jenkins/e2e.sh in master and
# release branches defines relevant jobs for that particular version of
# Kubernetes.
case ${JOB_NAME} in
# Runs a subset of tests on GCE in parallel. Run against all pending PRs.
kubernetes-pull-build-test-e2e-gce)
: ${E2E_CLUSTER_NAME:="jnks-e2e-gce-${NODE_NAME}-${EXECUTOR_NUMBER}"}
: ${E2E_NETWORK:="e2e-gce-${NODE_NAME}-${EXECUTOR_NUMBER}"}
: ${GINKGO_PARALLEL:="y"}
# This list should match the list in kubernetes-e2e-gce-parallel.
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_PARALLEL_SKIP_TESTS[@]:+${GCE_PARALLEL_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
${GCE_PARALLEL_FLAKY_TESTS[@]:+${GCE_PARALLEL_FLAKY_TESTS[@]}} \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
)"}
: ${KUBE_GCE_INSTANCE_PREFIX:="e2e-gce-${NODE_NAME}-${EXECUTOR_NUMBER}"}
: ${KUBE_GCS_STAGING_PATH_SUFFIX:="-${NODE_NAME}-${EXECUTOR_NUMBER}"}
: ${PROJECT:="kubernetes-jenkins-pull"}
: ${ENABLE_DEPLOYMENTS:=true}
# Override GCE defaults
NUM_MINIONS=${NUM_MINIONS_PARALLEL}
;;
# Runs the performance/scalability tests on GCE using the latest 1.1 ci
# release. A larger cluster is used.
kubernetes-e2e-gce-scalability-1.1)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-scalability-1.1"}
: ${E2E_NETWORK:="e2e-scalability-1-1"}
: ${GINKGO_TEST_ARGS:="--ginkgo.focus=Performance\ssuite"}
: ${JENKINS_PUBLISHED_VERSION:="ci/latest-1.1"}
: ${KUBE_GCE_INSTANCE_PREFIX:="e2e-scalability-1-1"}
: ${KUBE_GCS_STAGING_PATH_SUFFIX:="scalability-1.1"}
: ${PROJECT:="k8s-e2e-gce-scalability-1-1"}
# Override GCE defaults.
E2E_ZONE="us-east1-b"
MASTER_SIZE="n1-standard-4"
MINION_SIZE="n1-standard-2"
MINION_DISK_SIZE="50GB"
NUM_MINIONS="100"
# Reduce logs verbosity
TEST_CLUSTER_LOG_LEVEL="--v=2"
# Increase resync period to simulate production
TEST_CLUSTER_RESYNC_PERIOD="--min-resync-period=12h"
;;
# Sets up the GCE soak cluster weekly using the latest 1.1 ci release.
kubernetes-soak-weekly-deploy-gce-1.1)
: ${E2E_CLUSTER_NAME:="gce-soak-weekly-1.1"}
: ${E2E_DOWN:="false"}
: ${E2E_NETWORK:="gce-soak-weekly-1-1"}
: ${E2E_TEST:="false"}
: ${E2E_UP:="true"}
: ${JENKINS_PUBLISHED_VERSION:="ci/latest-1.1"}
: ${KUBE_GCE_INSTANCE_PREFIX:="gce-soak-weekly-1-1"}
: ${KUBE_GCS_STAGING_PATH_SUFFIX:="soak-1.1"}
: ${PROJECT:="kubernetes-jenkins"}
;;
# Runs tests on GCE soak cluster for latest 1.1 ci release.
kubernetes-soak-continuous-e2e-gce-1.1)
: ${E2E_CLUSTER_NAME:="gce-soak-weekly-1.1"}
: ${E2E_DOWN:="false"}
: ${E2E_NETWORK:="gce-soak-weekly-1-1"}
: ${E2E_UP:="false"}
# Clear out any orphaned namespaces in case previous run was interrupted.
: ${E2E_CLEAN_START:="true"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
${GCE_SOAK_CONTINUOUS_SKIP_TESTS[@]:+${GCE_SOAK_CONTINUOUS_SKIP_TESTS[@]}} \
)"}
: ${KUBE_GCE_INSTANCE_PREFIX:="gce-soak-weekly-1-1"}
: ${PROJECT:="kubernetes-jenkins"}
;;
# Runs non-flaky tests on GCE with Trusty as base image for minions,
# sequentially.
kubernetes-e2e-gce-trusty-release)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-trusty-release"}
: ${E2E_DOWN:="false"}
: ${E2E_NETWORK:="e2e-gce-trusty-release"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_RELEASE_SKIP_TESTS[@]:+${GCE_RELEASE_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
${TRUSTY_SKIP_TESTS[@]:+${TRUSTY_SKIP_TESTS[@]}} \
)"}
: ${KUBE_GCE_INSTANCE_PREFIX="e2e-gce"}
: ${PROJECT:="kubekins-e2e-gce-trusty-rls"}
: ${KUBE_GCE_MINION_PROJECT:="${TRUSTY_IMAGE_PROJECT}"}
: ${KUBE_GCE_MINION_IMAGE:="$(get_latest_trusty_image ${JOB_NAME})"}
: ${KUBE_OS_DISTRIBUTION:="trusty"}
: ${ENABLE_CLUSTER_REGISTRY:=false}
: ${JENKINS_PUBLISHED_VERSION:="release/stable-1.1"}
;;
# Runs slow tests on GCE with Trusy as base image for minions, sequentially.
kubernetes-e2e-gce-trusty-slow)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-trusty-slow"}
: ${E2E_NETWORK:="e2e-gce-trusty-slow"}
: ${GINKGO_TEST_ARGS:="--ginkgo.focus=$(join_regex_no_empty \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
) --ginkgo.skip=$(join_regex_allow_empty \
${TRUSTY_SKIP_TESTS[@]:+${TRUSTY_SKIP_TESTS[@]}} \
)"}
: ${KUBE_GCE_INSTANCE_PREFIX="e2e-trusty-slow"}
: ${PROJECT:="k8s-e2e-gce-trusty-slow"}
: ${KUBE_GCE_MINION_PROJECT:="${TRUSTY_IMAGE_PROJECT}"}
: ${KUBE_GCE_MINION_IMAGE:="$(get_latest_trusty_image ${JOB_NAME})"}
: ${KUBE_OS_DISTRIBUTION:="trusty"}
: ${ENABLE_CLUSTER_REGISTRY:=false}
: ${JENKINS_PUBLISHED_VERSION:="release/stable-1.1"}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
;;
# Runs non-flaky tests on GCE with Trusty-dev as base image for minions,
# sequentially.
kubernetes-e2e-gce-trusty-dev-release)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-trusty-dev-release"}
: ${E2E_DOWN:="false"}
: ${E2E_NETWORK:="e2e-gce-trusty-dev-release"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_RELEASE_SKIP_TESTS[@]:+${GCE_RELEASE_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
${TRUSTY_DEV_SKIP_TESTS[@]:+${TRUSTY_DEV_SKIP_TESTS[@]}} \
)"}
: ${KUBE_GCE_INSTANCE_PREFIX="e2e-gce"}
: ${PROJECT:="k8s-e2e-gce-trusty-dev"}
: ${KUBE_GCE_MINION_PROJECT:="${TRUSTY_IMAGE_PROJECT}"}
: ${KUBE_GCE_MINION_IMAGE:="$(get_latest_trusty_image ${JOB_NAME})"}
: ${KUBE_OS_DISTRIBUTION:="trusty"}
: ${ENABLE_CLUSTER_REGISTRY:=false}
: ${JENKINS_PUBLISHED_VERSION:="release/stable-1.1"}
;;
# Runs slow tests on GCE with Trusy-dev as base image for minions,
# sequentially.
kubernetes-e2e-gce-trusty-dev-slow)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-trusty-dev-slow"}
: ${E2E_NETWORK:="e2e-gce-trusty-dev-slow"}
: ${GINKGO_TEST_ARGS:="--ginkgo.focus=$(join_regex_no_empty \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
) --ginkgo.skip=$(join_regex_allow_empty \
${TRUSTY_DEV_SKIP_TESTS[@]:+${TRUSTY_DEV_SKIP_TESTS[@]}} \
)"}
: ${KUBE_GCE_INSTANCE_PREFIX="e2e-trusty-dev-slow"}
: ${PROJECT:="k8s-e2e-gce-trusty-dev-slow"}
: ${KUBE_GCE_MINION_PROJECT:="${TRUSTY_IMAGE_PROJECT}"}
: ${KUBE_GCE_MINION_IMAGE:="$(get_latest_trusty_image ${JOB_NAME})"}
: ${KUBE_OS_DISTRIBUTION:="trusty"}
: ${ENABLE_CLUSTER_REGISTRY:=false}
: ${JENKINS_PUBLISHED_VERSION:="release/stable-1.1"}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
;;
# Runs non-flaky tests on GCE with Trusty-beta as base image for minions,
# sequentially.
kubernetes-e2e-gce-trusty-beta-release)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-trusty-beta-release"}
: ${E2E_DOWN:="false"}
: ${E2E_NETWORK:="e2e-gce-trusty-beta-release"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_RELEASE_SKIP_TESTS[@]:+${GCE_RELEASE_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
${TRUSTY_BETA_SKIP_TESTS[@]:+${TRUSTY_BETA_SKIP_TESTS[@]}} \
)"}
: ${KUBE_GCE_INSTANCE_PREFIX="e2e-gce"}
: ${PROJECT:="k8s-e2e-gce-trusty-beta"}
: ${KUBE_GCE_MINION_PROJECT:="${TRUSTY_IMAGE_PROJECT}"}
: ${KUBE_GCE_MINION_IMAGE:="$(get_latest_trusty_image ${JOB_NAME})"}
: ${KUBE_OS_DISTRIBUTION:="trusty"}
: ${ENABLE_CLUSTER_REGISTRY:=false}
: ${JENKINS_PUBLISHED_VERSION:="release/stable-1.1"}
;;
# Runs slow tests on GCE with Trusy-beta as base image for minions,
# sequentially.
kubernetes-e2e-gce-trusty-beta-slow)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-trusty-beta-slow"}
: ${E2E_NETWORK:="e2e-gce-trusty-beta-slow"}
: ${GINKGO_TEST_ARGS:="--ginkgo.focus=$(join_regex_no_empty \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
) --ginkgo.skip=$(join_regex_allow_empty \
${TRUSTY_BETA_SKIP_TESTS[@]:+${TRUSTY_BETA_SKIP_TESTS[@]}} \
)"}
: ${KUBE_GCE_INSTANCE_PREFIX="e2e-trusty-beta-slow"}
: ${PROJECT:="k8s-e2e-gce-trusty-beta-slow"}
: ${KUBE_GCE_MINION_PROJECT:="${TRUSTY_IMAGE_PROJECT}"}
: ${KUBE_GCE_MINION_IMAGE:="$(get_latest_trusty_image ${JOB_NAME})"}
: ${KUBE_OS_DISTRIBUTION:="trusty"}
: ${ENABLE_CLUSTER_REGISTRY:=false}
: ${JENKINS_PUBLISHED_VERSION:="release/stable-1.1"}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
;;
# Runs non-flaky tests on GCE on the release candidate branch,
# sequentially. As a reminder, if you need to change the skip list
# or flaky test list on the release branch, you'll need to propose a
# pull request directly to the release branch itself.
kubernetes-e2e-gce-release-1.1)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-release-1.1"}
: ${E2E_DOWN:="false"}
: ${E2E_NETWORK:="gce-e2e-1-1"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
)"}
: ${JENKINS_PUBLISHED_VERSION:="ci/latest-1.1"}
: ${KUBE_GCE_INSTANCE_PREFIX="e2e-gce-1-1"}
: ${KUBE_GCS_STAGING_PATH_SUFFIX:="release-1.1"}
: ${PROJECT:="k8s-jkns-e2e-gce-release"}
: ${ENABLE_DEPLOYMENTS:=true}
;;
# Runs "disruptive" tests on GCE on the release candidate branch,
# sequentially, against the latest 1.1 ci release.
# The autoscaling test is not disruptive, however there is no better suite
# to run it.
kubernetes-e2e-gce-disruptive-1.1)
: ${E2E_CLUSTER_NAME:="jenkins-gce-e2e-disruptive-1.1"}
: ${E2E_DOWN:="false"}
: ${E2E_NETWORK:="gce-e2e-disruptive-1-1"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${REBOOT_SKIP_TESTS[@]:+${REBOOT_SKIP_TESTS[@]}}\
) --ginkgo.focus=$(join_regex_no_empty \
${DISRUPTIVE_TESTS[@]:+${DISRUPTIVE_TESTS[@]}} \
"Autoscaling\sSuite.*via\sreplicationController" \
"GCE\sL7\sLoadBalancer\sController"
)"}
: ${JENKINS_PUBLISHED_VERSION:="ci/latest-1.1"}
: ${KUBE_GCE_INSTANCE_PREFIX="e2e-gce-disruptive-1-1"}
: ${KUBE_GCS_STAGING_PATH_SUFFIX:="disruptive-1.1"}
# TODO: move into its own project
: ${PROJECT:="kubernetes-jenkins"}
: ${ENABLE_DEPLOYMENTS:=true}
: ${ENABLE_DAEMONSETS:=true}
;;
kubernetes-e2e-gke-subnet)
: ${DOGFOOD_GCLOUD:="true"}
: ${E2E_CLUSTER_NAME:="jkns-gke-subnet"}
# auto-subnet manually created - if deleted, it will need to be recreated
# gcloud alpha compute networks create auto-subnet --mode auto
: ${E2E_NETWORK:="auto-subnet"}
: ${E2E_SET_CLUSTER_API_VERSION:=y}
: ${JENKINS_USE_SERVER_VERSION:=y}
: ${PROJECT:="k8s-jkns-e2e-gke-subnet"}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GKE_DEFAULT_SKIP_TESTS[@]:+${GKE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
)"}
;;
kubernetes-e2e-gke-prod)
: ${DOGFOOD_GCLOUD:="true"}
: ${E2E_CLUSTER_NAME:="jkns-gke-e2e-prod"}
: ${E2E_NETWORK:="e2e-gke-prod"}
: ${E2E_SET_CLUSTER_API_VERSION:=y}
: ${JENKINS_USE_SERVER_VERSION:=y}
: ${PROJECT:="k8s-jkns-e2e-gke-prod"}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GKE_DEFAULT_SKIP_TESTS[@]:+${GKE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
)"}
;;
kubernetes-e2e-gke-staging)
: ${DOGFOOD_GCLOUD:="true"}
: ${GKE_API_ENDPOINT:="https://staging-container.sandbox.googleapis.com/"}
: ${E2E_CLUSTER_NAME:="jkns-gke-e2e-staging"}
: ${E2E_NETWORK:="e2e-gke-staging"}
: ${E2E_SET_CLUSTER_API_VERSION:=y}
: ${JENKINS_USE_SERVER_VERSION:=y}
: ${PROJECT:="k8s-jkns-e2e-gke-staging"}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GKE_DEFAULT_SKIP_TESTS[@]:+${GKE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
)"}
;;
kubernetes-e2e-gke-test)
: ${DOGFOOD_GCLOUD:="true"}
: ${CLOUDSDK_BUCKET:="gs://cloud-sdk-build/testing/rc"}
: ${GKE_API_ENDPOINT:="https://test-container.sandbox.googleapis.com/"}
: ${E2E_CLUSTER_NAME:="jkns-gke-e2e-test"}
: ${E2E_NETWORK:="e2e-gke-test"}
: ${E2E_SET_CLUSTER_API_VERSION:=y}
: ${JENKINS_USE_SERVER_VERSION:=y}
: ${PROJECT:="k8s-jkns-e2e-gke-test"}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GKE_DEFAULT_SKIP_TESTS[@]:+${GKE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
)"}
;;
kubernetes-e2e-gke-1.1)
: ${DOGFOOD_GCLOUD:="true"}
: ${GKE_API_ENDPOINT:="https://test-container.sandbox.googleapis.com/"}
: ${E2E_CLUSTER_NAME:="gke-release-1-1"}
: ${E2E_NETWORK:="gke-release-1-1"}
: ${E2E_SET_CLUSTER_API_VERSION:=y}
: ${JENKINS_PUBLISHED_VERSION:="ci/latest-1.1"}
: ${PROJECT:="k8s-jkns-e2e-gke-release-1-1"}
: ${FAIL_ON_GCP_RESOURCE_LEAK:="true"}
# Note Daemon sets and Deployments are experimental features in 1.1,
# and are turned off in GKE.
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GKE_DEFAULT_SKIP_TESTS[@]:+${GKE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
)"}
;;
kubernetes-e2e-aws-release-1.1)
: ${E2E_PUBLISH_GREEN_VERSION:=true}
: ${E2E_CLUSTER_NAME:="e2e-aws-1-1"}
: ${E2E_NETWORK:="e2e-aws-1-1"}
: ${E2E_ZONE:="us-west-2a"}
: ${ZONE:="us-west-2a"}
: ${JENKINS_PUBLISHED_VERSION:="ci/latest-1.1"}
: ${GINKGO_TEST_ARGS:="--ginkgo.skip=$(join_regex_allow_empty \
${GCE_DEFAULT_SKIP_TESTS[@]:+${GCE_DEFAULT_SKIP_TESTS[@]}} \
${GCE_FLAKY_TESTS[@]:+${GCE_FLAKY_TESTS[@]}} \
${GCE_SLOW_TESTS[@]:+${GCE_SLOW_TESTS[@]}} \
${AWS_REQUIRED_SKIP_TESTS[@]:+${AWS_REQUIRED_SKIP_TESTS[@]}} \
)"}
: ${AWS_CONFIG_FILE:='/var/lib/jenkins/.aws/credentials'}
: ${AWS_SSH_KEY:='/var/lib/jenkins/.ssh/kube_aws_rsa'}
: ${KUBE_SSH_USER:='ubuntu'}
# Needed to be able to create PD from the e2e test
: ${AWS_SHARED_CREDENTIALS_FILE:='/var/lib/jenkins/.aws/credentials'}
;;
# kubernetes-upgrade-gke-1.1-master
#
# Test upgrades from the latest release-1.1 build to the latest master build.
#
# Configurations for step2, step3, step5, and step7 live in master.
kubernetes-upgrade-gke-1.1-master-step1-deploy)
configure_upgrade_step 'ci/latest-1.1' 'configured-in-master' 'upgrade-gke-1-1-master' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-1.1-master-step4-e2e-old)
configure_upgrade_step 'ci/latest-1.1' 'configured-in-master' 'upgrade-gke-1-1-master' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-1.1-master-step6-e2e-old)
configure_upgrade_step 'ci/latest-1.1' 'configured-in-master' 'upgrade-gke-1-1-master' 'kubernetes-jenkins-gke-upgrade'
;;
# kubernetes-upgrade-gke-1.0-current-release
#
# Test upgrades from the latest release-1.0 build to the latest current
# release build.
#
# Configurations for step1, step4, and step6 live in the release-1.0 branch.
kubernetes-upgrade-gke-1.0-current-release-step2-kubectl-e2e-new)
configure_upgrade_step 'configured-in-release-1.0' 'ci/latest-1.1' 'upgrade-gke-1-0-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-1.0-current-release-step3-upgrade-master)
configure_upgrade_step 'configured-in-release-1.0' 'ci/latest-1.1' 'upgrade-gke-1-0-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-1.0-current-release-step5-upgrade-cluster)
configure_upgrade_step 'configured-in-release-1.0' 'ci/latest-1.1' 'upgrade-gke-1-0-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-1.0-current-release-step7-e2e-new)
configure_upgrade_step 'configured-in-release-1.0' 'ci/latest-1.1' 'upgrade-gke-1-0-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
# kubernetes-upgrade-gke-stable-current-release
#
# Test upgrades from the stable build to the latest current release build.
kubernetes-upgrade-gke-stable-current-release-step1-deploy)
configure_upgrade_step 'release/stable-1.1' 'ci/latest-1.1' 'upgrade-gke-stable-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-stable-current-release-step2-kubectl-e2e-new)
configure_upgrade_step 'release/stable-1.1' 'ci/latest-1.1' 'upgrade-gke-stable-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-stable-current-release-step3-upgrade-master)
configure_upgrade_step 'release/stable-1.1' 'ci/latest-1.1' 'upgrade-gke-stable-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-stable-current-release-step4-e2e-old)
configure_upgrade_step 'release/stable-1.1' 'ci/latest-1.1' 'upgrade-gke-stable-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-stable-current-release-step5-upgrade-cluster)
configure_upgrade_step 'release/stable-1.1' 'ci/latest-1.1' 'upgrade-gke-stable-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-stable-current-release-step6-e2e-old)
configure_upgrade_step 'release/stable-1.1' 'ci/latest-1.1' 'upgrade-gke-stable-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
kubernetes-upgrade-gke-stable-current-release-step7-e2e-new)
configure_upgrade_step 'release/stable-1.1' 'ci/latest-1.1' 'upgrade-gke-stable-current-release' 'kubernetes-jenkins-gke-upgrade'
;;
esac
# AWS variables
export KUBE_AWS_INSTANCE_PREFIX=${E2E_CLUSTER_NAME}
export KUBE_AWS_ZONE=${E2E_ZONE}
export AWS_CONFIG_FILE=${AWS_CONFIG_FILE:-}
export AWS_SSH_KEY=${AWS_SSH_KEY:-}
export KUBE_SSH_USER=${KUBE_SSH_USER:-}
export AWS_SHARED_CREDENTIALS_FILE=${AWS_SHARED_CREDENTIALS_FILE:-}
# GCE variables
export INSTANCE_PREFIX=${E2E_CLUSTER_NAME}
export KUBE_GCE_ZONE=${E2E_ZONE}
export KUBE_GCE_NETWORK=${E2E_NETWORK}
export KUBE_GCE_INSTANCE_PREFIX=${KUBE_GCE_INSTANCE_PREFIX:-}
export KUBE_GCS_STAGING_PATH_SUFFIX=${KUBE_GCS_STAGING_PATH_SUFFIX:-}
export KUBE_GCE_MINION_PROJECT=${KUBE_GCE_MINION_PROJECT:-}
export KUBE_GCE_MINION_IMAGE=${KUBE_GCE_MINION_IMAGE:-}
export KUBE_OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-}
# GKE variables
export CLUSTER_NAME=${E2E_CLUSTER_NAME}
export ZONE=${E2E_ZONE}
export KUBE_GKE_NETWORK=${E2E_NETWORK}
export E2E_SET_CLUSTER_API_VERSION=${E2E_SET_CLUSTER_API_VERSION:-}
export DOGFOOD_GCLOUD=${DOGFOOD_GCLOUD:-}
export CMD_GROUP=${CMD_GROUP:-}
export MACHINE_TYPE=${MINION_SIZE:-} # GKE scripts use MACHINE_TYPE for the node vm size
if [[ ! -z "${GKE_API_ENDPOINT:-}" ]]; then
export CLOUDSDK_API_ENDPOINT_OVERRIDES_CONTAINER=${GKE_API_ENDPOINT}
fi
# Shared cluster variables
export E2E_MIN_STARTUP_PODS=${E2E_MIN_STARTUP_PODS:-}
export KUBE_ENABLE_CLUSTER_MONITORING=${ENABLE_CLUSTER_MONITORING:-}
export KUBE_ENABLE_CLUSTER_REGISTRY=${ENABLE_CLUSTER_REGISTRY:-}
export KUBE_ENABLE_HORIZONTAL_POD_AUTOSCALER=${ENABLE_HORIZONTAL_POD_AUTOSCALER:-}
export KUBE_ENABLE_DEPLOYMENTS=${ENABLE_DEPLOYMENTS:-}
export KUBE_ENABLE_EXPERIMENTAL_API=${ENABLE_EXPERIMENTAL_API:-}
export MASTER_SIZE=${MASTER_SIZE:-}
export MINION_SIZE=${MINION_SIZE:-}
export MINION_DISK_SIZE=${MINION_DISK_SIZE:-}
export NUM_MINIONS=${NUM_MINIONS:-}
export TEST_CLUSTER_LOG_LEVEL=${TEST_CLUSTER_LOG_LEVEL:-}
export TEST_CLUSTER_RESYNC_PERIOD=${TEST_CLUSTER_RESYNC_PERIOD:-}
export PROJECT=${PROJECT:-}
export JENKINS_EXPLICIT_VERSION=${JENKINS_EXPLICIT_VERSION:-}
export JENKINS_PUBLISHED_VERSION=${JENKINS_PUBLISHED_VERSION:-'ci/latest'}
export KUBE_ADMISSION_CONTROL=${ADMISSION_CONTROL:-}
export KUBERNETES_PROVIDER=${KUBERNETES_PROVIDER}
export PATH=${PATH}:/usr/local/go/bin
export KUBE_SKIP_CONFIRMATIONS=y
# E2E Control Variables
export E2E_UP="${E2E_UP:-true}"
export E2E_TEST="${E2E_TEST:-true}"
export E2E_DOWN="${E2E_DOWN:-true}"
export E2E_CLEAN_START="${E2E_CLEAN_START:-}"
# Used by hack/ginkgo-e2e.sh to enable ginkgo's parallel test runner.
export GINKGO_PARALLEL=${GINKGO_PARALLEL:-}
echo "--------------------------------------------------------------------------------"
echo "Test Environment:"
printenv | sort
echo "--------------------------------------------------------------------------------"
# We get the Kubernetes tarballs on either cluster creation or when we want to
# replace existing ones in a multi-step job (e.g. a cluster upgrade).
if [[ "${E2E_UP,,}" == "true" || "${JENKINS_FORCE_GET_TARS:-}" =~ ^[yY]$ ]]; then
if [[ ${KUBE_RUN_FROM_OUTPUT:-} =~ ^[yY]$ ]]; then
echo "Found KUBE_RUN_FROM_OUTPUT=y; will use binaries from _output"
cp _output/release-tars/kubernetes*.tar.gz .
else
echo "Pulling binaries from GCS"
# In a multi-step job, clean up just the kubernetes build files.
# Otherwise, we want a completely empty directory.
if [[ "${JENKINS_FORCE_GET_TARS:-}" =~ ^[yY]$ ]]; then
rm -rf kubernetes*
elif [[ $(find . | wc -l) != 1 ]]; then
echo $PWD not empty, bailing!
exit 1
fi
# Tell kube-up.sh to skip the update, it doesn't lock. An internal
# gcloud bug can cause racing component updates to stomp on each
# other.
export KUBE_SKIP_UPDATE=y
(
# ----------- WARNING! DO NOT TOUCH THIS CODE -----------
#
# The purpose of this block is to ensure that only one job attempts to
# update gcloud at a time.
#
# PLEASE DO NOT TOUCH THIS CODE unless you are certain you understand
# implications. Please cc jlowdermilk@ or brendandburns@ on changes.
# If jenkins was recently restarted and jobs are failing with
#
# flock: 9: Permission denied
#
# ssh into the jenkins master and run
# $ sudo chown jenkins:jenkins /var/run/lock/gcloud-components.lock
#
# Note, flock -n would prevent parallel runs from having to wait
# here, but because we've set -o errexit, the err gets caught
# despite running in a subshell. If a run has to wait, the subsequent
# component update commands will be no-op, so no added delay.
flock -x -w 60 9
# We do NOT want to run gcloud components update under sudo, as that causes
# the gcloud files to get chown'd by root, which makes them undeletable in
# the case where we are installing gcloud under the workspace (e.g. for gke-ci
# and friends). If we can't cleanup old workspaces, jenkins runs out of disk.
#
# If the update commands are failing with permission denied, ssh into
# the jenkins master and run
#
# $ sudo chown -R jenkins:jenkins /usr/local/share/google/google-cloud-sdk
gcloud components update -q || true
gcloud components update alpha -q || true
gcloud components update beta -q || true
) 9>/var/run/lock/gcloud-components.lock
if [[ ! -z ${JENKINS_EXPLICIT_VERSION:-} ]]; then
# Use an explicit pinned version like "ci/v0.10.0-101-g6c814c4" or
# "release/v0.19.1"
IFS='/' read -a varr <<< "${JENKINS_EXPLICIT_VERSION}"
bucket="${varr[0]}"
githash="${varr[1]}"
echo "Using explicit version $bucket/$githash"
elif [[ ${JENKINS_USE_SERVER_VERSION:-} =~ ^[yY]$ ]]; then
# for GKE we can use server default version.
bucket="release"
msg=$(gcloud ${CMD_GROUP} container get-server-config --project=${PROJECT} --zone=${ZONE} | grep defaultClusterVersion)
# msg will look like "defaultClusterVersion: 1.0.1". Strip
# everything up to, including ": "
githash="v${msg##*: }"
echo "Using server version $bucket/$githash"
else # use JENKINS_PUBLISHED_VERSION
# Use a published version like "ci/latest" (default),
# "release/latest", "release/latest-1", or "release/stable"
IFS='/' read -a varr <<< "${JENKINS_PUBLISHED_VERSION}"
bucket="${varr[0]}"