mirror of https://github.com/k3s-io/k3s
Support running StatefulSetBasic e2e tests with local-up-cluster
Currently StatefulSet(s) fail when you use local-up-cluster without setting a cloud provider. In this PR, we use set the kubernetes.io/host-path provisioner as the default provisioner when there CLOUD_PROVIDER is not specified. This enables e2e test(s) (specifically StatefulSetBasic) to work.pull/6/head
parent
9fbefe3b97
commit
49faff32da
|
@ -0,0 +1,10 @@
|
|||
apiVersion: storage.k8s.io/v1beta1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
namespace: kube-system
|
||||
name: standard
|
||||
annotations:
|
||||
storageclass.beta.kubernetes.io/is-default-class: "true"
|
||||
labels:
|
||||
addonmanager.kubernetes.io/mode: Reconcile
|
||||
provisioner: kubernetes.io/host-path
|
|
@ -742,11 +742,11 @@ function create_psp_policy {
|
|||
|
||||
function create_storage_class {
|
||||
if [ -z "$CLOUD_PROVIDER" ]; then
|
||||
# No cloud provider -> no default storage class
|
||||
return
|
||||
CLASS_FILE=${KUBE_ROOT}/cluster/addons/storage-class/local/default.yaml
|
||||
else
|
||||
CLASS_FILE=${KUBE_ROOT}/cluster/addons/storage-class/${CLOUD_PROVIDER}/default.yaml
|
||||
fi
|
||||
|
||||
CLASS_FILE=${KUBE_ROOT}/cluster/addons/storage-class/${CLOUD_PROVIDER}/default.yaml
|
||||
if [ -e $CLASS_FILE ]; then
|
||||
echo "Create default storage class for $CLOUD_PROVIDER"
|
||||
${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" create -f $CLASS_FILE
|
||||
|
|
Loading…
Reference in New Issue