mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-09 16:00:22 +00:00
ci: add support to create extra disks through minikube
Signed-off-by: Rakshith R <rar@redhat.com>
(cherry picked from commit 1b64a0a505
)
This commit is contained in:
parent
b6d1cc2317
commit
e8520edf8d
@ -163,6 +163,8 @@ MEMORY=${MEMORY:-"4096"}
|
||||
CPUS=${CPUS:-"$(nproc)"}
|
||||
VM_DRIVER=${VM_DRIVER:-"virtualbox"}
|
||||
CNI=${CNI:-"bridge"}
|
||||
NUM_DISKS=${NUM_DISKS:-"1"}
|
||||
DISK_SIZE=${DISK_SIZE:-"32g"}
|
||||
#configure image repo
|
||||
CEPHCSI_IMAGE_REPO=${CEPHCSI_IMAGE_REPO:-"quay.io/cephcsi"}
|
||||
K8S_IMAGE_REPO=${K8S_IMAGE_REPO:-"k8s.gcr.io/sig-storage"}
|
||||
@ -172,6 +174,13 @@ if [[ "${VM_DRIVER}" == "kvm2" ]]; then
|
||||
DISK="vda1"
|
||||
fi
|
||||
|
||||
if [[ "${VM_DRIVER}" == "kvm2" ]] || [[ "${VM_DRIVER}" == "hyperkit" ]]; then
|
||||
# adding extra disks is only supported on kvm2 and hyperkit
|
||||
DISK_CONFIG=${DISK_CONFIG:-" --extra-disks=${NUM_DISKS} --disk-size=${DISK_SIZE} "}
|
||||
else
|
||||
DISK_CONFIG=""
|
||||
fi
|
||||
|
||||
#feature-gates for kube
|
||||
K8S_FEATURE_GATES=${K8S_FEATURE_GATES:-"ExpandCSIVolumes=true"}
|
||||
|
||||
@ -216,16 +225,16 @@ up)
|
||||
if minikube_supports_psp; then
|
||||
enable_psp
|
||||
# shellcheck disable=SC2086
|
||||
${minikube} start --force --memory="${MEMORY}" --cpus="${CPUS}" -b kubeadm --kubernetes-version="${KUBE_VERSION}" --driver="${VM_DRIVER}" --feature-gates="${K8S_FEATURE_GATES}" --cni="${CNI}" ${EXTRA_CONFIG}
|
||||
${minikube} start --force --memory="${MEMORY}" --cpus="${CPUS}" -b kubeadm --kubernetes-version="${KUBE_VERSION}" --driver="${VM_DRIVER}" --feature-gates="${K8S_FEATURE_GATES}" --cni="${CNI}" ${EXTRA_CONFIG} "${DISK_CONFIG}"
|
||||
else
|
||||
# This is a workaround to fix psp issues in minikube >1.6.2 and <1.11.0
|
||||
# shellcheck disable=SC2086
|
||||
${minikube} start --force --memory="${MEMORY}" --cpus="${CPUS}" -b kubeadm --kubernetes-version="${KUBE_VERSION}" --driver="${VM_DRIVER}" --feature-gates="${K8S_FEATURE_GATES}" --cni="${CNI}"
|
||||
${minikube} start --force --memory="${MEMORY}" --cpus="${CPUS}" -b kubeadm --kubernetes-version="${KUBE_VERSION}" --driver="${VM_DRIVER}" --feature-gates="${K8S_FEATURE_GATES}" --cni="${CNI}" "${DISK_CONFIG}"
|
||||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
${minikube} kubectl -- apply -f "$DIR"/psp.yaml
|
||||
${minikube} stop
|
||||
# shellcheck disable=SC2086
|
||||
${minikube} start --force --memory="${MEMORY}" --cpus="${CPUS}" -b kubeadm --kubernetes-version="${KUBE_VERSION}" --driver="${VM_DRIVER}" --feature-gates="${K8S_FEATURE_GATES}" --cni="${CNI}" ${EXTRA_CONFIG}
|
||||
${minikube} start --force --memory="${MEMORY}" --cpus="${CPUS}" -b kubeadm --kubernetes-version="${KUBE_VERSION}" --driver="${VM_DRIVER}" --feature-gates="${K8S_FEATURE_GATES}" --cni="${CNI}" ${EXTRA_CONFIG} "${DISK_CONFIG}"
|
||||
fi
|
||||
|
||||
# create a link so the default dataDirHostPath will work for this
|
||||
|
Loading…
Reference in New Issue
Block a user