forked from intel/pmem-csi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-config.sh
170 lines (141 loc) · 6.96 KB
/
test-config.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
# This file is meant to be sourced into various scripts in this directory and provides
# some common settings.
#
# All of these settings can be overridden by environment variables. This makes
# it possible to create different clusters in parallel with different settings,
# for example:
# TEST_CRI=docker CLUSTER=clear-govm-docker make start
# TEST_CRI=crio CLUSTER=clear-govm-crio make start
# Allow overriding the configuration in additional file(s).
if [ -d test/test-config.d ]; then
for i in $(ls test/test-config.d/*.sh 2>/dev/null | sort); do
. $i
done
fi
# The operating system to install inside the nodes.
: ${TEST_DISTRO:=fedora}
# Choose the version of the operating system that gets installed. Valid
# values depend on the OS.
: ${TEST_DISTRO_VERSION:=}
# The container runtime that is meant to be used.
# Possible values are "docker", "containerd", and "crio". Non-default
# values are untested and may or may not work.
#
# cri-o is the default on Clear Linux because that is supported better
# and Docker elsewhere because we can install it easily.
: ${TEST_CRI:=$(case ${TEST_DISTRO} in clear) echo crio;; *) echo containerd;; esac)}
# A local registry running on the build host, aka localhost:5000.
# In order to reach it from inside the virtual cluster, we need
# to use a public IP address that the registry is likely to listen
# on. Here we default to the IP address of the docker0 interface.
: ${TEST_LOCAL_REGISTRY:=$(ip addr show dev docker0 2>/dev/null | (grep " inet " || echo localhost) | sed -e 's/.* inet //' -e 's;/.*;;'):5000}
# The registry used for PMEM-CSI image(s). Must be reachable from
# inside the cluster.
: ${TEST_PMEM_REGISTRY:=${TEST_LOCAL_REGISTRY}}
# The same registry reachable from the build host.
# This is needed for "make push-images".
: ${TEST_BUILD_PMEM_REGISTRY:=localhost:5000}
# Additional insecure registries (for example, my-registry:5000),
# separated by spaces. The default local registry above is always
# marked as insecure and does not need to be listed.
: ${TEST_INSECURE_REGISTRIES:=}
# Additional Clear Linux bundles.
: ${TEST_CLEAR_LINUX_BUNDLES:=storage-utils}
# Called after Kubernetes has been configured and started on the master node.
: ${TEST_CONFIGURE_POST_MASTER:=}
# Called after Kubernetes has been configured and started on all nodes.
: ${TEST_CONFIGURE_POST_ALL:=}
# PMEM NVDIMM configuration.
#
# See https://github.com/qemu/qemu/blob/bd54b11062c4baa7d2e4efadcf71b8cfd55311fd/docs/nvdimm.txt
# for details about QEMU simulated PMEM.
: ${TEST_MEM_SLOTS:=2}
: ${TEST_NORMAL_MEM_SIZE:=2048} # 2GB
: ${TEST_PMEM_MEM_SIZE:=65536} # 64GB
: ${TEST_PMEM_SHARE:=on}
: ${TEST_PMEM_LABEL_SIZE:=2097152}
# Number of CPUS in QEMU VM. Must be at least 2 for Kubernetes.
: ${TEST_NUM_CPUS:=2}
# QEMU -cpu parameter.
#
# "host" enables nested virtualization (required for Kata Containers).
# The build host must have the kvm_intel module loaded with
# nested=1 (see https://wiki.archlinux.org/index.php/KVM#Nested_virtualization).
: ${TEST_QEMU_CPU:=host}
# The etcd instance running on the master node can be configured to
# store its data on a separate disk. This is the path to an existing
# file of the desired size which will then be passed into the master
# node via "-drive file=...". For that to work the file has
# to be inside the "data" directory of the master node.
#
# This is useful when the _work directory is on a slow disk
# because that can lead to slow performance and failures
# (https://github.com/kubernetes/kubernetes/issues/70082).
: ${TEST_ETCD_VOLUME:=}
# Device mode that test/setup-deployment.sh is using.
# Allowed values: lvm, direct
# This string is used as part of deployment file name.
: ${TEST_DEVICEMODE:=lvm}
# Which deployment test/setup-deployment.sh is using.
# Allowed values: testing (default), production
: ${TEST_DEPLOYMENTMODE:=testing}
# Which image pull policy test/setup-deployment.sh is using.
# Allowed values: IfNotPresent, Always, Never
: ${TEST_IMAGE_PULL_POLICY:=IfNotPresent}
# Namespace used by test/start-operator.sh for the operator
# itself.
: ${TEST_OPERATOR_NAMESPACE:=default}
# A value for the pmem-csi.intel.com/deployment label that is
# set for all objects created by test/start-operator.sh.
: ${TEST_OPERATOR_DEPLOYMENT_LABEL:=operator}
# TLS certificates installed by test/setup-deployment.sh.
: ${TEST_CA:=_work/pmem-ca/ca.pem}
: ${TEST_REGISTRY_CERT:=_work/pmem-ca/pmem-registry.pem}
: ${TEST_REGISTRY_KEY:=_work/pmem-ca/pmem-registry-key.pem}
: ${TEST_NODE_CERT:=_work/pmem-ca/pmem-node-controller.pem}
: ${TEST_NODE_KEY:=_work/pmem-ca/pmem-node-controller-key.pem}
# Initialize "region0" as required by PMEM-CSI.
: ${TEST_INIT_REGION:=true}
# Validate signature of downloaded image files.
# This may have to be disabled for Clear Linux depending
# on the version of OpenSSL on the build host
# (https://github.com/clearlinux/distribution/issues/85).
: ${TEST_CHECK_SIGNED_FILES:=true}
# "make start" tests that /dev/kvm exists before invoking govm because
# when it is missing, the failure of QEMU inside the containers is
# hard to diagnose.
#
# However, in some rather special circumstances it may be necessary to
# disable this check. For example, the CI runs "make start" in a
# non-privileged container without /dev/kvm whereas QEMU will run in
# privileged containers where /dev/kvm is available.
: ${TEST_CHECK_KVM:=true}
# If set to a <major>.<minor> number, that version of Kubernetes
# is installed instead of the latest one. Ignored when
# using Clear Linux as OS because with Clear Linux we have
# to use the Kubernetes version that ships with it.
: ${TEST_KUBERNETES_VERSION:=1.19}
# Can be used to pick one of potentially severally of the
# pre-generated deploy/kubernetes-<version><flavor> deployment
# variants for a certain Kubernetes release. Either empty or must
# match the directory suffix, i.e. start with a hyphen.
: ${TEST_KUBERNETES_FLAVOR:=}
# Kubernetes feature gates to enable/disable.
# EndpointSlice is disabled because of https://github.com/kubernetes/kubernetes/issues/91287 (Kubernetes
# < 1.19) and because there were random connection failures to node ports during sanity
# testing (Kubernetes 1.19.0)
: ${TEST_FEATURE_GATES:=CSINodeInfo=true,CSIDriverRegistry=true,CSIBlockVolume=true,CSIInlineVolume=true\
$(case ${TEST_KUBERNETES_VERSION} in 1.1[0-5]) ;; *) echo ',EndpointSlice=false';; esac)\
$(case ${TEST_KUBERNETES_VERSION} in 1.19) echo ',CSIStorageCapacity=true,GenericEphemeralVolume=true,EndpointSliceProxying=false';; esac)\
}
# If non-empty, the version of Kata Containers which is to be installed
# in the Kubernetes cluster. Installation is done with
# https://hub.docker.com/r/katadocker/kata-deploy
#
# The version should be >= 1.11.0-rc0 for support of PMEM volumes.
: ${TEST_KATA_CONTAINERS_VERSION:=}
# Kubernetes node port number
# (https://kubernetes.io/docs/concepts/services-networking/service/#nodeport)
# that is going to be used by kube-scheduler to reach the scheduler
# extender service (see deploy/scheduler/scheduler-service.yaml).
: ${TEST_SCHEDULER_EXTENDER_NODE_PORT:=32000}