mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	local-up-cluster.sh should create a default storage class
To make dynamic provisioning working out of the box in local cluster a default storage class needs to be instantiated.
This commit is contained in:
		@@ -68,6 +68,9 @@ ENABLE_RBAC=${ENABLE_RBAC:-false}
 | 
				
			|||||||
KUBECONFIG_TOKEN=${KUBECONFIG_TOKEN:-""}
 | 
					KUBECONFIG_TOKEN=${KUBECONFIG_TOKEN:-""}
 | 
				
			||||||
AUTH_ARGS=${AUTH_ARGS:-""}
 | 
					AUTH_ARGS=${AUTH_ARGS:-""}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Install a default storage class (enabled by default)
 | 
				
			||||||
 | 
					DEFAULT_STORAGE_CLASS=${KUBE_DEFAULT_STORAGE_CLASS:-true}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# start the cache mutation detector by default so that cache mutators will be found
 | 
					# start the cache mutation detector by default so that cache mutators will be found
 | 
				
			||||||
KUBE_CACHE_MUTATION_DETECTOR="${KUBE_CACHE_MUTATION_DETECTOR:-true}"
 | 
					KUBE_CACHE_MUTATION_DETECTOR="${KUBE_CACHE_MUTATION_DETECTOR:-true}"
 | 
				
			||||||
export KUBE_CACHE_MUTATION_DETECTOR
 | 
					export KUBE_CACHE_MUTATION_DETECTOR
 | 
				
			||||||
@@ -694,6 +697,21 @@ function create_psp_policy {
 | 
				
			|||||||
    ${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" create -f ${KUBE_ROOT}/examples/podsecuritypolicy/rbac/bindings.yaml
 | 
					    ${KUBECTL} --kubeconfig="${CERT_DIR}/admin.kubeconfig" create -f ${KUBE_ROOT}/examples/podsecuritypolicy/rbac/bindings.yaml
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function create_storage_class {
 | 
				
			||||||
 | 
					    if [ -z "$CLOUD_PROVIDER" ]; then
 | 
				
			||||||
 | 
					        # No cloud provider -> no default storage class
 | 
				
			||||||
 | 
					        return
 | 
				
			||||||
 | 
					    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
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					        echo "No storage class available for $CLOUD_PROVIDER."
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function print_success {
 | 
					function print_success {
 | 
				
			||||||
if [[ "${START_MODE}" != "kubeletonly" ]]; then
 | 
					if [[ "${START_MODE}" != "kubeletonly" ]]; then
 | 
				
			||||||
  cat <<EOF
 | 
					  cat <<EOF
 | 
				
			||||||
@@ -803,6 +821,10 @@ if [[ -n "${PSP_ADMISSION}" && "${ENABLE_RBAC}" = true ]]; then
 | 
				
			|||||||
  create_psp_policy
 | 
					  create_psp_policy
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [[ "$DEFAULT_STORAGE_CLASS" = "true" ]]; then
 | 
				
			||||||
 | 
					  create_storage_class
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
print_success
 | 
					print_success
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ "${ENABLE_DAEMON}" = false ]]; then
 | 
					if [[ "${ENABLE_DAEMON}" = false ]]; then
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user